aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Instruction.h2
-rw-r--r--include/llvm/LLVMContext.h20
-rw-r--r--include/llvm/Metadata.h23
-rw-r--r--include/llvm/Module.h11
-rw-r--r--include/llvm/Value.h1
5 files changed, 25 insertions, 32 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index d7161cf3f2..d45da974bc 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -22,7 +22,6 @@ namespace llvm {
class LLVMContext;
class MDNode;
-class MetadataContextImpl;
template<typename ValueSubClass, typename ItemParentClass>
class SymbolTableListTraits;
@@ -316,7 +315,6 @@ private:
return Value::getSubclassDataFromValue();
}
- friend class MetadataContextImpl;
void setHasMetadata(bool V) {
setValueSubclassData((getSubclassDataFromValue() & ~HasMetadataBit) |
(V ? HasMetadataBit : 0));
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h
index b9ffeb002b..6d36d5eb1e 100644
--- a/include/llvm/LLVMContext.h
+++ b/include/llvm/LLVMContext.h
@@ -18,7 +18,8 @@
namespace llvm {
class LLVMContextImpl;
-class MetadataContext;
+class StringRef;
+template <typename T> class SmallVectorImpl;
/// This is an important class for using LLVM in a threaded context. It
/// (opaquely) owns and manages the core "global" data of LLVM's core
@@ -31,14 +32,23 @@ class LLVMContext {
void operator=(LLVMContext&);
public:
- LLVMContextImpl* const pImpl;
- MetadataContext &getMetadata();
+ LLVMContextImpl *const pImpl;
LLVMContext();
~LLVMContext();
+
+ /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
+ /// This ID is uniqued across modules in the current LLVMContext.
+ unsigned getMDKindID(StringRef Name) const;
+
+ /// getMDKindNames - Populate client supplied SmallVector with the name for
+ /// custom metadata IDs registered in this LLVMContext. ID #0 is not used,
+ /// so it is filled in as an empty string.
+ void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
};
-/// FOR BACKWARDS COMPATIBILITY - Returns a global context.
-extern LLVMContext& getGlobalContext();
+/// getGlobalContext - Returns a global context. This is for LLVM clients that
+/// only care about operating on a single thread.
+extern LLVMContext &getGlobalContext();
}
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index c25ce22511..86eba354e2 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -25,7 +25,6 @@ class Constant;
class Instruction;
class LLVMContext;
class Module;
-class MetadataContextImpl;
template <typename T> class SmallVectorImpl;
//===----------------------------------------------------------------------===//
@@ -204,28 +203,6 @@ public:
}
};
-//===----------------------------------------------------------------------===//
-/// MetadataContext - MetadataContext handles uniquing and assignment of IDs for
-/// custom metadata types.
-///
-class MetadataContext {
- MetadataContext(MetadataContext&); // DO NOT IMPLEMENT
- void operator=(MetadataContext&); // DO NOT IMPLEMENT
-
- MetadataContextImpl *const pImpl;
- friend class Instruction;
-public:
- MetadataContext();
- ~MetadataContext();
-
- /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
- unsigned getMDKindID(StringRef Name) const;
-
- /// getMDKindNames - Populate client supplied SmallVector with the name for
- /// each custom metadata ID. ID #0 is not used, so it is filled in as empty.
- void getMDKindNames(SmallVectorImpl<StringRef> &) const;
-};
-
} // end llvm namespace
#endif
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index 895ee01f83..9a8b53ac58 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -184,7 +184,7 @@ public:
/// Get the global data context.
/// @returns LLVMContext - a container for LLVM's global information
- LLVMContext& getContext() const { return Context; }
+ LLVMContext &getContext() const { return Context; }
/// Get any module-scope inline assembly blocks.
/// @returns a string containing the module-scope inline assembly blocks.
@@ -222,6 +222,15 @@ public:
/// if a global with the specified name is not found.
GlobalValue *getNamedValue(StringRef Name) const;
+ /// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
+ /// This ID is uniqued across modules in the current LLVMContext.
+ unsigned getMDKindID(StringRef Name) const;
+
+ /// getMDKindNames - Populate client supplied SmallVector with the name for
+ /// custom metadata IDs registered in this LLVMContext. ID #0 is not used,
+ /// so it is filled in as an empty string.
+ void getMDKindNames(SmallVectorImpl<StringRef> &Result) const;
+
/// @}
/// @name Function Accessors
/// @{
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index 1be6ffd488..4d94a30191 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -41,7 +41,6 @@ class raw_ostream;
class AssemblyAnnotationWriter;
class ValueHandleBase;
class LLVMContext;
-class MetadataContextImpl;
class Twine;
//===----------------------------------------------------------------------===//