[llvm] r225711 - AsmParser: Use subclass API instead of MDNode wrappers, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jan 12 14:27:39 PST 2015
Author: dexonsmith
Date: Mon Jan 12 16:27:39 2015
New Revision: 225711
URL: http://llvm.org/viewvc/llvm-project?rev=225711&view=rev
Log:
AsmParser: Use subclass API instead of MDNode wrappers, NFC
Use subclass API instead of the wrappers in `MDNode` in the assembly
parser. This will make the code easier to follow once we have multiple
subclasses.
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=225711&r1=225710&r2=225711&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jan 12 16:27:39 2015
@@ -531,7 +531,7 @@ bool LLParser::ParseMDNodeID(MDNode *&Re
}
// Otherwise, create MDNode forward reference.
- MDNodeFwdDecl *FwdNode = MDNode::getTemporary(Context, None);
+ MDNodeFwdDecl *FwdNode = MDNodeFwdDecl::get(Context, None);
ForwardRefMDNodes[MID] = std::make_pair(FwdNode, Lex.getLoc());
if (NumberedMetadata.size() <= MID)
@@ -594,9 +594,9 @@ bool LLParser::ParseStandaloneMetadata()
// See if this was forward referenced, if so, handle it.
auto FI = ForwardRefMDNodes.find(MetadataID);
if (FI != ForwardRefMDNodes.end()) {
- auto *Temp = FI->second.first;
+ MDNodeFwdDecl *Temp = FI->second.first;
Temp->replaceAllUsesWith(Init);
- MDNode::deleteTemporary(Temp);
+ delete Temp;
ForwardRefMDNodes.erase(FI);
assert(NumberedMetadata[MetadataID] == Init && "Tracking VH didn't work");
@@ -2895,7 +2895,7 @@ bool LLParser::ParseMDTuple(MDNode *&MD,
if (ParseMDNodeVector(Elts))
return true;
- MD = (IsDistinct ? MDNode::getDistinct : MDNode::get)(Context, Elts);
+ MD = (IsDistinct ? MDTuple::getDistinct : MDTuple::get)(Context, Elts);
return false;
}
More information about the llvm-commits
mailing list