From: Eric Christopher Date: Mon, 26 Jan 2015 17:33:30 +0000 (+0000) Subject: Store the passed in CPU name string so that it can be accessed later. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5da54492f13f4263eeb4323f4c7baaaa11807519;p=oota-llvm.git Store the passed in CPU name string so that it can be accessed later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227101 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/MC/MCSubtargetInfo.h b/include/llvm/MC/MCSubtargetInfo.h index 3f38bd59a57..3984a1fb21b 100644 --- a/include/llvm/MC/MCSubtargetInfo.h +++ b/include/llvm/MC/MCSubtargetInfo.h @@ -28,6 +28,7 @@ class StringRef; /// class MCSubtargetInfo { std::string TargetTriple; // Target triple + std::string CPU; // CPU being targeted. ArrayRef ProcFeatures; // Processor feature list ArrayRef ProcDesc; // Processor descriptions @@ -59,6 +60,11 @@ public: return TargetTriple; } + /// getCPU - Return the CPU string. + StringRef getCPU() const { + return CPU; + } + /// getFeatureBits - Return the feature bits. /// uint64_t getFeatureBits() const { diff --git a/lib/MC/MCSubtargetInfo.cpp b/lib/MC/MCSubtargetInfo.cpp index b8e42bd0c1b..ca3894b29d3 100644 --- a/lib/MC/MCSubtargetInfo.cpp +++ b/lib/MC/MCSubtargetInfo.cpp @@ -35,7 +35,7 @@ MCSubtargetInfo::InitCPUSchedModel(StringRef CPU) { } void -MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS, +MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef C, StringRef FS, ArrayRef PF, ArrayRef PD, const SubtargetInfoKV *ProcSched, @@ -46,6 +46,7 @@ MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS, const unsigned *OC, const unsigned *FP) { TargetTriple = TT; + CPU = C; ProcFeatures = PF; ProcDesc = PD; ProcSchedModels = ProcSched;