Skip to content

Commit 2505a23

Browse files
committed
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.
1 parent 8637c09 commit 2505a23

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/comp/back/link.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ mod write {
115115
}
116116
}
117117

118+
if (opts.verify) {
119+
llvm::LLVMAddVerifierPass(pm.llpm);
120+
}
121+
118122
// FIXME: This is mostly a copy of the bits of opt's -O2 that are
119123
// available in the C api.
120124
// FIXME2: We might want to add optimization levels like -O1, -O2,

0 commit comments

Comments
 (0)