aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Metadata.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
committerOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
commit1d0be15f89cb5056e20e2d24faa8d6afb1573bca (patch)
tree2cdabe223bfce83bd12e10dd557147a2f68c9bf8 /include/llvm/Metadata.h
parentd163e8b14c8aa5bbbb129e3f0dffdbe7213a3c72 (diff)
downloadexternal_llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.gz
external_llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.bz2
external_llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.zip
Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
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 8533efddb0..f36de687d6 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.