summaryrefslogtreecommitdiff
path: root/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-27 21:20:06 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-27 21:20:06 +0000
commita5372d270864316fb0752dd366f03fc1b45c6143 (patch)
treee086b99fbff9086600fe07e9578532b14c4457f1 /lib/IR/Attributes.cpp
parent0fef46f50e116e9aa0811ba8eb605d82ab64faed (diff)
downloadllvm-a5372d270864316fb0752dd366f03fc1b45c6143.tar.gz
llvm-a5372d270864316fb0752dd366f03fc1b45c6143.tar.bz2
llvm-a5372d270864316fb0752dd366f03fc1b45c6143.tar.xz
Start using more of the AttrNode in the AttributeSetImpl class.
Also add some asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Attributes.cpp')
-rw-r--r--lib/IR/Attributes.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 780da00ac0..00b542dbc1 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -553,12 +553,14 @@ AttributeSetImpl(LLVMContext &C,
AttrNodes.push_back(std::make_pair(AWI.Index,
AttributeSetNode::get(C, Attrs)));
}
-}
-AttributeSetImpl::
-AttributeSetImpl(LLVMContext &C,
- ArrayRef<std::pair<uint64_t, AttributeSetNode*> > attrs)
- : Context(C), AttrNodes(attrs.begin(), attrs.end()) {
+ assert(AttrNodes.size() == AttrList.size() &&
+ "Number of attributes is different between lists!");
+#ifndef NDEBUG
+ for (unsigned I = 0, E = AttrNodes.size(); I != E; ++I)
+ assert((I == 0 || AttrNodes[I - 1].first < AttrNodes[I].first) &&
+ "Attributes not in ascending order!");
+#endif
}
//===----------------------------------------------------------------------===//