aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Driver/Tools.cpp5
-rw-r--r--lib/Frontend/CompilerInvocation.cpp8
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index f3b19f5242..aff70bc7ba 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -687,6 +687,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// The make clang go fast button.
CmdArgs.push_back("-disable-free");
+ // Disable the verification pass in -asserts builds.
+#ifdef NDEBUG
+ CmdArgs.push_back("-disable-llvm-verifier");
+#endif
+
// Set the main file name, so that debug info works even with
// -save-temps.
CmdArgs.push_back("-main-file-name");
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index bd45f074b1..a193ac8703 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -180,6 +180,8 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts,
Res.push_back("-mrelocation-model");
Res.push_back(Opts.RelocationModel);
}
+ if (!Opts.VerifyModule)
+ Res.push_back("-disable-llvm-verifier");
}
static void DependencyOutputOptsToArgs(const DependencyOutputOptions &Opts,
@@ -789,13 +791,7 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
Opts.RelocationModel = getLastArgValue(Args, OPT_mrelocation_model, "pic");
Opts.MainFileName = getLastArgValue(Args, OPT_main_file_name);
-
- // FIXME: Put elsewhere?
-#ifdef NDEBUG
- Opts.VerifyModule = 0;
-#else
Opts.VerifyModule = !Args.hasArg(OPT_disable_llvm_verifier);
-#endif
}
static void ParseDependencyOutputArgs(DependencyOutputOptions &Opts,