X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMetadata.h;h=887e33c7a18180cd6f456509ea02e170f326cf7d;hb=7016cf66ee21ddf3f7823d4e332b2cb84953bebd;hp=f773817e829f87d2e8ef4bbd775702543c4556a5;hpb=489b29b0a4ee4526e3d50ad88d3d48745baf5042;p=oota-llvm.git diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index f773817e829..887e33c7a18 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -17,6 +17,7 @@ #define LLVM_METADATA_H #include "llvm/Value.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/ilist_node.h" @@ -33,12 +34,11 @@ template //===----------------------------------------------------------------------===// /// MDString - a single uniqued string. /// These are used to efficiently contain a byte sequence for metadata. -/// MDString is always unnamd. +/// MDString is always unnamed. class MDString : public Value { MDString(const MDString &); // DO NOT IMPLEMENT StringRef Str; -protected: explicit MDString(LLVMContext &C, StringRef S); public: @@ -111,29 +111,25 @@ 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, ArrayRef Vals, bool isFunctionLocal); - static MDNode *getMDNode(LLVMContext &C, Value *const *Vals, unsigned NumVals, + static MDNode *getMDNode(LLVMContext &C, ArrayRef Vals, FunctionLocalness FL, bool Insert = true); public: // Constructors and destructors. - static MDNode *get(LLVMContext &Context, Value *const *Vals, - unsigned NumVals); + static MDNode *get(LLVMContext &Context, ArrayRef Vals); // getWhenValsUnresolved - Construct MDNode determining function-localness // from isFunctionLocal argument, not by analyzing Vals. - static MDNode *getWhenValsUnresolved(LLVMContext &Context, Value *const *Vals, - unsigned NumVals, bool isFunctionLocal); + static MDNode *getWhenValsUnresolved(LLVMContext &Context, + ArrayRef Vals, + bool isFunctionLocal); - static MDNode *getIfExists(LLVMContext &Context, Value *const *Vals, - unsigned NumVals); + static MDNode *getIfExists(LLVMContext &Context, ArrayRef Vals); /// 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); + static MDNode *getTemporary(LLVMContext &Context, ArrayRef Vals); /// deleteTemporary - Deallocate a node created by getTemporary. The /// node must not have any users. @@ -146,9 +142,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; } @@ -201,7 +194,6 @@ class NamedMDNode : public ilist_node { void setParent(Module *M) { Parent = M; } -protected: explicit NamedMDNode(const Twine &N); public: