diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 13:59:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 13:59:01 +0000 |
commit | 3a0822f094b578157263e04114075ad7df81db41 (patch) | |
tree | bc48361fe2cd1ca5f93ac01b38b183774468fc79 /lib/IR/AttributeImpl.h | |
parent | 85d8b2bbe386bcfe669575d05b61482d7be07e5d (diff) |
Diffstat (limited to 'lib/IR/AttributeImpl.h')
-rw-r--r-- | lib/IR/AttributeImpl.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h index dbd7d63a892b..8159dcefb5c3 100644 --- a/lib/IR/AttributeImpl.h +++ b/lib/IR/AttributeImpl.h @@ -181,6 +181,9 @@ public: AttrList[I].Profile(ID); } }; +static_assert( + AlignOf<AttributeSetNode>::Alignment >= AlignOf<Attribute>::Alignment, + "Alignment is insufficient for objects appended to AttributeSetNode"); //===----------------------------------------------------------------------===// /// \class @@ -189,9 +192,11 @@ public: class AttributeSetImpl : public FoldingSetNode { friend class AttributeSet; - LLVMContext &Context; - +public: typedef std::pair<unsigned, AttributeSetNode*> IndexAttrPair; + +private: + LLVMContext &Context; unsigned NumAttrs; ///< Number of entries in this set. /// \brief Return a pointer to the IndexAttrPair for the specified slot. @@ -206,6 +211,7 @@ public: AttributeSetImpl(LLVMContext &C, ArrayRef<std::pair<unsigned, AttributeSetNode *> > Attrs) : Context(C), NumAttrs(Attrs.size()) { + #ifndef NDEBUG if (Attrs.size() >= 2) { for (const std::pair<unsigned, AttributeSetNode *> *i = Attrs.begin() + 1, @@ -267,7 +273,11 @@ public: void dump() const; }; +static_assert( + AlignOf<AttributeSetImpl>::Alignment >= + AlignOf<AttributeSetImpl::IndexAttrPair>::Alignment, + "Alignment is insufficient for objects appended to AttributeSetImpl"); -} // end llvm namespace +} // namespace llvm #endif |