about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorBrian Anderson <andersrb@gmail.com>2011-05-23 19:49:23 -0400
committerBrian Anderson <andersrb@gmail.com>2011-05-23 19:52:57 -0400
commit2505a2312eeae17cbf261833af5c2cab40f698e2 (patch)
tree59e3462e2d854401b0deb125e24d6663ca7df403 /src/comp
parent8637c09cf920725c0e813f2c9e69cdb12683030b (diff)
downloadrust-2505a2312eeae17cbf261833af5c2cab40f698e2.tar.gz
rust-2505a2312eeae17cbf261833af5c2cab40f698e2.zip
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.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/back/link.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs
index d0e6b5a7c6f..e75e8be4f3a 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,