X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FIR%2FAttributeImpl.h;h=7bf9e8ab6baecf3138e2d66b045617a8c6a0a6a5;hp=5a72c37505e1769e25ad4cbc91f579b385007430;hb=7bba9c5c0a5235f585ee4bd3efec29e0982de3f8;hpb=6bf104b165cec9c14dacf10bf3380eeb32c278d7 diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h index 5a72c37505e..7bf9e8ab6ba 100644 --- a/lib/IR/AttributeImpl.h +++ b/lib/IR/AttributeImpl.h @@ -200,6 +200,15 @@ public: AttributeSetImpl(LLVMContext &C, ArrayRef > Attrs) : Context(C), NumAttrs(Attrs.size()) { +#ifndef NDEBUG + if (Attrs.size() >= 2) { + for (const std::pair *i = Attrs.begin() + 1, + *e = Attrs.end(); + i != e; ++i) { + assert((i-1)->first <= i->first && "Attribute set not ordered!"); + } + } +#endif // There's memory after the node where we can store the entries in. std::copy(Attrs.begin(), Attrs.end(), reinterpret_cast(this + 1));