summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2017-04-11 19:32:41 +0000
committerJustin Bogner <mail@justinbogner.com>2017-04-11 19:32:41 +0000
commit20dd36a48a76bb4227e19ad5da26066db5a466fa (patch)
treedf04a68185ca6f2a7db770221a16b346187c3c01 /llvm/lib/CodeGen/MachineVerifier.cpp
parent203eef0ed57a849d6d76ed57ee1963d1c49a5b30 (diff)
downloadbcm5719-llvm-20dd36a48a76bb4227e19ad5da26066db5a466fa.tar.gz
bcm5719-llvm-20dd36a48a76bb4227e19ad5da26066db5a466fa.zip
MIR: Allow parsing of empty machine functions
If you run llc -stop-after=codegenprepare and feed the resulting MIR to llc -start-after=codegenprepare, you'll have an empty machine function since we haven't run any isel yet. Of course, this only works if the MIRParser believes you that this is okay. This is essentially a revert of r241862 with a fix for the problem it was papering over. llvm-svn: 299975
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineVerifier.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index fc4026174ca..f49232b0f8a 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -528,7 +528,8 @@ void MachineVerifier::visitMachineFunctionBefore() {
lastIndex = SlotIndex();
regsReserved = MRI->getReservedRegs();
- markReachable(&MF->front());
+ if (!MF->empty())
+ markReachable(&MF->front());
// Build a set of the basic blocks in the function.
FunctionBlocks.clear();
@@ -548,7 +549,8 @@ void MachineVerifier::visitMachineFunctionBefore() {
// Check that the register use lists are sane.
MRI->verifyUseLists();
- verifyStackFrame();
+ if (!MF->empty())
+ verifyStackFrame();
}
// Does iterator point to a and b as the first two elements?
OpenPOWER on IntegriCloud