aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-09-28 21:14:55 +0000
committerDevang Patel <dpatel@apple.com>2009-09-28 21:14:55 +0000
commitb5896160216cae66e3a06cb58c3c38ba09f6969e (patch)
tree1c281d051ac85c8b27367dd80c08acd0d250f404 /lib
parentcb8bbe7d7b17bf387769d86e614034a36adc159e (diff)
downloadexternal_llvm-b5896160216cae66e3a06cb58c3c38ba09f6969e.zip
external_llvm-b5896160216cae66e3a06cb58c3c38ba09f6969e.tar.gz
external_llvm-b5896160216cae66e3a06cb58c3c38ba09f6969e.tar.bz2
Do not use global typedef for MDKindID.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AsmParser/LLParser.cpp2
-rw-r--r--lib/AsmParser/LLParser.h2
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp4
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
-rw-r--r--lib/VMCore/Metadata.cpp10
5 files changed, 11 insertions, 11 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 0ecf847..1543e4b 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -2657,7 +2657,7 @@ bool LLParser::ParseBasicBlock(PerFunctionState &PFS) {
// Set metadata attached with this instruction.
Metadata &TheMetadata = M->getContext().getMetadata();
- for (SmallVector<std::pair<MDKindID, MDNode *>, 2>::iterator
+ for (SmallVector<std::pair<unsigned, MDNode *>, 2>::iterator
MDI = MDsOnInst.begin(), MDE = MDsOnInst.end(); MDI != MDE; ++MDI)
TheMetadata.setMD(MDI->first, MDI->second, Inst);
MDsOnInst.clear();
diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h
index 3420fcf..7c516fa 100644
--- a/lib/AsmParser/LLParser.h
+++ b/lib/AsmParser/LLParser.h
@@ -48,7 +48,7 @@ namespace llvm {
/// MetadataCache - This map keeps track of parsed metadata constants.
std::map<unsigned, MetadataBase *> MetadataCache;
std::map<unsigned, std::pair<MetadataBase *, LocTy> > ForwardRefMDNodes;
- SmallVector<std::pair<MDKindID, MDNode *>, 2> MDsOnInst;
+ SmallVector<std::pair<unsigned, MDNode *>, 2> MDsOnInst;
struct UpRefRecord {
/// Loc - This is the location of the upref.
LocTy Loc;
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index f3ab806..0150f00 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -836,7 +836,7 @@ bool BitcodeReader::ParseMetadata() {
return Error("Invalid METADATA_KIND record");
SmallString<8> Name;
Name.resize(RecordLength-1);
- MDKindID Kind = Record[0];
+ unsigned Kind = Record[0];
for (unsigned i = 1; i != RecordLength; ++i)
Name[i-1] = Record[i];
Metadata &TheMetadata = Context.getMetadata();
@@ -1580,7 +1580,7 @@ bool BitcodeReader::ParseMetadataAttachment() {
return Error ("Invalid METADATA_ATTACHMENT reader!");
Instruction *Inst = InstructionList[Record[0]];
for (unsigned i = 1; i != RecordLength; i = i+2) {
- MDKindID Kind = Record[i];
+ unsigned Kind = Record[i];
Value *Node = MDValueList.getValueFwdRef(Record[i+1]);
TheMetadata.setMD(Kind, cast<MDNode>(Node), Inst);
}
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 197b3b6..53a2e64 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -373,7 +373,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB,
BasicBlock::iterator End) {
SDL->setCurrentBasicBlock(BB);
Metadata &TheMetadata = LLVMBB->getParent()->getContext().getMetadata();
- MDKindID MDDbgKind = TheMetadata.getMDKind("dbg");
+ unsigned MDDbgKind = TheMetadata.getMDKind("dbg");
// Lower all of the non-terminator instructions. If a call is emitted
// as a tail call, cease emitting nodes for this block.
@@ -656,7 +656,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn,
);
Metadata &TheMetadata = Fn.getContext().getMetadata();
- MDKindID MDDbgKind = TheMetadata.getMDKind("dbg");
+ unsigned MDDbgKind = TheMetadata.getMDKind("dbg");
// Iterate over all basic blocks in the function.
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) {
diff --git a/lib/VMCore/Metadata.cpp b/lib/VMCore/Metadata.cpp
index 67bb66f..3daae13 100644
--- a/lib/VMCore/Metadata.cpp
+++ b/lib/VMCore/Metadata.cpp
@@ -259,8 +259,8 @@ NamedMDNode::~NamedMDNode() {
/// RegisterMDKind - Register a new metadata kind and return its ID.
/// A metadata kind can be registered only once.
-MDKindID Metadata::RegisterMDKind(const char *Name) {
- MDKindID Count = MDHandlerNames.size();
+unsigned Metadata::RegisterMDKind(const char *Name) {
+ unsigned Count = MDHandlerNames.size();
StringMap<unsigned>::iterator I = MDHandlerNames.find(Name);
assert(I == MDHandlerNames.end() && "Already registered MDKind!");
MDHandlerNames[Name] = Count + 1;
@@ -269,7 +269,7 @@ MDKindID Metadata::RegisterMDKind(const char *Name) {
/// getMDKind - Return metadata kind. If the requested metadata kind
/// is not registered then return 0.
-MDKindID Metadata::getMDKind(const char *Name) {
+unsigned Metadata::getMDKind(const char *Name) {
StringMap<unsigned>::iterator I = MDHandlerNames.find(Name);
if (I == MDHandlerNames.end())
return 0;
@@ -278,7 +278,7 @@ MDKindID Metadata::getMDKind(const char *Name) {
}
/// setMD - Attach the metadata of given kind with an Instruction.
-void Metadata::setMD(MDKindID MDKind, MDNode *Node, Instruction *Inst) {
+void Metadata::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(MDKindID 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(MDKindID MDKind, const Instruction *Inst) {
+MDNode *Metadata::getMD(unsigned MDKind, const Instruction *Inst) {
MDNode *Node = NULL;
MDStoreTy::iterator I = MetadataStore.find(Inst);
if (I == MetadataStore.end())