]> granicus.if.org Git - clang/commitdiff
Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
authorDaniel Dunbar <daniel@zuster.org>
Thu, 29 Apr 2010 16:29:06 +0000 (16:29 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 29 Apr 2010 16:29:06 +0000 (16:29 +0000)
instead of NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102622 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CodeGenAction.cpp
lib/Frontend/CompilerInvocation.cpp

index 80b00389fb4057babec9dd92b07011b26f5edccb..b3443c0db3bfdb0996e4f18f2f7638eee570d631 100644 (file)
@@ -335,21 +335,13 @@ bool BackendConsumer::AddEmitPasses() {
   case 3: OptLevel = 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
-
   // Normal mode, emit a .s or .o file by running the code generator. Note,
   // this also adds codegenerator level optimization passes.
   TargetMachine::CodeGenFileType CGFT = TargetMachine::CGFT_AssemblyFile;
   if (Action == Backend_EmitObj)
     CGFT = TargetMachine::CGFT_ObjectFile;
   if (TM->addPassesToEmitFile(*PM, FormattedOutStream, CGFT, OptLevel,
-                              DisableVerify)) {
+                              /*DisableVerify=*/!CodeGenOpts.VerifyModule)) {
     Diags.Report(diag::err_fe_unable_to_interface_with_target);
     return false;
   }
index 68842a4015544d4a536463bf42c8a26bed4a734b..932c35e4f4eb92d098e34a848b1d46eb9cbe1b67 100644 (file)
@@ -145,7 +145,6 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts,
   // TimePasses is only derived.
   // UnitAtATime is unused.
   // UnrollLoops is only derived.
-  // VerifyModule is only derived.
   // Inlining is only derived.
 
   if (Opts.DataSections)