mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
MIR Serialization: Serialize MBB successors.
This commit implements serialization of the machine basic block successors. It uses a YAML flow sequence that contains strings that have the MBB references. The MBB references in those strings use the same syntax as the MBB machine operands in the machine instruction strings. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10699 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -274,9 +274,18 @@ bool MIRParserImpl::initializeMachineBasicBlock(
|
||||
if (YamlMBB.AddressTaken)
|
||||
MBB.setHasAddressTaken();
|
||||
MBB.setIsLandingPad(YamlMBB.IsLandingPad);
|
||||
SMDiagnostic Error;
|
||||
// Parse the successors.
|
||||
for (const auto &MBBSource : YamlMBB.Successors) {
|
||||
MachineBasicBlock *SuccMBB = nullptr;
|
||||
if (parseMBBReference(SuccMBB, SM, MF, MBBSource.Value, MBBSlots, IRSlots,
|
||||
Error))
|
||||
return error(Error, MBBSource.SourceRange);
|
||||
// TODO: Report an error when adding the same successor more than once.
|
||||
MBB.addSuccessor(SuccMBB);
|
||||
}
|
||||
// Parse the instructions.
|
||||
for (const auto &MISource : YamlMBB.Instructions) {
|
||||
SMDiagnostic Error;
|
||||
MachineInstr *MI = nullptr;
|
||||
if (parseMachineInstr(MI, SM, MF, MISource.Value, MBBSlots, IRSlots, Error))
|
||||
return error(Error, MISource.SourceRange);
|
||||
|
Reference in New Issue
Block a user