mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
MIR Parser: make the machine instruction parsing interface more consistent. NFC.
This commit refactors the interface for machine instruction parser. It adopts the pattern of returning a bool and passing in the result in the first argument that is used by the other parsing methods for the the method 'parse' and the function 'parseMachineInstr'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241085 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -265,13 +265,13 @@ bool MIRParserImpl::initializeMachineBasicBlock(
|
||||
// Parse the instructions.
|
||||
for (const auto &MISource : YamlMBB.Instructions) {
|
||||
SMDiagnostic Error;
|
||||
if (auto *MI = parseMachineInstr(SM, MF, MISource.Value, MBBSlots, IRSlots,
|
||||
Error)) {
|
||||
MBB.insert(MBB.end(), MI);
|
||||
continue;
|
||||
MachineInstr *MI = nullptr;
|
||||
if (parseMachineInstr(MI, SM, MF, MISource.Value, MBBSlots, IRSlots,
|
||||
Error)) {
|
||||
reportDiagnostic(diagFromMIStringDiag(Error, MISource.SourceRange));
|
||||
return true;
|
||||
}
|
||||
reportDiagnostic(diagFromMIStringDiag(Error, MISource.SourceRange));
|
||||
return true;
|
||||
MBB.insert(MBB.end(), MI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user