summaryrefslogtreecommitdiff
path: root/tools/llc
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-03-01 21:45:21 +0000
committerDan Gohman <gohman@apple.com>2010-03-01 21:45:21 +0000
commitd44f16fce7b23d61e0b10cfdca3d10869b0236ae (patch)
tree4c77883265232080551c3922d1f609365da5b8f9 /tools/llc
parent31c020a147edafc36d7d913ebb16020c574cdac3 (diff)
downloadllvm-d44f16fce7b23d61e0b10cfdca3d10869b0236ae.tar.gz
llvm-d44f16fce7b23d61e0b10cfdca3d10869b0236ae.tar.bz2
llvm-d44f16fce7b23d61e0b10cfdca3d10869b0236ae.tar.xz
Make llc opt into the addPassesToEmitFile verify pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index fe34bd128e..810ba42200 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -305,6 +305,14 @@ int main(int argc, char **argv) {
case '3': OLvl = CodeGenOpt::Aggressive; break;
}
+ // Request that addPassesToEmitFile run the Verifier after running
+ // passes which modify the IR.
+#ifndef NDEBUG
+ bool DisableVerify = false;
+#else
+ bool DisableVerify = true;
+#endif
+
// If this target requires addPassesToEmitWholeFile, do it now. This is
// used by strange things like the C backend.
if (Target.WantsWholeFile()) {
@@ -320,7 +328,8 @@ int main(int argc, char **argv) {
PM.add(createVerifierPass());
// Ask the target to add backend passes as necessary.
- if (Target.addPassesToEmitWholeFile(PM, *Out, FileType, OLvl)) {
+ if (Target.addPassesToEmitWholeFile(PM, *Out, FileType, OLvl,
+ DisableVerify)) {
errs() << argv[0] << ": target does not support generation of this"
<< " file type!\n";
if (Out != &fouts()) delete Out;
@@ -347,7 +356,8 @@ int main(int argc, char **argv) {
// Override default to generate verbose assembly.
Target.setAsmVerbosityDefault(true);
- if (Target.addPassesToEmitFile(Passes, *Out, FileType, OLvl)) {
+ if (Target.addPassesToEmitFile(Passes, *Out, FileType, OLvl,
+ DisableVerify)) {
errs() << argv[0] << ": target does not support generation of this"
<< " file type!\n";
if (Out != &fouts()) delete Out;