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>
On Jul 25, 2008, at 7:33 AM, Matthijs Kooijman wrote:> 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?Cool, sure, looks fine with one change.> 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).<iostream> is the only "poisoned" header, all other stream headers are ok. Also, for bugpoint, we don't really care... we care in the libraries primarily.> @@ -469,7 +470,9 @@ > - std::cout << "Checking instruction '" << I->getName() > << "': "; > + std::ostringstream SS; I->print(SS); > + > + std::cout << "Checking instruction '" << SS.str() << > "': ";Instead of using sstream, why not just use "... << *I << "? -Chris
> <iostream> is the only "poisoned" header, all other stream headers are > ok. Also, for bugpoint, we don't really care... we care in the > libraries primarily.Ah, good to know.> > + std::cout << "Checking instruction '" << SS.str() << > Instead of using sstream, why not just use "... << *I << "?Excellent point. If I had remembered that, I would probably have committed it right away :-p Gr. Matthijs -------------- 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/129c17ba/attachment.sig>
Reasonably Related Threads
- [LLVMdev] Slightly improve bugpoint output
- interaction with C++ code (PR#10487)
- [LLVMdev] Error compiling llvm/clang with clang+libc++ with -std=cxx0x
- [LLVMdev] Error compiling llvm/clang with clang+libc++ with -std=cxx0x
- [LLVMdev] [PATCH] Fix for bugpoint -remote-client