Skip to content

Commit

Permalink
[GlobalOpt] Simplify attribute code stripping nest, NFC
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300787 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rnk committed Apr 19, 2017
1 parent e7cb393 commit 6a6847f
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/Transforms/IPO/GlobalOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1979,16 +1979,11 @@ static void ChangeCalleesToFastCall(Function *F) {
}
}

static AttributeList StripNest(LLVMContext &C, const AttributeList &Attrs) {
for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
unsigned Index = Attrs.getSlotIndex(i);
if (!Attrs.getSlotAttributes(i).hasAttribute(Index, Attribute::Nest))
continue;

// There can be only one.
return Attrs.removeAttribute(C, Index, Attribute::Nest);
}

static AttributeList StripNest(LLVMContext &C, AttributeList Attrs) {
// There can be at most one attribute set with a nest attribute.
unsigned NestIndex;
if (Attrs.hasAttrSomewhere(Attribute::Nest, &NestIndex))
return Attrs.removeAttribute(C, NestIndex, Attribute::Nest);
return Attrs;
}

Expand Down

0 comments on commit 6a6847f

Please sign in to comment.