summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit72223f295923eafe73e25b5f71cb5470a4161c24 (patch)
tree5e44b77dba14060843651ac15cae60747f721f75 /llvm/lib/IR/Attributes.cpp
parent01b065117bb9335365bc0eb6e22848daf3e26cb4 (diff)
downloadbcm5719-llvm-72223f295923eafe73e25b5f71cb5470a4161c24.tar.gz
bcm5719-llvm-72223f295923eafe73e25b5f71cb5470a4161c24.zip
Start using more of the AttrNode in the AttributeSetImpl class.
Also add some asserts. llvm-svn: 173627
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 780da00ac01..00b542dbc1d 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/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
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud