mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
MIR Parser: report an error when a basic block isn't found.
This commit reports an error when the MIR parser can't find a basic block with the machine basic block's name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240174 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -212,7 +212,9 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
|
||||
if (!YamlMBB.Name.empty()) {
|
||||
BB = dyn_cast_or_null<BasicBlock>(
|
||||
F.getValueSymbolTable().lookup(YamlMBB.Name));
|
||||
// TODO: Report an error if a basic block isn't found.
|
||||
if (!BB)
|
||||
return error(Twine("basic block '") + YamlMBB.Name +
|
||||
"' is not defined in the function '" + MF.getName() + "'");
|
||||
}
|
||||
auto *MBB = MF.CreateMachineBasicBlock(BB);
|
||||
MF.insert(MF.end(), MBB);
|
||||
|
Reference in New Issue
Block a user