From: Adrian Prantl Date: Fri, 12 May 2017 21:38:32 +0000 (+0000) Subject: LTO: Don't verify modules twice in verifyMergedModuleOnce X-Git-Tag: llvmorg-5.0.0-rc1~5181 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1fa362f8119cab531de85c580a558fa520acc255;p=platform%2Fupstream%2Fllvm.git LTO: Don't verify modules twice in verifyMergedModuleOnce Differential Revision: https://reviews.llvm.org/D33140 llvm-svn: 302951 --- diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index 86fba84..2fbacd7 100644 --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -495,17 +495,14 @@ void LTOCodeGenerator::verifyMergedModuleOnce() { return; HasVerifiedInput = true; - if (LTOStripInvalidDebugInfo) { - bool BrokenDebugInfo = false; - if (verifyModule(*MergedModule, &dbgs(), &BrokenDebugInfo)) - report_fatal_error("Broken module found, compilation aborted!"); - if (BrokenDebugInfo) { - emitWarning("Invalid debug info found, debug info will be stripped"); - StripDebugInfo(*MergedModule); - } - } - if (verifyModule(*MergedModule, &dbgs())) + bool BrokenDebugInfo = false; + if (verifyModule(*MergedModule, &dbgs(), + LTOStripInvalidDebugInfo ? &BrokenDebugInfo : nullptr)) report_fatal_error("Broken module found, compilation aborted!"); + if (BrokenDebugInfo) { + emitWarning("Invalid debug info found, debug info will be stripped"); + StripDebugInfo(*MergedModule); + } } void LTOCodeGenerator::finishOptimizationRemarks() {