From 2505a2312eeae17cbf261833af5c2cab40f698e2 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 23 May 2011 19:49:23 -0400 Subject: [PATCH] rustc: Run the llvm verifier pass before optimization. Closes #376 The optimization passes were hiding some codegen errors so now we run the verifier both before and after optimization. --- src/comp/back/link.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs index d0e6b5a7c6f7..e75e8be4f3a5 100644 --- a/src/comp/back/link.rs +++ b/src/comp/back/link.rs @@ -115,6 +115,10 @@ mod write { } } + if (opts.verify) { + llvm::LLVMAddVerifierPass(pm.llpm); + } + // FIXME: This is mostly a copy of the bits of opt's -O2 that are // available in the C api. // FIXME2: We might want to add optimization levels like -O1, -O2,