From ecd81a3d1b542fb004d8a094c7ba281a4576bce2 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Thu, 21 Jul 2016 22:25:57 +0000 Subject: [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 --- llvm/lib/CodeGen/MachineFunctionAnalysis.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/MachineFunctionAnalysis.cpp') diff --git a/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp b/llvm/lib/CodeGen/MachineFunctionAnalysis.cpp index 338cd1e22032..3b69ed55fb6a 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()); - if (MFInitializer) - MFInitializer->initializeMachineFunction(*MF); + if (MFInitializer) { + if (MFInitializer->initializeMachineFunction(*MF)) + report_fatal_error("Unable to initialize machine function"); + } return false; } -- cgit v1.2.3