X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMDNode.h;h=e3944365ee465e8e568c756d120f4042c808a72c;hb=617dd7baa6dfd3a7b5ee72ace37f6b6aeaa6006b;hp=d632e4ea4a6fb9037418c9961879e1dfcba7d64d;hpb=04fb7c36a9977127f32558dc01c39a9c2388bc39;p=oota-llvm.git diff --git a/include/llvm/MDNode.h b/include/llvm/MDNode.h index d632e4ea4a6..e3944365ee4 100644 --- a/include/llvm/MDNode.h +++ b/include/llvm/MDNode.h @@ -25,6 +25,7 @@ #include "llvm/Type.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ValueHandle.h" namespace llvm { @@ -45,6 +46,8 @@ namespace llvm { class MDNode : public Constant, public FoldingSetNode { MDNode(const MDNode &); // DO NOT IMPLEMENT + friend class LLVMContextImpl; + friend class ElementVH; struct ElementVH : public CallbackVH { MDNode *OwningNode; @@ -71,15 +74,12 @@ class MDNode : public Constant, public FoldingSetNode { SmallVector Node; typedef SmallVectorImpl::iterator elem_iterator; + protected: explicit MDNode(Value*const* Vals, unsigned NumVals); public: typedef SmallVectorImpl::const_iterator const_elem_iterator; - /// get() - Static factory methods - Return objects of the specified value. - /// - static MDNode *get(Value*const* Vals, unsigned NumVals); - Value *getElement(unsigned i) const { return Node[i]; } @@ -119,8 +119,7 @@ public: virtual void destroyConstant(); virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) { - assert(0 && "This should never be called because MDNodes have no ops"); - abort(); + llvm_unreachable("This should never be called because MDNodes have no ops"); } /// Methods for support type inquiry through isa, cast, and dyn_cast: