[LLVMdev] #include <iostream>

Vladimir Prus ghost at cs.msu.su
Thu Dec 7 22:57:35 PST 2006


Bill Wendling wrote:

> Hi all,
> 
> With the newest patches to LLVM, there should be no reason for having
> "#include <iostream>" in any library source code file, except for lib/
> Support/Streams.cpp. Please use the following instead:
> 
> OLD                NEW
> ---                ---
> std::ostream       llvm::OStream
> std::istream       llvm::IStream
> std::cerr          llvm::cerr
> std::cerr          llvm::cout
> std::cin           llvm::cin
> DEBUG(std::cerr    DOUT
> 
> If you have something like this:
> 
> void print(std::ostream& O);
> 
> You can pass the LLVM streams in like this:
> 
> print(*cerr.stream());
> 
> Or you can change the print() method to take an llvm ostream:
> 
> void print(llvm::OStream& O);
> 
> print(cerr);

And what is the actual measured effect on compile time and run time?

Just curious,
Volodya





More information about the llvm-dev mailing list