Merge pull request #509 from klickverbot/fix-disable-fp-elim

Bring back -disable-fp-elim.
This commit is contained in:
David Nadlinger
2013-10-13 12:17:19 -07:00
6 changed files with 10 additions and 5 deletions

View File

@@ -325,6 +325,10 @@ cl::opt<FloatABI::Type> mFloatABI("float-abi",
clEnumValN(FloatABI::Hard, "hard", "Hardware floating-point ABI and instructions"),
clEnumValEnd));
cl::opt<bool> disableFpElim("disable-fp-elim",
cl::desc("Disable frame pointer elimination optimization"),
cl::init(false));
static cl::opt<bool, true, FlagParser> asserts("asserts",
cl::desc("(*) Enable assertions"),
cl::value_desc("bool"),

View File

@@ -61,6 +61,7 @@ namespace opts {
extern cl::opt<std::string> mTargetTriple;
extern cl::opt<llvm::Reloc::Model> mRelocModel;
extern cl::opt<llvm::CodeModel::Model> mCodeModel;
extern cl::opt<bool> disableFpElim;
extern cl::opt<FloatABI::Type> mFloatABI;
extern cl::opt<bool, true> singleObj;
extern cl::opt<bool> linkonceTemplates;

View File

@@ -634,7 +634,7 @@ int main(int argc, char **argv)
gTargetMachine = createTargetMachine(mTargetTriple, mArch, mCPU, mAttrs,
bitness, mFloatABI, mRelocModel, mCodeModel, codeGenOptLevel(),
global.params.symdebug);
global.params.symdebug || disableFpElim);
{
llvm::Triple triple = llvm::Triple(gTargetMachine->getTargetTriple());

View File

@@ -262,7 +262,7 @@ llvm::TargetMachine* createTargetMachine(
llvm::Reloc::Model relocModel,
llvm::CodeModel::Model codeModel,
llvm::CodeGenOpt::Level codeGenOptLevel,
bool genDebugInfo)
bool noFramePointerElim)
{
// Determine target triple. If the user didn't explicitly specify one, use
// the one set at LLVM configure time.
@@ -362,7 +362,7 @@ llvm::TargetMachine* createTargetMachine(
}
llvm::TargetOptions targetOptions;
targetOptions.NoFramePointerElim = genDebugInfo;
targetOptions.NoFramePointerElim = noFramePointerElim;
switch (floatABI)
{

View File

@@ -54,6 +54,6 @@ llvm::TargetMachine* createTargetMachine(
llvm::Reloc::Model relocModel,
llvm::CodeModel::Model codeModel,
llvm::CodeGenOpt::Level codeGenOptLevel,
bool genDebugInfo);
bool noFramePointerElim);
#endif // LDC_DRIVER_TARGET_H