diff options
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 } //===----------------------------------------------------------------------===// |