mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e390a8e7ab
commit
0c51e0a826
@ -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