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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-01-12 22:27:39 +00:00
parent e390a8e7ab
commit 0c51e0a826

View File

@ -531,7 +531,7 @@ bool LLParser::ParseMDNodeID(MDNode *&Result) {
}
// 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, bool IsDistinct) {
if (ParseMDNodeVector(Elts))
return true;
MD = (IsDistinct ? MDNode::getDistinct : MDNode::get)(Context, Elts);
MD = (IsDistinct ? MDTuple::getDistinct : MDTuple::get)(Context, Elts);
return false;
}