aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Metadata.h')
-rw-r--r--include/llvm/Metadata.h31
1 files changed, 7 insertions, 24 deletions
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index 8533efd..f36de68 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -44,12 +44,6 @@ protected:
void resizeOperands(unsigned NumOps);
public:
- /// getType() specialization - Type is always MetadataTy.
- ///
- inline const Type *getType() const {
- return Type::MetadataTy;
- }
-
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue. This always returns false because getNullValue will never
/// produce metadata.
@@ -76,8 +70,8 @@ class MDString : public MetadataBase {
StringRef Str;
protected:
- explicit MDString(const char *begin, unsigned l)
- : MetadataBase(Type::MetadataTy, Value::MDStringVal), Str(begin, l) {}
+ explicit MDString(LLVMContext &C, const char *begin, unsigned l)
+ : MetadataBase(Type::getMetadataTy(C), Value::MDStringVal), Str(begin, l) {}
public:
// Do not allocate any space for operands.
@@ -119,7 +113,7 @@ class MDNode : public MetadataBase {
friend struct ConstantCreator<MDNode, Type, std::vector<Value*> >;
protected:
- explicit MDNode(Value*const* Vals, unsigned NumVals);
+ explicit MDNode(LLVMContext &C, Value*const* Vals, unsigned NumVals);
public:
// Do not allocate any space for operands.
void *operator new(size_t s) {
@@ -156,12 +150,6 @@ public:
elem_iterator elem_begin() { return Node.begin(); }
elem_iterator elem_end() { return Node.end(); }
- /// getType() specialization - Type is always MetadataTy.
- ///
- inline const Type *getType() const {
- return Type::MetadataTy;
- }
-
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue. This always returns false because getNullValue will never
/// produce metadata.
@@ -217,16 +205,17 @@ class NamedMDNode : public MetadataBase, public ilist_node<NamedMDNode> {
typedef SmallVectorImpl<WeakMetadataVH>::iterator elem_iterator;
protected:
- explicit NamedMDNode(const Twine &N, MetadataBase*const* Vals,
+ explicit NamedMDNode(LLVMContext &C, const Twine &N, MetadataBase*const* Vals,
unsigned NumVals, Module *M = 0);
public:
// Do not allocate any space for operands.
void *operator new(size_t s) {
return User::operator new(s, 0);
}
- static NamedMDNode *Create(const Twine &N, MetadataBase*const*MDs,
+ static NamedMDNode *Create(LLVMContext &C, const Twine &N,
+ MetadataBase*const*MDs,
unsigned NumMDs, Module *M = 0) {
- return new NamedMDNode(N, MDs, NumMDs, M);
+ return new NamedMDNode(C, N, MDs, NumMDs, M);
}
static NamedMDNode *Create(const NamedMDNode *NMD, Module *M = 0);
@@ -271,12 +260,6 @@ public:
elem_iterator elem_begin() { return Node.begin(); }
elem_iterator elem_end() { return Node.end(); }
- /// getType() specialization - Type is always MetadataTy.
- ///
- inline const Type *getType() const {
- return Type::MetadataTy;
- }
-
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue. This always returns false because getNullValue will never
/// produce metadata.