aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-06-30 02:06:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-06-30 02:06:32 +0000
commit368691e5ac9805bd1528dace0f5575a2531db0d3 (patch)
tree22c9c884989151443f00546adb17bd03bd08f470
parent1901dce8b1e78d0bf7072cccab695bd58c7eec21 (diff)
createTargetMachine now takes a CPU string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134128 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/BackendUtil.cpp6
-rw-r--r--tools/driver/cc1as_main.cpp3
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 66092f0d98..f997721639 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -258,16 +258,16 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
const_cast<char **>(&BackendArgs[0]));
std::string FeaturesStr;
- if (TargetOpts.CPU.size() || TargetOpts.Features.size()) {
+ if (TargetOpts.Features.size()) {
SubtargetFeatures Features;
- Features.setCPU(TargetOpts.CPU);
for (std::vector<std::string>::const_iterator
it = TargetOpts.Features.begin(),
ie = TargetOpts.Features.end(); it != ie; ++it)
Features.AddFeature(*it);
FeaturesStr = Features.getString();
}
- TargetMachine *TM = TheTarget->createTargetMachine(Triple, FeaturesStr);
+ TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU,
+ FeaturesStr);
if (CodeGenOpts.RelaxAll)
TM->setMCRelaxAll(true);
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp
index f449235db4..c821185832 100644
--- a/tools/driver/cc1as_main.cpp
+++ b/tools/driver/cc1as_main.cpp
@@ -261,7 +261,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, Diagnostic &Diags) {
return false;
// FIXME: We shouldn't need to do this (and link in codegen).
- OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(Opts.Triple, ""));
+ OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(Opts.Triple,
+ "", ""));
if (!TM) {
Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;
return false;