Tutorial 1: casting cout

To get Tutorial 1 to compile, I had to cast cout as a raw_osstream, as in:

PM.add(createPrintModulePass(&llvm::cout));

---->

PM.add(createPrintModulePass((raw_ostream*)&llvm::cout));

I was getting the following error:

$ c++ -g tut1.cpp `llvm-config --cxxflags --ldflags --libs core` -o tut1
tut1.cpp: In function ‘int main(int, char**)’:
tut1.cpp:19: error: cannot convert ‘llvm::OStream*’ to
‘llvm::raw_ostream*’ for argument ‘1’ to ‘llvm::ModulePass*
llvm::createPrintModulePass(llvm::raw_ostream*, bool)’

Anyway, just wanted to mark the record in case this is a bug in the
tutorial or an inconsistency with the revision of llvm I am running
(71457). Still, it is likely that the error is a result of me
overlooking something.

Fixed. Thanks! :slight_smile:

-bw