зеркало из https://github.com/microsoft/clang-1.git
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
55ea75bf61
Коммит
4159f05999
|
@ -1027,63 +1027,27 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
|
|||
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");
|
||||
FuncAttrs.addAttribute("no-frame-pointer-elim", "true");
|
||||
FuncAttrs.addAttribute("no-frame-pointer-elim-non-leaf", "true");
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче