From bb79b5f6f35c912b3a9982a4d3d18288da7b150a Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 13 Feb 2010 03:50:24 +0000 Subject: Raise the responsibility for passing -disable-llvm-verifier in NDEBUG builds to the driver, and support it in CodeGenOptsToArgs(). Note that this changes the default behavior of clang -cc1 to always run the verifier. llvm-svn: 96077 --- clang/lib/Frontend/CompilerInvocation.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index bd45f07..a193ac8 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/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, -- cgit v1.1