[MCJIT] Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"

This commit is contained in:
Fangrui Song 2019-12-24 17:10:32 -08:00
parent 1ac7c50ded
commit 583ef13f0b
1 changed files with 3 additions and 3 deletions

View File

@ -183,13 +183,13 @@ LLVMBool LLVMCreateMCJITCompilerForModule(
std::unique_ptr<Module> Mod(unwrap(M)); std::unique_ptr<Module> Mod(unwrap(M));
if (Mod) if (Mod)
// Set function attribute "no-frame-pointer-elim" based on // Set function attribute "frame-pointer" based on
// NoFramePointerElim. // NoFramePointerElim.
for (auto &F : *Mod) { for (auto &F : *Mod) {
auto Attrs = F.getAttributes(); auto Attrs = F.getAttributes();
StringRef Value(options.NoFramePointerElim ? "true" : "false"); StringRef Value = options.NoFramePointerElim ? "all" : "none";
Attrs = Attrs.addAttribute(F.getContext(), AttributeList::FunctionIndex, Attrs = Attrs.addAttribute(F.getContext(), AttributeList::FunctionIndex,
"no-frame-pointer-elim", Value); "frame-pointer", Value);
F.setAttributes(Attrs); F.setAttributes(Attrs);
} }