summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-28 21:41:20 +0000
committerDevang Patel <dpatel@apple.com>2009-09-28 21:41:20 +0000
commite30e678865b8dc1b69ef1c26e7567ffd1300553c (patch)
tree1951754273d36be30da5e6d1ccaea38f7a461000
parenta2148402ce39fb3aad09e98a32078d3853a01ae9 (diff)
downloadexternal_llvm-e30e678865b8dc1b69ef1c26e7567ffd1300553c.zip
external_llvm-e30e678865b8dc1b69ef1c26e7567ffd1300553c.tar.gz
external_llvm-e30e678865b8dc1b69ef1c26e7567ffd1300553c.tar.bz2
s/class Metadata/class MetadataContext/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83019 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/LLVMContext.h4
-rw-r--r--include/llvm/Metadata.h6
-rw-r--r--include/llvm/Value.h4
-rw-r--r--lib/AsmParser/LLParser.cpp4
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp4
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp10
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.cpp6
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
-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
12 files changed, 38 insertions, 38 deletions
diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h
index 5e8cd1a..42b4ea6 100644
--- a/include/llvm/LLVMContext.h
+++ b/include/llvm/LLVMContext.h
@@ -18,7 +18,7 @@
namespace llvm {
class LLVMContextImpl;
-class Metadata;
+class MetadataContext;
/// 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
/// infrastructure, including the type and constant uniquing tables.
@@ -30,7 +30,7 @@ class LLVMContext {
void operator=(LLVMContext&);
public:
LLVMContextImpl* pImpl;
- Metadata &getMetadata();
+ MetadataContext &getMetadata();
bool RemoveDeadMetadata();
LLVMContext();
~LLVMContext();
diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h
index d799ea4..883de23 100644
--- a/include/llvm/Metadata.h
+++ b/include/llvm/Metadata.h
@@ -304,10 +304,10 @@ public:
};
//===----------------------------------------------------------------------===//
-/// Metadata -
-/// Metadata manages metadata used in a context.
+/// MetadataContext -
+/// MetadataContext manages metadata used in a context.
-class Metadata {
+class MetadataContext {
public:
typedef std::pair<unsigned, WeakVH> MDPairTy;
typedef SmallVector<MDPairTy, 2> MDMapTy;
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index ab6247e..6b393f6 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -42,7 +42,7 @@ class raw_ostream;
class AssemblyAnnotationWriter;
class ValueHandleBase;
class LLVMContext;
-class Metadata;
+class MetadataContext;
//===----------------------------------------------------------------------===//
// Value Class
@@ -83,7 +83,7 @@ private:
friend class ValueSymbolTable; // Allow ValueSymbolTable to directly mod Name.
friend class SymbolTable; // Allow SymbolTable to directly poke Name.
friend class ValueHandleBase;
- friend class Metadata;
+ friend class MetadataContext;
friend class AbstractTypeUser;
ValueName *Name;
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 1543e4b..b2b6b75 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -1038,7 +1038,7 @@ bool LLParser::ParseOptionalDbgInfo() {
MetadataBase *Node;
if (ParseMDNode(Node)) return true;
- Metadata &TheMetadata = M->getContext().getMetadata();
+ MetadataContext &TheMetadata = M->getContext().getMetadata();
unsigned MDDbgKind = TheMetadata.getMDKind("dbg");
if (!MDDbgKind)
MDDbgKind = TheMetadata.RegisterMDKind("dbg");
@@ -2656,7 +2656,7 @@ bool LLParser::ParseBasicBlock(PerFunctionState &PFS) {
ParseOptionalDbgInfo();
// Set metadata attached with this instruction.
- Metadata &TheMetadata = M->getContext().getMetadata();
+ MetadataContext &TheMetadata = M->getContext().getMetadata();
for (SmallVector<std::pair<unsigned, MDNode *>, 2>::iterator
MDI = MDsOnInst.begin(), MDE = MDsOnInst.end(); MDI != MDE; ++MDI)
TheMetadata.setMD(MDI->first, MDI->second, Inst);
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 0150f00..f5ddd3f 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -839,7 +839,7 @@ bool BitcodeReader::ParseMetadata() {
unsigned Kind = Record[0];
for (unsigned i = 1; i != RecordLength; ++i)
Name[i-1] = Record[i];
- Metadata &TheMetadata = Context.getMetadata();
+ MetadataContext &TheMetadata = Context.getMetadata();
assert(TheMetadata.MDHandlerNames.find(Name.str())
== TheMetadata.MDHandlerNames.end() &&
"Already registered MDKind!");
@@ -1556,7 +1556,7 @@ bool BitcodeReader::ParseMetadataAttachment() {
if (Stream.EnterSubBlock(bitc::METADATA_ATTACHMENT_ID))
return Error("Malformed block record");
- Metadata &TheMetadata = Context.getMetadata();
+ MetadataContext &TheMetadata = Context.getMetadata();
SmallVector<uint64_t, 64> Record;
while(1) {
unsigned Code = Stream.ReadCode();
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 3511dbc..5857c59 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -562,15 +562,15 @@ static void WriteMetadataAttachment(const Function &F,
// Write metadata attachments
// METADATA_ATTACHMENT - [m x [value, [n x [id, mdnode]]]
- Metadata &TheMetadata = F.getContext().getMetadata();
+ MetadataContext &TheMetadata = F.getContext().getMetadata();
for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end();
I != E; ++I) {
- const Metadata::MDMapTy *P = TheMetadata.getMDs(I);
+ const MetadataContext::MDMapTy *P = TheMetadata.getMDs(I);
if (!P) continue;
bool RecordedInstruction = false;
- for (Metadata::MDMapTy::const_iterator PI = P->begin(), PE = P->end();
- PI != PE; ++PI) {
+ for (MetadataContext::MDMapTy::const_iterator PI = P->begin(),
+ PE = P->end(); PI != PE; ++PI) {
if (MDNode *ND = dyn_cast_or_null<MDNode>(PI->second)) {
if (RecordedInstruction == false) {
Record.push_back(VE.getInstructionID(I));
@@ -601,7 +601,7 @@ static void WriteModuleMetadataStore(const Module *M,
// Write metadata kinds
// METADATA_KIND - [n x [id, name]]
- Metadata &TheMetadata = M->getContext().getMetadata();
+ MetadataContext &TheMetadata = M->getContext().getMetadata();
const StringMap<unsigned> *Kinds = TheMetadata.getHandlerNames();
for (StringMap<unsigned>::const_iterator
I = Kinds->begin(), E = Kinds->end(); I != E; ++I) {
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp
index 97219af..60253ad 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -86,7 +86,7 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
I != E; ++I)
EnumerateType(I->getType());
- Metadata &TheMetadata = F->getContext().getMetadata();
+ MetadataContext &TheMetadata = F->getContext().getMetadata();
for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;++I){
for (User::const_op_iterator OI = I->op_begin(), E = I->op_end();
@@ -99,9 +99,9 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
EnumerateAttributes(II->getAttributes());
// Enumerate 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))
EnumerateMetadata(MDN);
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 53a2e64..1b28bbd 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -372,7 +372,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB,
BasicBlock::iterator Begin,
BasicBlock::iterator End) {
SDL->setCurrentBasicBlock(BB);
- Metadata &TheMetadata = LLVMBB->getParent()->getContext().getMetadata();
+ MetadataContext &TheMetadata = LLVMBB->getParent()->getContext().getMetadata();
unsigned MDDbgKind = TheMetadata.getMDKind("dbg");
// Lower all of the non-terminator instructions. If a call is emitted
@@ -655,7 +655,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn,
#endif
);
- Metadata &TheMetadata = Fn.getContext().getMetadata();
+ MetadataContext &TheMetadata = Fn.getContext().getMetadata();
unsigned MDDbgKind = TheMetadata.getMDKind("dbg");
// Iterate over all basic blocks in the function.
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index b8e5ec0..a8b3d05 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 03f0436..39ed7ed 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 e4660c2..83888c3 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 3daae13..ddd5103 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())