X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMetadata.h;h=a6c3f039a11ec41802f5da0590c0421692b06571;hb=9a376a8003c486054ea4d7c2465cb90b501c9893;hp=ef9646e9774aef0dff8cfeb081c9ffdc6fe81105;hpb=c85829617bae7f0520c92c5819a5ca8ad520b4f1;p=oota-llvm.git diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index ef9646e9774..a6c3f039a11 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -38,7 +38,6 @@ class MDString : public Value { MDString(const MDString &); // DO NOT IMPLEMENT StringRef Str; -protected: explicit MDString(LLVMContext &C, StringRef S); public: @@ -111,9 +110,8 @@ class MDNode : public Value, public FoldingSetNode { void replaceOperand(MDNodeOperand *Op, Value *NewVal); ~MDNode(); -protected: - explicit MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, - bool isFunctionLocal); + MDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, + bool isFunctionLocal); static MDNode *getMDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, FunctionLocalness FL, bool Insert = true); @@ -128,6 +126,16 @@ public: static MDNode *getIfExists(LLVMContext &Context, Value *const *Vals, unsigned NumVals); + + /// getTemporary - Return a temporary MDNode, for use in constructing + /// cyclic MDNode structures. A temporary MDNode is not uniqued, + /// may be RAUW'd, and must be manually deleted with deleteTemporary. + static MDNode *getTemporary(LLVMContext &Context, Value *const *Vals, + unsigned NumVals); + + /// deleteTemporary - Deallocate a node created by getTemporary. The + /// node must not have any users. + static void deleteTemporary(MDNode *N); /// getOperand - Return specified operand. Value *getOperand(unsigned i) const; @@ -136,9 +144,6 @@ public: unsigned getNumOperands() const { return NumOperands; } /// isFunctionLocal - Return whether MDNode is local to a function. - /// Note: MDNodes are designated as function-local when created, and keep - /// that designation even if their operands are modified to no longer - /// refer to function-local IR. bool isFunctionLocal() const { return (getSubclassDataFromValue() & FunctionLocalBit) != 0; } @@ -191,7 +196,6 @@ class NamedMDNode : public ilist_node { void setParent(Module *M) { Parent = M; } -protected: explicit NamedMDNode(const Twine &N); public: