r176985 - Have these attriubtes set to 'true' or 'false'.
Bill Wendling
isanbard at gmail.com
Wed Mar 13 15:24:33 PDT 2013
Author: void
Date: Wed Mar 13 17:24:33 2013
New Revision: 176985
URL: http://llvm.org/viewvc/llvm-project?rev=176985&view=rev
Log:
Have these attriubtes set to 'true' or 'false'.
The back-end cannot differentiate between functions that are from a .ll file and
those generated from the front-end. We cannot then take the non-precense of
these attributes as a "false" value. Have the front-end explicitly set the value
to 'true' or 'false' depending upon what is actually set.
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=176985&r1=176984&r2=176985&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Wed Mar 13 17:24:33 2013
@@ -1027,63 +1027,27 @@ void CodeGenModule::ConstructAttributeLi
FuncAttrs.addAttribute(llvm::Attribute::NoBuiltin);
} else {
// Attributes that should go on the function, but not the call site.
- if (!CodeGenOpts.CodeModel.empty())
- FuncAttrs.addAttribute("code-model", CodeGenOpts.CodeModel);
- if (!CodeGenOpts.RelocationModel.empty())
- FuncAttrs.addAttribute("relocation-model", CodeGenOpts.RelocationModel);
-
- if (CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp")
- FuncAttrs.addAttribute("float-abi", "soft");
- else if (CodeGenOpts.FloatABI == "hard")
- FuncAttrs.addAttribute("float-abi", "hard");
-
if (!CodeGenOpts.DisableFPElim) {
- /* ignore */ ;
+ FuncAttrs.addAttribute("no-frame-pointer-elim", "false");
+ FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf", "false");
} else if (CodeGenOpts.OmitLeafFramePointer) {
- FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf");
+ FuncAttrs.addAttribute("no-frame-pointer-elim", "false");
+ FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf", "true");
} else {
- FuncAttrs.addAttribute("no-frame-pointer-elim");
- FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf");
- }
-
- switch (CodeGenOpts.getFPContractMode()) {
- case CodeGenOptions::FPC_Off:
- FuncAttrs.addAttribute("fp-contract-model", "strict");
- break;
- case CodeGenOptions::FPC_On:
- FuncAttrs.addAttribute("fp-contract-model", "standard");
- break;
- case CodeGenOptions::FPC_Fast:
- FuncAttrs.addAttribute("fp-contract-model", "fast");
- break;
+ FuncAttrs.addAttribute("no-frame-pointer-elim", "true");
+ FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf", "true");
}
- if (CodeGenOpts.LessPreciseFPMAD)
- FuncAttrs.addAttribute("less-precise-fpmad");
- if (CodeGenOpts.NoInfsFPMath)
- FuncAttrs.addAttribute("no-infs-fp-math");
- if (CodeGenOpts.NoNaNsFPMath)
- FuncAttrs.addAttribute("no-nans-fp-math");
- if (CodeGenOpts.NoZeroInitializedInBSS)
- FuncAttrs.addAttribute("no-zero-init-in-bss");
- if (CodeGenOpts.UnsafeFPMath)
- FuncAttrs.addAttribute("unsafe-fp-math");
- if (CodeGenOpts.SoftFloat)
- FuncAttrs.addAttribute("use-soft-float");
- if (CodeGenOpts.StackAlignment)
- FuncAttrs.addAttribute("stack-align-override",
- llvm::utostr(CodeGenOpts.StackAlignment));
- if (CodeGenOpts.StackRealignment)
- FuncAttrs.addAttribute("realign-stack");
- if (CodeGenOpts.DisableTailCalls)
- FuncAttrs.addAttribute("disable-tail-calls");
- if (!CodeGenOpts.TrapFuncName.empty())
- FuncAttrs.addAttribute("trap-func-name", CodeGenOpts.TrapFuncName);
- if (LangOpts.PIELevel != 0)
- FuncAttrs.addAttribute("pie");
- if (CodeGenOpts.SSPBufferSize)
- FuncAttrs.addAttribute("ssp-buffers-size",
- llvm::utostr(CodeGenOpts.SSPBufferSize));
+ FuncAttrs.addAttribute("less-precise-fpmad",
+ CodeGenOpts.LessPreciseFPMAD ? "true" : "false");
+ FuncAttrs.addAttribute("no-infs-fp-math",
+ CodeGenOpts.NoInfsFPMath ? "true" : "false");
+ FuncAttrs.addAttribute("no-nans-fp-math",
+ CodeGenOpts.NoNaNsFPMath ? "true" : "false");
+ FuncAttrs.addAttribute("unsafe-fp-math",
+ CodeGenOpts.UnsafeFPMath ? "true" : "false");
+ FuncAttrs.addAttribute("use-soft-float",
+ CodeGenOpts.SoftFloat ? "true" : "false");
}
QualType RetTy = FI.getReturnType();
More information about the cfe-commits
mailing list