[LLVMdev] Slightly improve bugpoint output

Chris Lattner clattner at apple.com
Fri Jul 25 08:53:07 PDT 2008


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




More information about the llvm-dev mailing list