aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-12 23:47:27 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-12 23:47:27 +0000
commit824e19ed926d7aa1296a007d0607ac4437e3c4a9 (patch)
tree1de7144a482dc72c4c221836240837bd840d1756
parent5ce5dab3c30e4255b8f62b148b6a86f09a444aaa (diff)
Add an option to disable the LLVM verifier pass (which is still always
disabled in NDEBUG builds). The option applies only to -cc1 invocations and is: -disable_llvm_verifier git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96046 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/CC1Options.td2
-rw-r--r--lib/Frontend/CompilerInvocation.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index eac6e0761f..bd243d681f 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -102,6 +102,8 @@ def analyzer_viz_egraph_ubigraph : Flag<"-analyzer-viz-egraph-ubigraph">,
def disable_llvm_optzns : Flag<"-disable-llvm-optzns">,
HelpText<"Don't run LLVM optimization passes">;
+def disable_llvm_verifier : Flag<"-disable-llvm-verifier">,
+ HelpText<"Don't run the LLVM IR verifier pass">;
def disable_red_zone : Flag<"-disable-red-zone">,
HelpText<"Do not emit code that uses the red zone.">;
def dwarf_debug_flags : Separate<"-dwarf-debug-flags">,
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 7287d429b4..bd45f074b1 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -794,7 +794,7 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
#ifdef NDEBUG
Opts.VerifyModule = 0;
#else
- Opts.VerifyModule = 1;
+ Opts.VerifyModule = !Args.hasArg(OPT_disable_llvm_verifier);
#endif
}