diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-27 21:20:06 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-27 21:20:06 +0000 |
commit | a5372d270864316fb0752dd366f03fc1b45c6143 (patch) | |
tree | e086b99fbff9086600fe07e9578532b14c4457f1 /lib/IR/Attributes.cpp | |
parent | 0fef46f50e116e9aa0811ba8eb605d82ab64faed (diff) | |
download | llvm-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.cpp | 12 |
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 } //===----------------------------------------------------------------------===// |