projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6ca703
)
Don't add an attribute that already exists and don't remove an attribute that doesn...
author
Bill Wendling
<isanbard@gmail.com>
Thu, 28 Feb 2013 19:17:40 +0000
(19:17 +0000)
committer
Bill Wendling
<isanbard@gmail.com>
Thu, 28 Feb 2013 19:17:40 +0000
(19:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176289
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/IR/Attributes.cpp
patch
|
blob
|
history
diff --git
a/lib/IR/Attributes.cpp
b/lib/IR/Attributes.cpp
index 6eb51f0edcb078506d0918f4cd53faea743b3aa2..ed2bf05e90639f44b963789ab32c19d8794f6b91 100644
(file)
--- a/
lib/IR/Attributes.cpp
+++ b/
lib/IR/Attributes.cpp
@@
-645,6
+645,7
@@
AttributeSet AttributeSet::get(LLVMContext &C, ArrayRef<AttributeSet> Attrs) {
AttributeSet AttributeSet::addAttribute(LLVMContext &C, unsigned Idx,
Attribute::AttrKind Attr) const {
+ if (hasAttribute(Idx, Attr)) return *this;
return addAttributes(C, Idx, AttributeSet::get(C, Idx, Attr));
}
@@
-699,6
+700,7
@@
AttributeSet AttributeSet::addAttributes(LLVMContext &C, unsigned Idx,
AttributeSet AttributeSet::removeAttribute(LLVMContext &C, unsigned Idx,
Attribute::AttrKind Attr) const {
+ if (!hasAttribute(Idx, Attr)) return *this;
return removeAttributes(C, Idx, AttributeSet::get(C, Idx, Attr));
}