diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llc/llc.cpp | 6 | ||||
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 12 | ||||
-rw-r--r-- | tools/llvm-objdump/llvm-objdump.cpp | 3 | ||||
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 4 | ||||
-rw-r--r-- | tools/lto/LTOModule.cpp | 5 |
5 files changed, 12 insertions, 18 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index e89b4d8318..a2e508ddc0 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -261,16 +261,16 @@ int main(int argc, char **argv) { // Package up features to be passed to target/subtarget std::string FeaturesStr; - if (MCPU.size() || MAttrs.size()) { + if (MAttrs.size()) { SubtargetFeatures Features; - Features.setCPU(MCPU); for (unsigned i = 0; i != MAttrs.size(); ++i) Features.AddFeature(MAttrs[i]); FeaturesStr = Features.getString(); } std::auto_ptr<TargetMachine> - target(TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr)); + target(TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, + FeaturesStr)); assert(target.get() && "Could not allocate target machine!"); TargetMachine &Target = *target.get(); diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index e2244597af..b1d9a60ede 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -309,17 +309,13 @@ static int AssembleInput(const char *ProgName) { // Package up features to be passed to target/subtarget std::string FeaturesStr; - if (MCPU.size()) { - SubtargetFeatures Features; - Features.setCPU(MCPU); - FeaturesStr = Features.getString(); - } // FIXME: We shouldn't need to do this (and link in codegen). // When we split this out, we should do it in a way that makes // it straightforward to switch subtargets on the fly (.e.g, // the .cpu and .code16 directives). OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, + MCPU, FeaturesStr)); if (!TM) { @@ -415,17 +411,13 @@ static int DisassembleInput(const char *ProgName, bool Enhanced) { } else { // Package up features to be passed to target/subtarget std::string FeaturesStr; - if (MCPU.size()) { - SubtargetFeatures Features; - Features.setCPU(MCPU); - FeaturesStr = Features.getString(); - } // FIXME: We shouldn't need to do this (and link in codegen). // When we split this out, we should do it in a way that makes // it straightforward to switch subtargets on the fly (.e.g, // the .cpu and .code16 directives). OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, + MCPU, FeaturesStr)); if (!TM) { diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index c971e49d04..a125c91c35 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -201,7 +201,8 @@ static void DisassembleInput(const StringRef &Filename) { // it straightforward to switch subtargets on the fly (.e.g, // the .cpu and .code16 directives). std::string FeaturesStr; - OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, + std::string CPU; + OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, CPU, FeaturesStr)); if (!TM) { errs() << "error: could not create target for triple " << TripleName << "\n"; diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index f175255c51..630a995575 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -262,9 +262,9 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg) // construct LTModule, hand over ownership of module and target SubtargetFeatures Features; - Features.getDefaultSubtargetFeatures(_mCpu, llvm::Triple(Triple)); + Features.getDefaultSubtargetFeatures(llvm::Triple(Triple)); std::string FeatureStr = Features.getString(); - _target = march->createTargetMachine(Triple, FeatureStr); + _target = march->createTargetMachine(Triple, _mCpu, FeatureStr); } return false; } diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index 814d80bda0..f8b42f1393 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -157,9 +157,10 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer, // construct LTOModule, hand over ownership of module and target SubtargetFeatures Features; - Features.getDefaultSubtargetFeatures("" /* cpu */, llvm::Triple(Triple)); + Features.getDefaultSubtargetFeatures(llvm::Triple(Triple)); std::string FeatureStr = Features.getString(); - TargetMachine *target = march->createTargetMachine(Triple, FeatureStr); + std::string CPU; + TargetMachine *target = march->createTargetMachine(Triple, CPU, FeatureStr); LTOModule *Ret = new LTOModule(m.take(), target); bool Err = Ret->ParseSymbols(); if (Err) { |