diff options
author | Andrew Trick <atrick@apple.com> | 2012-09-17 22:19:12 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-09-17 22:19:12 +0000 |
commit | a2a47d1c50a7acecd729109c334ce3c496f0d549 (patch) | |
tree | baa1be9cb377adfaf5e845c3f61bfa565d3de3e5 /lib/MC | |
parent | 12886db4a7af74f17281695320c40248cb263f55 (diff) | |
download | external_llvm-a2a47d1c50a7acecd729109c334ce3c496f0d549.zip external_llvm-a2a47d1c50a7acecd729109c334ce3c496f0d549.tar.gz external_llvm-a2a47d1c50a7acecd729109c334ce3c496f0d549.tar.bz2 |
InitMCProcessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCSubtargetInfo.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/MC/MCSubtargetInfo.cpp b/lib/MC/MCSubtargetInfo.cpp index ae2e8a1..3eae8ce 100644 --- a/lib/MC/MCSubtargetInfo.cpp +++ b/lib/MC/MCSubtargetInfo.cpp @@ -19,6 +19,20 @@ using namespace llvm; MCSchedModel MCSchedModel::DefaultSchedModel; // For unknown processors. +/// ReInitMCSubtargetInfo - Set or chaing the CPU (optionally supplemented +/// with feature string). Recompute feature bits and scheduling model. +void +MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef FS) { + SubtargetFeatures Features(FS); + FeatureBits = Features.getFeatureBits(CPU, ProcDesc, NumProcs, + ProcFeatures, NumFeatures); + + if (!CPU.empty()) + CPUSchedModel = getSchedModelForCPU(CPU); + else + CPUSchedModel = &MCSchedModel::DefaultSchedModel; +} + void MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS, const SubtargetFeatureKV *PF, @@ -45,20 +59,7 @@ MCSubtargetInfo::InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS, NumFeatures = NF; NumProcs = NP; - SubtargetFeatures Features(FS); - FeatureBits = Features.getFeatureBits(CPU, ProcDesc, NumProcs, - ProcFeatures, NumFeatures); - - CPUSchedModel = getSchedModelForCPU(CPU); -} - -/// ReInitMCSubtargetInfo - Change CPU (and optionally supplemented with -/// feature string) and recompute feature bits. -uint64_t MCSubtargetInfo::ReInitMCSubtargetInfo(StringRef CPU, StringRef FS) { - SubtargetFeatures Features(FS); - FeatureBits = Features.getFeatureBits(CPU, ProcDesc, NumProcs, - ProcFeatures, NumFeatures); - return FeatureBits; + InitMCProcessorInfo(CPU, FS); } /// ToggleFeature - Toggle a feature and returns the re-computed feature |