forked from OSchip/llvm-project
createTargetMachine now takes a CPU string.
llvm-svn: 134128
This commit is contained in:
parent
fe6e405e8c
commit
adc7959851
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue