Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.

llvm-svn: 187092
This commit is contained in:
Bill Wendling 2013-07-25 00:32:41 +00:00
parent 869950e9e0
commit a9cc8c0385
2 changed files with 12 additions and 3 deletions

View File

@ -412,13 +412,10 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
// Set frame pointer elimination mode.
if (!CodeGenOpts.DisableFPElim) {
Options.NoFramePointerElim = false;
Options.NoFramePointerElimNonLeaf = false;
} else if (CodeGenOpts.OmitLeafFramePointer) {
Options.NoFramePointerElim = false;
Options.NoFramePointerElimNonLeaf = true;
} else {
Options.NoFramePointerElim = true;
Options.NoFramePointerElimNonLeaf = true;
}
if (CodeGenOpts.UseInitArray)

View File

@ -1072,6 +1072,18 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
CodeGenOpts.SoftFloat ? "true" : "false");
FuncAttrs.addAttribute("stack-protector-buffer-size",
llvm::utostr(CodeGenOpts.SSPBufferSize));
bool NoFramePointerElimNonLeaf;
if (!CodeGenOpts.DisableFPElim) {
NoFramePointerElimNonLeaf = false;
} else if (CodeGenOpts.OmitLeafFramePointer) {
NoFramePointerElimNonLeaf = true;
} else {
NoFramePointerElimNonLeaf = true;
}
FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf",
NoFramePointerElimNonLeaf ? "true" : "false");
}
QualType RetTy = FI.getReturnType();