summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-07-09 21:21:33 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-07-09 21:21:33 +0000
commitc8704b02df54ff109f3fe28798aed5ff8b8ecb29 (patch)
tree719148d7f61da0821d7e4fb85c8c9dde785644ad /llvm/lib/CodeGen
parentdcb9f0907f15c5a660cf8f9ffe315015af5fcaff (diff)
downloadbcm5719-llvm-c8704b02df54ff109f3fe28798aed5ff8b8ecb29.tar.gz
bcm5719-llvm-c8704b02df54ff109f3fe28798aed5ff8b8ecb29.zip
MIR Parser: Report an error when parsing machine function with an empty body.
This commit adds a new error which is reported when the MIR Parser encounters a machine function without any machine basic blocks. The machine verifier expects that the machine functions have at least one MBB, and this error will prevent machine functions without MBBs from reaching the machine verifier and crashing with an assertion. llvm-svn: 241862
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIRParser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
index e505ab4baeb..e5ba0322235 100644
--- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
@@ -275,6 +275,9 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
Twine(YamlMBB.ID));
}
+ if (YamlMF.BasicBlocks.empty())
+ return error(Twine("machine function '") + Twine(MF.getName()) +
+ "' requires at least one machine basic block in its body");
// Initialize the machine basic blocks after creating them all so that the
// machine instructions parser can resolve the MBB references.
unsigned I = 0;
OpenPOWER on IntegriCloud