diff options
| author | Akira Hatanaka <ahatanaka@apple.com> | 2015-05-23 01:14:08 +0000 |
|---|---|---|
| committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-05-23 01:14:08 +0000 |
| commit | ddf76aa36fdd48e4c8bad9cb069cc5588e0ed149 (patch) | |
| tree | d9a432cf75b8f65bc27c3c6b8d3f11330a6a2f47 /llvm/tools/llc/llc.cpp | |
| parent | bd881834c5eeb75f1e5cd8a0d56c25dfe122daa5 (diff) | |
| download | bcm5719-llvm-ddf76aa36fdd48e4c8bad9cb069cc5588e0ed149.tar.gz bcm5719-llvm-ddf76aa36fdd48e4c8bad9cb069cc5588e0ed149.zip | |
Stop resetting NoFramePointerElim in TargetMachine::resetTargetOptions.
This is part of the work to remove TargetMachine::resetTargetOptions.
In this patch, instead of updating global variable NoFramePointerElim in
resetTargetOptions, its use in DisableFramePointerElim is replaced with a call
to TargetFrameLowering::noFramePointerElim. This function determines on a
per-function basis if frame pointer elimination should be disabled.
There is no change in functionality except that cl:opt option "disable-fp-elim"
can now override function attribute "no-frame-pointer-elim".
llvm-svn: 238080
Diffstat (limited to 'llvm/tools/llc/llc.cpp')
| -rw-r--r-- | llvm/tools/llc/llc.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp index 145d957890c..b7756129155 100644 --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -304,8 +304,11 @@ static int compileModule(char **argv, LLVMContext &Context) { if (const DataLayout *DL = Target->getDataLayout()) M->setDataLayout(*DL); - // Override function attributes based on CPUStr and FeaturesStr. - setFunctionAttributes(CPUStr, FeaturesStr, *M); + // Override function attributes based on CPUStr, FeaturesStr, and Options. + // Pass AlwaysRecordAttrs=false as we want to override an attribute only when + // the corresponding cl::opt has been provided on llc's command line. + setFunctionAttributes(CPUStr, FeaturesStr, Options, *M, + /* AlwaysRecordAttrs */ false); if (RelaxAll.getNumOccurrences() > 0 && FileType != TargetMachine::CGFT_ObjectFile) |

