aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-29 21:58:56 +0000
committerDevang Patel <dpatel@apple.com>2009-07-29 21:58:56 +0000
commit3d3bdf43f3e1ea6646a8b9af59377a3f7ff5d220 (patch)
tree32a4aea4f2c96d80e6c418485b2bdae4678775df /include/llvm/Metadata.h
parenta0c38e6f80d46291fd3ce11c7b82026fd8745308 (diff)
downloadexternal_llvm-3d3bdf43f3e1ea6646a8b9af59377a3f7ff5d220.zip
external_llvm-3d3bdf43f3e1ea6646a8b9af59377a3f7ff5d220.tar.gz
external_llvm-3d3bdf43f3e1ea6646a8b9af59377a3f7ff5d220.tar.bz2
There is no need to keep name ref in NamedMDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r--include/llvm/Metadata.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index 54af723..7977c82 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -185,31 +185,26 @@ class NamedMDNode : public MetadataBase, public ilist_node<NamedMDNode> {
friend class LLVMContextImpl;
Module *Parent;
- StringRef Name;
SmallVector<WeakMetadataVH, 4> Node;
typedef SmallVectorImpl<WeakMetadataVH>::iterator elem_iterator;
protected:
- explicit NamedMDNode(const char *N, unsigned NameLength,
- MetadataBase*const* Vals, unsigned NumVals,
- Module *M = 0);
+ explicit NamedMDNode(const Twine &N, MetadataBase*const* Vals,
+ unsigned NumVals, Module *M = 0);
public:
- static NamedMDNode *Create(const char *N, unsigned NamedLength,
- MetadataBase*const*MDs, unsigned NumMDs,
- Module *M = 0) {
- return new NamedMDNode(N, NamedLength, MDs, NumMDs, M);
+ static NamedMDNode *Create(const Twine &N, MetadataBase*const*MDs,
+ unsigned NumMDs, Module *M = 0) {
+ return new NamedMDNode(N, MDs, NumMDs, M);
}
typedef SmallVectorImpl<WeakMetadataVH>::const_iterator const_elem_iterator;
- StringRef getName() const { return Name; }
-
/// getParent - Get the module that holds this named metadata collection.
inline Module *getParent() { return Parent; }
inline const Module *getParent() const { return Parent; }
void setParent(Module *M) { Parent = M; }
- Value *getElement(unsigned i) const {
+ MetadataBase *getElement(unsigned i) const {
return Node[i];
}