Inherit BasicBlockPass directly from Pass.
[oota-llvm.git] / docs / WritingAnLLVMPass.html
index d30960d39f09ea9edfe6dd951694273e1c85c349..a31703aa59410931ea7af6208fe7935560b19a30 100644 (file)
         </ul></li>
      <li><a href="#CallGraphSCCPass">The <tt>CallGraphSCCPass</tt> class</a>
         <ul>
-        <li><a href="#doInitialization_scc">The <tt>doInitialization(Module
+        <li><a href="#doInitialization_scc">The <tt>doInitialization(CallGraph
                                            &amp;)</tt> method</a></li>
         <li><a href="#runOnSCC">The <tt>runOnSCC</tt> method</a></li>
-        <li><a href="#doFinalization_scc">The <tt>doFinalization(Module
+        <li><a href="#doFinalization_scc">The <tt>doFinalization(CallGraph
                                            &amp;)</tt> method</a></li>
         </ul></li>
      <li><a href="#FunctionPass">The <tt>FunctionPass</tt> class</a>
@@ -257,7 +257,7 @@ time.</p>
 
 <div class="doc_code"><pre>
     <b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &amp;F) {
-      std::cerr &lt;&lt; "<i>Hello: </i>" &lt;&lt; F.getName() &lt;&lt; "\n";
+      llvm::cerr &lt;&lt; "<i>Hello: </i>" &lt;&lt; F.getName() &lt;&lt; "\n";
       <b>return false</b>;
     }
   };  <i>// end of struct Hello</i>
@@ -289,7 +289,7 @@ argument "<tt>hello</tt>", and a name "<tt>Hello World Pass</tt>".</p>
 <b>namespace</b> {
   <b>struct Hello</b> : <b>public</b> <a href="#FunctionPass">FunctionPass</a> {
     <b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &amp;F) {
-      std::cerr &lt;&lt; "<i>Hello: </i>" &lt;&lt; F.getName() &lt;&lt; "\n";
+      llvm::cerr &lt;&lt; "<i>Hello: </i>" &lt;&lt; F.getName() &lt;&lt; "\n";
       <b>return false</b>;
     }
   };
@@ -534,14 +534,14 @@ false if they didn't.</p>
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="doInitialization_scc">The <tt>doInitialization(Module &amp;)</tt>
+  <a name="doInitialization_scc">The <tt>doInitialization(CallGraph &amp;)</tt>
   method</a>
 </div>
 
 <div class="doc_text">
 
 <div class="doc_code"><pre>
-  <b>virtual bool</b> doInitialization(Module &amp;M);
+  <b>virtual bool</b> doInitialization(CallGraph &amp;CG);
 </pre></div>
 
 <p>The <tt>doIninitialize</tt> method is allowed to do most of the things that
@@ -573,14 +573,14 @@ otherwise.</p>
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="doFinalization_scc">The <tt>doFinalization(Module
+  <a name="doFinalization_scc">The <tt>doFinalization(CallGraph
    &amp;)</tt> method</a>
 </div>
 
 <div class="doc_text">
 
 <div class="doc_code"><pre>
-  <b>virtual bool</b> doFinalization(Module &amp;M);
+  <b>virtual bool</b> doFinalization(CallGraph &amp;CG);
 </pre></div>
 
 <p>The <tt>doFinalization</tt> method is an infrequently used method that is
@@ -863,7 +863,7 @@ implement the virtual <tt>print</tt> method:</p>
 <div class="doc_text">
 
 <div class="doc_code"><pre>
-  <b>virtual void</b> print(std::ostream &amp;O, <b>const</b> Module *M) <b>const</b>;
+  <b>virtual void</b> print(llvm::OStream &amp;O, <b>const</b> Module *M) <b>const</b>;
 </pre></div>
 
 <p>The <tt>print</tt> method must be implemented by "analyses" in order to print
@@ -871,7 +871,7 @@ a human readable version of the analysis results.  This is useful for debugging
 an analysis itself, as well as for other people to figure out how an analysis
 works.  Use the <tt>opt -analyze</tt> argument to invoke this method.</p>
 
-<p>The <tt>ostream</tt> parameter specifies the stream to write the results on,
+<p>The <tt>llvm::OStream</tt> parameter specifies the stream to write the results on,
 and the <tt>Module</tt> parameter gives a pointer to the top level module of the
 program that has been analyzed.  Note however that this pointer may be null in
 certain circumstances (such as calling the <tt>Pass::dump()</tt> from a
@@ -1593,7 +1593,7 @@ object.  The most foolproof way of doing this is to set a breakpoint in
 want:</p>
 
 <div class="doc_code"><pre>
-(gdb) <b>break PassManager::run</b>
+(gdb) <b>break llvm::PassManager::run</b>
 Breakpoint 1 at 0x2413bc: file Pass.cpp, line 70.
 (gdb) <b>run test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]</b>
 Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]