diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-02-21 19:46:51 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-02-21 19:46:51 +0000 |
commit | fece442c697eb29f14b4718bdafa3a97d545b476 (patch) | |
tree | 9b744c5cc648b20d137e09742cbf08ae54eed235 /lib | |
parent | 6585d3b64b04b788faad79ba6cf4e592ebf4658d (diff) |
Don't assert on empty attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IR/Function.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp index 15c05e71e2..5c444d238a 100644 --- a/lib/IR/Function.cpp +++ b/lib/IR/Function.cpp @@ -125,7 +125,7 @@ bool Argument::hasStructRetAttr() const { /// addAttr - Add attributes to an argument. void Argument::addAttr(AttributeSet AS) { - assert(AS.getNumSlots() == 1 && + assert(AS.getNumSlots() <= 1 && "Trying to add more than one attribute set to an argument!"); AttrBuilder B(AS, AS.getSlotIndex(0)); getParent()->addAttributes(getArgNo() + 1, @@ -135,7 +135,7 @@ void Argument::addAttr(AttributeSet AS) { /// removeAttr - Remove attributes from an argument. void Argument::removeAttr(AttributeSet AS) { - assert(AS.getNumSlots() == 1 && + assert(AS.getNumSlots() <= 1 && "Trying to remove more than one attribute set from an argument!"); AttrBuilder B(AS, AS.getSlotIndex(0)); getParent()->removeAttributes(getArgNo() + 1, |