</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
&)</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
&)</tt> method</a></li>
</ul></li>
<li><a href="#FunctionPass">The <tt>FunctionPass</tt> class</a>
<div class="doc_code"><pre>
<b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &F) {
- std::cerr << "<i>Hello: </i>" << F.getName() << "\n";
+ llvm::cerr << "<i>Hello: </i>" << F.getName() << "\n";
<b>return false</b>;
}
}; <i>// end of struct Hello</i>
<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 &F) {
- std::cerr << "<i>Hello: </i>" << F.getName() << "\n";
+ llvm::cerr << "<i>Hello: </i>" << F.getName() << "\n";
<b>return false</b>;
}
};
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
- <a name="doInitialization_scc">The <tt>doInitialization(Module &)</tt>
+ <a name="doInitialization_scc">The <tt>doInitialization(CallGraph &)</tt>
method</a>
</div>
<div class="doc_text">
<div class="doc_code"><pre>
- <b>virtual bool</b> doInitialization(Module &M);
+ <b>virtual bool</b> doInitialization(CallGraph &CG);
</pre></div>
<p>The <tt>doIninitialize</tt> method is allowed to do most of the things that
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
- <a name="doFinalization_scc">The <tt>doFinalization(Module
+ <a name="doFinalization_scc">The <tt>doFinalization(CallGraph
&)</tt> method</a>
</div>
<div class="doc_text">
<div class="doc_code"><pre>
- <b>virtual bool</b> doFinalization(Module &M);
+ <b>virtual bool</b> doFinalization(CallGraph &CG);
</pre></div>
<p>The <tt>doFinalization</tt> method is an infrequently used method that is
<div class="doc_text">
<div class="doc_code"><pre>
- <b>virtual void</b> print(std::ostream &O, <b>const</b> Module *M) <b>const</b>;
+ <b>virtual void</b> print(llvm::OStream &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
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
B("<i>somefancyaa</i>", "<i>A more complex alias analysis implementation</i>");
//<i> Declare that we implement the AliasAnalysis interface</i>
- RegisterAnalysisGroup<<a href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>, FancyAA> C;
+ RegisterAnalysisGroup<<a href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>> C(B);
}
</pre></div>
D("<i>basicaa</i>", "<i>Basic Alias Analysis (default AA impl)</i>");
//<i> Declare that we implement the AliasAnalysis interface</i>
- RegisterAnalysisGroup<<a href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>, <a href="http://llvm.org/doxygen/structBasicAliasAnalysis.html">BasicAliasAnalysis</a>, <b>true</b>> E;
+ RegisterAnalysisGroup<<a href="http://llvm.org/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>, <b>true</b>> E(D);
}
</pre></div>
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]