diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-06-19 20:12:03 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-06-19 20:12:03 +0000 |
commit | 00302df3fe9c479b73771f8a3a64527a321e6c24 (patch) | |
tree | 0ae72191f059c769d9a0d367b3b4b49e4e523848 /llvm/lib/CodeGen/MIRParser/MIRParser.cpp | |
parent | 9350f0ddacdcf593ebfbf7f72a44c2ec584a4288 (diff) | |
download | bcm5719-llvm-00302df3fe9c479b73771f8a3a64527a321e6c24.tar.gz bcm5719-llvm-00302df3fe9c479b73771f8a3a64527a321e6c24.zip |
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.
llvm-svn: 240174
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIRParser.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 20d7f815655..1fef3f6dcb3 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -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); |