[llvm-commits] [llvm] r123390 - /llvm/trunk/tools/bugpoint/bugpoint.cpp

Benjamin Kramer benny.kra at googlemail.com
Fri Jan 14 07:23:29 PST 2011


On 13.01.2011, at 20:48, Devang Patel wrote:

> Author: dpatel
> Date: Thu Jan 13 13:48:54 2011
> New Revision: 123390
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=123390&view=rev
> Log:
> Little help to debug the bugpoint itself.
> Patch by Bob Wilson.
> 
> Modified:
>    llvm/trunk/tools/bugpoint/bugpoint.cpp
> 
> Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=123390&r1=123389&r2=123390&view=diff
> ==============================================================================
> --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original)
> +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Thu Jan 13 13:48:54 2011
> @@ -27,6 +27,10 @@
> #include "llvm/Support/Signals.h"
> #include "llvm/Support/Valgrind.h"
> #include "llvm/LinkAllVMCore.h"
> +
> +// Enable this macro to debug bugpoint itself.
> +#define DEBUG_BUGPOINT 0
> +
> using namespace llvm;
> 
> static cl::opt<bool> 
> @@ -71,9 +75,11 @@
> /// BugpointIsInterrupted - Set to true when the user presses ctrl-c.
> bool llvm::BugpointIsInterrupted = false;
> 
> +#ifndef DEBUG_BUGPOINT
> static void BugpointInterruptFunction() {
>   BugpointIsInterrupted = true;
> }
> +#endif
> 
> // Hack to capture a pass list.
> namespace {
> @@ -91,9 +97,11 @@
> }
> 
> int main(int argc, char **argv) {
> +#ifndef DEBUG_BUGPOINT
>   llvm::sys::PrintStackTraceOnErrorSignal();
>   llvm::PrettyStackTraceProgram X(argc, argv);
>   llvm_shutdown_obj Y;  // Call llvm_shutdown() on exit.
> +#endif
> 
>   // Initialize passes
>   PassRegistry &Registry = *PassRegistry::getPassRegistry();
> @@ -111,7 +119,9 @@
>                               "LLVM automatic testcase reducer. See\nhttp://"
>                               "llvm.org/cmds/bugpoint.html"
>                               " for more information.\n");
> +#ifndef DEBUG_BUGPOINT
>   sys::SetInterruptFunction(BugpointInterruptFunction);
> +#endif
> 
>   LLVMContext& Context = getGlobalContext();
>   // If we have an override, set it and then track the triple we want Modules
> @@ -160,7 +170,9 @@
> 
>   // Bugpoint has the ability of generating a plethora of core files, so to
>   // avoid filling up the disk, we prevent it
> +#ifndef DEBUG_BUGPOINT
>   sys::Process::PreventCoreFiles();
> +#endif
> 
>   std::string Error;
>   bool Failure = D.run(Error);

"#ifndef" checks whether a macro is not defined by the preprocessor.
"#define DEBUG_BUGPOINT 0" is a definition so the debug mode is always enabled now.



More information about the llvm-commits mailing list