[cfe-commits] r96077 - in /cfe/trunk/lib: Driver/Tools.cpp Frontend/CompilerInvocation.cpp

John McCall rjmccall at apple.com
Fri Feb 12 19:50:24 PST 2010


Author: rjmccall
Date: Fri Feb 12 21:50:24 2010
New Revision: 96077

URL: http://llvm.org/viewvc/llvm-project?rev=96077&view=rev
Log:
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.


Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=96077&r1=96076&r2=96077&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Feb 12 21:50:24 2010
@@ -687,6 +687,11 @@
   // 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");

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=96077&r1=96076&r2=96077&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Feb 12 21:50:24 2010
@@ -180,6 +180,8 @@
     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 @@
   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,





More information about the cfe-commits mailing list