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
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