X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FAttributeImpl.h;h=9f3fd3e606d387562f1047dabbc11f5e69f17507;hb=f822dab3dd51c97bbc2acc7789c298947d142685;hp=5a72c37505e1769e25ad4cbc91f579b385007430;hpb=e22cde01a63c907cb23f425ba4f4f16ede754dbe;p=oota-llvm.git diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h index 5a72c37505e..9f3fd3e606d 100644 --- a/lib/IR/AttributeImpl.h +++ b/lib/IR/AttributeImpl.h @@ -94,6 +94,7 @@ public: /// attribute enties, which are for target-dependent attributes. class EnumAttributeImpl : public AttributeImpl { + virtual void anchor(); Attribute::AttrKind Kind; protected: @@ -108,6 +109,7 @@ public: }; class AlignAttributeImpl : public EnumAttributeImpl { + void anchor() override; unsigned Align; public: @@ -122,6 +124,7 @@ public: }; class StringAttributeImpl : public AttributeImpl { + virtual void anchor(); std::string Kind; std::string Val; @@ -200,6 +203,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)); @@ -249,6 +261,8 @@ public: // FIXME: This atrocity is temporary. uint64_t Raw(unsigned Index) const; + + void dump() const; }; } // end llvm namespace