diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-10-10 07:36:45 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-10-10 07:36:45 +0000 |
commit | bbcdf4e2a5d57fed745d4c2a549c57c25f1e3aec (patch) | |
tree | c31599313553762967e0365dde25e00fa2f1c7e6 /llvm/lib/Transforms/IPO/GlobalOpt.cpp | |
parent | 57086ce24895f9a53a3d0eafa32117a6edc4194e (diff) | |
download | bcm5719-llvm-bbcdf4e2a5d57fed745d4c2a549c57c25f1e3aec.tar.gz bcm5719-llvm-bbcdf4e2a5d57fed745d4c2a549c57c25f1e3aec.zip |
Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.
llvm-svn: 165610
Diffstat (limited to 'llvm/lib/Transforms/IPO/GlobalOpt.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index e8e54ec9aef..a1b976577a7 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -2062,12 +2062,15 @@ static void ChangeCalleesToFastCall(Function *F) { } static AttrListPtr StripNest(const AttrListPtr &Attrs) { + Attributes::Builder B; + B.addAttribute(Attributes::Nest); + for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) { if (!Attrs.getSlot(i).Attrs.hasAttribute(Attributes::Nest)) continue; // There can be only one. - return Attrs.removeAttr(Attrs.getSlot(i).Index, Attribute::Nest); + return Attrs.removeAttr(Attrs.getSlot(i).Index, Attributes::get(B)); } return Attrs; @@ -2108,7 +2111,7 @@ bool GlobalOpt::OptimizeFunctions(Module &M) { Changed = true; } - if (F->getAttributes().hasAttrSomewhere(Attribute::Nest) && + if (F->getAttributes().hasAttrSomewhere(Attributes::Nest) && !F->hasAddressTaken()) { // The function is not used by a trampoline intrinsic, so it is safe // to remove the 'nest' attribute. |