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
This commit is contained in:
Eric Christopher 2015-01-26 17:33:30 +00:00
parent 8e43882572
commit 5da54492f1
2 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,7 @@ class StringRef;
///
class MCSubtargetInfo {
std::string TargetTriple; // Target triple
std::string CPU; // CPU being targeted.
ArrayRef<SubtargetFeatureKV> ProcFeatures; // Processor feature list
ArrayRef<SubtargetFeatureKV> 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 {

View File

@ -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<SubtargetFeatureKV> PF,
ArrayRef<SubtargetFeatureKV> 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;