Skip to content

Commit

Permalink
set TargetOptions before passing to createTargetMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
crabtw committed Jan 22, 2013
1 parent 3a00637 commit a81b153
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions compiler/codegen.cpp
Expand Up @@ -7248,18 +7248,18 @@ llvm::TargetMachine *initLLVM(llvm::StringRef targetTriple,
default : level = llvm::CodeGenOpt::Aggressive; break;
}

llvm::TargetMachine *targetMachine = target->createTargetMachine(
targetTriple, targetCPU, targetFeatures,
llvm::TargetOptions(), reloc, codeModel, level);

llvm::TargetOptions opts;
if (optLevel < 2 || debug)
targetMachine->Options.NoFramePointerElim = 1;

opts.NoFramePointerElim = 1;
if (softFloat) {
targetMachine->Options.UseSoftFloat = 1;
targetMachine->Options.FloatABIType = llvm::FloatABI::Soft;
opts.UseSoftFloat = 1;
opts.FloatABIType = llvm::FloatABI::Soft;
}

llvm::TargetMachine *targetMachine = target->createTargetMachine(
targetTriple, targetCPU, targetFeatures,
opts, reloc, codeModel, level);

if (targetMachine != NULL) {
llvmDataLayout = targetMachine->getDataLayout();
if (llvmDataLayout == NULL) {
Expand Down

0 comments on commit a81b153

Please sign in to comment.