diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-07-21 22:25:57 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-07-21 22:25:57 +0000 |
commit | ecd81a3d1b542fb004d8a094c7ba281a4576bce2 (patch) | |
tree | 08218aafba4e09f069806ccf8a44427ea257e950 /llvm/lib/CodeGen/MachineFunctionAnalysis.cpp | |
parent | c523333bbf83a88b065ec34c816b64da4a428b66 (diff) | |
download | bcm5719-llvm-ecd81a3d1b542fb004d8a094c7ba281a4576bce2.tar.gz bcm5719-llvm-ecd81a3d1b542fb004d8a094c7ba281a4576bce2.zip |
[MIRTesting] Abort when failing to parse a function.
When we failed to parse a function in the mir parser, we should abort
the whole compilation instead of continuing in a weird state. Indeed,
this was creating strange machine function passes failures that were
hard to understand, until we notice that the function actually did not
get parsed correctly!
llvm-svn: 276348
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunctionAnalysis.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp b/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp index 338cd1e2203..3b69ed55fb6 100644 --- a/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp +++ b/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp @@ -49,8 +49,10 @@ bool MachineFunctionAnalysis::runOnFunction(Function &F) { assert(!MF && "MachineFunctionAnalysis already initialized!"); MF = new MachineFunction(&F, TM, NextFnNum++, getAnalysis<MachineModuleInfo>()); - if (MFInitializer) - MFInitializer->initializeMachineFunction(*MF); + if (MFInitializer) { + if (MFInitializer->initializeMachineFunction(*MF)) + report_fatal_error("Unable to initialize machine function"); + } return false; } |