[LLVMdev] Slightly improve bugpoint output

Matthijs Kooijman matthijs at stdin.nl
Fri Jul 25 07:33:58 PDT 2008


Hi all,

after seeing a near inifinite stream of "Checking instruction ''" from
bugpoint, I thought to improve that a bit. Turns out that bugpoint outputs the
name, which is often empty (especially for the big bitcodes you want to pull
through bugpoint :-).

Below patch changes the behaviour to output the assembly version of the
instruction instead of the name, which makes things a bit clearer. Is this ok
to commit?

I've two doubts here. First, was there a particular reason to not do this in
the first place? Performance perhaps? Shouldn't matter so much, I guess?
Second, I'm including <sstream> directly. Is this allowed, or should there be
some LLVM wrapper just as for <iostream> ? (Code was copied from
instcombine, though).


Gr.

Matthijs


Index: CrashDebugger.cpp
===================================================================
--- CrashDebugger.cpp	(revision 54012)
+++ CrashDebugger.cpp	(working copy)
@@ -28,6 +28,7 @@
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Support/CommandLine.h"
 #include <fstream>
+#include <sstream>
 #include <set>
 using namespace llvm;
 
@@ -469,7 +470,9 @@
             } else {
               if (BugpointIsInterrupted) goto ExitLoops;
 
-              std::cout << "Checking instruction '" << I->getName() << "': ";
+              std::ostringstream SS; I->print(SS);
+
+              std::cout << "Checking instruction '" << SS.str() << "': ";
               Module *M = BD.deleteInstructionFromProgram(I, Simplification);
 
               // Find out if the pass still crashes on this pass...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080725/e58af24a/attachment.sig>


More information about the llvm-dev mailing list