diff --git a/docs/WritingAnLLVMPass.html b/docs/WritingAnLLVMPass.html index ed6b4d662a1..f715a961a0f 100644 --- a/docs/WritingAnLLVMPass.html +++ b/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; } };