mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 20:06:03 +03:00
Restore -disable-fp-elim option for LLVM 8+
This commit is contained in:
parent
306bda36fd
commit
6015278dfa
2 changed files with 13 additions and 7 deletions
|
@ -23,6 +23,12 @@ static cl::opt<bool>
|
||||||
DisableRedZone("disable-red-zone", cl::ZeroOrMore,
|
DisableRedZone("disable-red-zone", cl::ZeroOrMore,
|
||||||
cl::desc("Do not emit code that uses the red zone."));
|
cl::desc("Do not emit code that uses the red zone."));
|
||||||
|
|
||||||
|
#if LDC_LLVM_VER >= 800
|
||||||
|
static cl::opt<bool>
|
||||||
|
disableFPElim("disable-fp-elim", cl::ZeroOrMore,
|
||||||
|
cl::desc("Disable frame pointer elimination optimization"));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Now expose the helper functions (with static linkage) via external wrappers
|
// Now expose the helper functions (with static linkage) via external wrappers
|
||||||
// in the opts namespace, including some additional helper functions.
|
// in the opts namespace, including some additional helper functions.
|
||||||
namespace opts {
|
namespace opts {
|
||||||
|
@ -39,10 +45,11 @@ CodeModel::Model getCodeModel() { return ::CMModel; }
|
||||||
|
|
||||||
#if LDC_LLVM_VER >= 800
|
#if LDC_LLVM_VER >= 800
|
||||||
llvm::Optional<llvm::FramePointer::FP> framePointerUsage() {
|
llvm::Optional<llvm::FramePointer::FP> framePointerUsage() {
|
||||||
if (::FramePointerUsage.getNumOccurrences() == 0)
|
if (::FramePointerUsage.getNumOccurrences() > 0)
|
||||||
return llvm::None;
|
|
||||||
else
|
|
||||||
return ::FramePointerUsage.getValue();
|
return ::FramePointerUsage.getValue();
|
||||||
|
if (disableFPElim.getNumOccurrences() > 0)
|
||||||
|
return disableFPElim ? llvm::FramePointer::All : llvm::FramePointer::None;
|
||||||
|
return llvm::None;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
cl::boolOrDefault disableFPElim() {
|
cl::boolOrDefault disableFPElim() {
|
||||||
|
|
|
@ -128,11 +128,10 @@ bool willCrossModuleInline() {
|
||||||
|
|
||||||
#if LDC_LLVM_VER >= 800
|
#if LDC_LLVM_VER >= 800
|
||||||
llvm::FramePointer::FP whichFramePointersToEmit() {
|
llvm::FramePointer::FP whichFramePointersToEmit() {
|
||||||
auto option = opts::framePointerUsage();
|
if (auto option = opts::framePointerUsage())
|
||||||
if (option)
|
|
||||||
return *option;
|
return *option;
|
||||||
else
|
return isOptimizationEnabled() ? llvm::FramePointer::None
|
||||||
return isOptimizationEnabled() ? llvm::FramePointer::None : llvm::FramePointer::All;
|
: llvm::FramePointer::All;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
bool willEliminateFramePointer() {
|
bool willEliminateFramePointer() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue