aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp14
-rw-r--r--lib/VMCore/LLVMContext.cpp2
-rw-r--r--lib/VMCore/LLVMContextImpl.h2
-rw-r--r--lib/VMCore/Metadata.cpp16
4 files changed, 17 insertions, 17 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index b8e5ec0265..a8b3d05a03 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -678,7 +678,7 @@ void SlotTracker::processFunction() {
ST_DEBUG("Inserting Instructions:\n");
- Metadata &TheMetadata = TheFunction->getContext().getMetadata();
+ MetadataContext &TheMetadata = TheFunction->getContext().getMetadata();
// Add all of the basic blocks and instructions with no names.
for (Function::const_iterator BB = TheFunction->begin(),
@@ -695,9 +695,9 @@ void SlotTracker::processFunction() {
CreateMetadataSlot(N);
// Process metadata attached with this instruction.
- const Metadata::MDMapTy *MDs = TheMetadata.getMDs(I);
+ const MetadataContext::MDMapTy *MDs = TheMetadata.getMDs(I);
if (MDs)
- for (Metadata::MDMapTy::const_iterator MI = MDs->begin(),
+ for (MetadataContext::MDMapTy::const_iterator MI = MDs->begin(),
ME = MDs->end(); MI != ME; ++MI)
if (MDNode *MDN = dyn_cast_or_null<MDNode>(MI->second))
CreateMetadataSlot(MDN);
@@ -1275,7 +1275,7 @@ public:
: Out(o), Machine(Mac), TheModule(M), AnnotationWriter(AAW) {
AddModuleTypesToPrinter(TypePrinter, NumberedTypes, M);
// FIXME: Provide MDPrinter
- Metadata &TheMetadata = M->getContext().getMetadata();
+ MetadataContext &TheMetadata = M->getContext().getMetadata();
const StringMap<unsigned> *Names = TheMetadata.getHandlerNames();
for (StringMapConstIterator<unsigned> I = Names->begin(),
E = Names->end(); I != E; ++I) {
@@ -2001,10 +2001,10 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
}
// Print Metadata info
- Metadata &TheMetadata = I.getContext().getMetadata();
- const Metadata::MDMapTy *MDMap = TheMetadata.getMDs(&I);
+ MetadataContext &TheMetadata = I.getContext().getMetadata();
+ const MetadataContext::MDMapTy *MDMap = TheMetadata.getMDs(&I);
if (MDMap)
- for (Metadata::MDMapTy::const_iterator MI = MDMap->begin(),
+ for (MetadataContext::MDMapTy::const_iterator MI = MDMap->begin(),
ME = MDMap->end(); MI != ME; ++MI)
if (const MDNode *MD = dyn_cast_or_null<MDNode>(MI->second))
Out << ", " << MDNames[MI->first]
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp
index 03f04366a4..39ed7ed688 100644
--- a/lib/VMCore/LLVMContext.cpp
+++ b/lib/VMCore/LLVMContext.cpp
@@ -71,6 +71,6 @@ bool LLVMContext::RemoveDeadMetadata() {
return Changed;
}
-Metadata &LLVMContext::getMetadata() {
+MetadataContext &LLVMContext::getMetadata() {
return pImpl->TheMetadata;
}
diff --git a/lib/VMCore/LLVMContextImpl.h b/lib/VMCore/LLVMContextImpl.h
index e4660c277d..83888c3907 100644
--- a/lib/VMCore/LLVMContextImpl.h
+++ b/lib/VMCore/LLVMContextImpl.h
@@ -179,7 +179,7 @@ public:
typedef DenseMap<Value*, ValueHandleBase*> ValueHandlesTy;
ValueHandlesTy ValueHandles;
- Metadata TheMetadata;
+ MetadataContext TheMetadata;
LLVMContextImpl(LLVMContext &C) : TheTrueVal(0), TheFalseVal(0),
VoidTy(C, Type::VoidTyID),
LabelTy(C, Type::LabelTyID),
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp
index 3daae13dd1..ddd510347b 100644
--- a/lib/VMCore/Metadata.cpp
+++ b/lib/VMCore/Metadata.cpp
@@ -259,7 +259,7 @@ NamedMDNode::~NamedMDNode() {
/// RegisterMDKind - Register a new metadata kind and return its ID.
/// A metadata kind can be registered only once.
-unsigned Metadata::RegisterMDKind(const char *Name) {
+unsigned MetadataContext::RegisterMDKind(const char *Name) {
unsigned Count = MDHandlerNames.size();
StringMap<unsigned>::iterator I = MDHandlerNames.find(Name);
assert(I == MDHandlerNames.end() && "Already registered MDKind!");
@@ -269,7 +269,7 @@ unsigned Metadata::RegisterMDKind(const char *Name) {
/// getMDKind - Return metadata kind. If the requested metadata kind
/// is not registered then return 0.
-unsigned Metadata::getMDKind(const char *Name) {
+unsigned MetadataContext::getMDKind(const char *Name) {
StringMap<unsigned>::iterator I = MDHandlerNames.find(Name);
if (I == MDHandlerNames.end())
return 0;
@@ -278,7 +278,7 @@ unsigned Metadata::getMDKind(const char *Name) {
}
/// setMD - Attach the metadata of given kind with an Instruction.
-void Metadata::setMD(unsigned MDKind, MDNode *Node, Instruction *Inst) {
+void MetadataContext::setMD(unsigned MDKind, MDNode *Node, Instruction *Inst) {
MDStoreTy::iterator I = MetadataStore.find(Inst);
Inst->HasMetadata = true;
if (I == MetadataStore.end()) {
@@ -295,7 +295,7 @@ void Metadata::setMD(unsigned MDKind, MDNode *Node, Instruction *Inst) {
/// getMD - Get the metadata of given kind attached with an Instruction.
/// If the metadata is not found then return 0.
-MDNode *Metadata::getMD(unsigned MDKind, const Instruction *Inst) {
+MDNode *MetadataContext::getMD(unsigned MDKind, const Instruction *Inst) {
MDNode *Node = NULL;
MDStoreTy::iterator I = MetadataStore.find(Inst);
if (I == MetadataStore.end())
@@ -309,7 +309,7 @@ MDNode *Metadata::getMD(unsigned MDKind, const Instruction *Inst) {
}
/// getMDs - Get the metadata attached with an Instruction.
-const Metadata::MDMapTy *Metadata::getMDs(const Instruction *Inst) {
+const MetadataContext::MDMapTy *MetadataContext::getMDs(const Instruction *Inst) {
MDStoreTy::iterator I = MetadataStore.find(Inst);
if (I == MetadataStore.end())
return NULL;
@@ -319,13 +319,13 @@ const Metadata::MDMapTy *Metadata::getMDs(const Instruction *Inst) {
/// getHandlerNames - Get handler names. This is used by bitcode
/// writer.
-const StringMap<unsigned> *Metadata::getHandlerNames() {
+const StringMap<unsigned> *MetadataContext::getHandlerNames() {
return &MDHandlerNames;
}
/// ValueIsDeleted - This handler is used to update metadata store
/// when a value is deleted.
-void Metadata::ValueIsDeleted(const Instruction *Inst) {
+void MetadataContext::ValueIsDeleted(const Instruction *Inst) {
// Find Metadata handles for this instruction.
MDStoreTy::iterator I = MetadataStore.find(Inst);
if (I == MetadataStore.end())
@@ -341,7 +341,7 @@ void Metadata::ValueIsDeleted(const Instruction *Inst) {
/// ValueIsCloned - This handler is used to update metadata store
/// when In1 is cloned to create In2.
-void Metadata::ValueIsCloned(const Instruction *In1, Instruction *In2) {
+void MetadataContext::ValueIsCloned(const Instruction *In1, Instruction *In2) {
// Find Metadata handles for In1.
MDStoreTy::iterator I = MetadataStore.find(In1);
if (I == MetadataStore.end())