Skip to content

Commit 40cb10e

Browse files
committed
Merge pull request #509 from klickverbot/fix-disable-fp-elim
Bring back -disable-fp-elim.
2 parents be497c7 + 257da5a commit 40cb10e

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

driver/cl_options.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ cl::opt<FloatABI::Type> mFloatABI("float-abi",
325325
clEnumValN(FloatABI::Hard, "hard", "Hardware floating-point ABI and instructions"),
326326
clEnumValEnd));
327327

328+
cl::opt<bool> disableFpElim("disable-fp-elim",
329+
cl::desc("Disable frame pointer elimination optimization"),
330+
cl::init(false));
331+
328332
static cl::opt<bool, true, FlagParser> asserts("asserts",
329333
cl::desc("(*) Enable assertions"),
330334
cl::value_desc("bool"),

driver/cl_options.h

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ namespace opts {
6161
extern cl::opt<std::string> mTargetTriple;
6262
extern cl::opt<llvm::Reloc::Model> mRelocModel;
6363
extern cl::opt<llvm::CodeModel::Model> mCodeModel;
64+
extern cl::opt<bool> disableFpElim;
6465
extern cl::opt<FloatABI::Type> mFloatABI;
6566
extern cl::opt<bool, true> singleObj;
6667
extern cl::opt<bool> linkonceTemplates;

driver/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ int main(int argc, char **argv)
634634

635635
gTargetMachine = createTargetMachine(mTargetTriple, mArch, mCPU, mAttrs,
636636
bitness, mFloatABI, mRelocModel, mCodeModel, codeGenOptLevel(),
637-
global.params.symdebug);
637+
global.params.symdebug || disableFpElim);
638638

639639
{
640640
llvm::Triple triple = llvm::Triple(gTargetMachine->getTargetTriple());

driver/targetmachine.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ llvm::TargetMachine* createTargetMachine(
262262
llvm::Reloc::Model relocModel,
263263
llvm::CodeModel::Model codeModel,
264264
llvm::CodeGenOpt::Level codeGenOptLevel,
265-
bool genDebugInfo)
265+
bool noFramePointerElim)
266266
{
267267
// Determine target triple. If the user didn't explicitly specify one, use
268268
// the one set at LLVM configure time.
@@ -362,7 +362,7 @@ llvm::TargetMachine* createTargetMachine(
362362
}
363363

364364
llvm::TargetOptions targetOptions;
365-
targetOptions.NoFramePointerElim = genDebugInfo;
365+
targetOptions.NoFramePointerElim = noFramePointerElim;
366366

367367
switch (floatABI)
368368
{

driver/targetmachine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ llvm::TargetMachine* createTargetMachine(
5454
llvm::Reloc::Model relocModel,
5555
llvm::CodeModel::Model codeModel,
5656
llvm::CodeGenOpt::Level codeGenOptLevel,
57-
bool genDebugInfo);
57+
bool noFramePointerElim);
5858

5959
#endif // LDC_DRIVER_TARGET_H

tests/d2/dmd-testsuite

Submodule dmd-testsuite updated 1 file

0 commit comments

Comments
 (0)