From 633ad4ee178dad542cbd0a718aa0d8e1d57ad820 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 8 Sep 2009 05:14:44 +0000 Subject: [PATCH] update this to use raw_ostream llvm-svn: 81188 --- llvm/docs/WritingAnLLVMPass.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/llvm/docs/WritingAnLLVMPass.html b/llvm/docs/WritingAnLLVMPass.html index ed6b4d662a1b..f715a961a0f5 100644 --- a/llvm/docs/WritingAnLLVMPass.html +++ b/llvm/docs/WritingAnLLVMPass.html @@ -223,12 +223,14 @@ Start out with:

 #include "llvm/Pass.h"
 #include "llvm/Function.h"
+#include "llvm/Support/raw_ostream.h"
 

Which are needed because we are writing a Pass, and +href="http://llvm.org/doxygen/classllvm_1_1Pass.html">Pass, we are operating on Function's.

+href="http://llvm.org/doxygen/classllvm_1_1Function.html">Function's, +and we will be doing some printing.

Next we have:

@@ -273,7 +275,7 @@ avoid using expensive C++ runtime information.

     virtual bool runOnFunction(Function &F) {
-      llvm::cerr << "Hello: " << F.getName() << "\n";
+      errs() << "Hello: " << F.getName() << "\n";
       return false;
     }
   };  // end of struct Hello
@@ -312,6 +314,7 @@ is supplied as fourth argument. 

 #include "llvm/Pass.h"
 #include "llvm/Function.h"
+#include "llvm/Support/raw_ostream.h"
 
 using namespace llvm;
 
@@ -322,7 +325,7 @@ is supplied as fourth argument. 

Hello() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { - llvm::cerr << "Hello: " << F.getName() << "\n"; + errs() << "Hello: " << F.getName() << "\n"; return false; } };