mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
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. llvm-svn: 225711
This commit is contained in:
parent
ccc17605f3
commit
74ac6bf4b3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user