diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:09:33 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-01-23 11:09:33 +0000 |
commit | 3fd58f91dd318518f7daa4ba64c0aaf31799d89b (patch) | |
tree | 74eecbae571601ec6a626a53374b1eddc7b164a5 /include/llvm/Metadata.h | |
parent | 3fba7d16b41dfbefe3b1be6bc0ab94c017728f79 (diff) | |
download | FreeBSD-src-3fd58f91dd318518f7daa4ba64c0aaf31799d89b.zip FreeBSD-src-3fd58f91dd318518f7daa4ba64c0aaf31799d89b.tar.gz |
Update LLVM to r94309.
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r-- | include/llvm/Metadata.h | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index 179010b..f1e7a22 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -31,26 +31,10 @@ template<typename ValueSubClass, typename ItemParentClass> //===----------------------------------------------------------------------===// -// MetadataBase - A base class for MDNode and MDString. -class MetadataBase : public Value { -protected: - MetadataBase(const Type *Ty, unsigned scid) - : Value(Ty, scid) {} - -public: - - /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const MetadataBase *) { return true; } - static bool classof(const Value *V) { - return V->getValueID() == MDStringVal || V->getValueID() == MDNodeVal; - } -}; - -//===----------------------------------------------------------------------===// /// MDString - a single uniqued string. /// These are used to efficiently contain a byte sequence for metadata. /// MDString is always unnamd. -class MDString : public MetadataBase { +class MDString : public Value { MDString(const MDString &); // DO NOT IMPLEMENT StringRef Str; @@ -87,7 +71,7 @@ class MDNodeOperand; //===----------------------------------------------------------------------===// /// MDNode - a tuple of other values. -class MDNode : public MetadataBase, public FoldingSetNode { +class MDNode : public Value, public FoldingSetNode { MDNode(const MDNode &); // DO NOT IMPLEMENT void operator=(const MDNode &); // DO NOT IMPLEMENT friend class MDNodeOperand; @@ -154,8 +138,9 @@ public: // getFunction - If this metadata is function-local and recursively has a // function-local operand, return the first such operand's parent function. - // Otherwise, return null. - Function *getFunction() const; + // Otherwise, return null. getFunction() should not be used for performance- + // critical code because it recursively visits all the MDNode's operands. + const Function *getFunction() const; // destroy - Delete this node. Only when there are no uses. void destroy(); |