summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-01-01 17:37:07 +0000
committerDuncan Sands <baldrick@free.fr>2011-01-01 17:37:07 +0000
commit7f3a65662456d04e106f8ce18dcae8639f5d2784 (patch)
treeac743f1ce12dc7d6a8b8166f75ae54b446351e4a
parentf5897f8aa096af61f8aa6590830d402b7a7eaf1d (diff)
downloadbcm5719-llvm-7f3a65662456d04e106f8ce18dcae8639f5d2784.tar.gz
bcm5719-llvm-7f3a65662456d04e106f8ce18dcae8639f5d2784.zip
Correct a bunch of mistakes which meant that the example pass didn't
even compile, let alone work. llvm-svn: 122657
-rw-r--r--llvm/docs/WritingAnLLVMPass.html16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/docs/WritingAnLLVMPass.html b/llvm/docs/WritingAnLLVMPass.html
index ae8b8d5bfad..d0aeeec1fc1 100644
--- a/llvm/docs/WritingAnLLVMPass.html
+++ b/llvm/docs/WritingAnLLVMPass.html
@@ -273,7 +273,7 @@ time.</p>
<div class="doc_code"><pre>
static char ID;
- Hello() : FunctionPass(&amp;ID) {}
+ Hello() : FunctionPass(ID) {}
</pre></div><p>
<p> This declares pass identifier used by LLVM to identify pass. This allows LLVM to
@@ -301,7 +301,7 @@ function.</p>
initialization value is not important.</p>
<div class="doc_code"><pre>
- INITIALIZE_PASS(Hello, "<i>hello</i>", "<i>Hello World Pass</i>",
+ static RegisterPass<Hello> X("<i>hello</i>", "<i>Hello World Pass</i>",
false /* Only looks at CFG */,
false /* Analysis Pass */);
} <i>// end of anonymous namespace</i>
@@ -328,7 +328,7 @@ is supplied as fourth argument. </p>
<b>struct Hello</b> : <b>public</b> <a href="#FunctionPass">FunctionPass</a> {
static char ID;
- Hello() : FunctionPass(&amp;ID) {}
+ Hello() : FunctionPass(ID) {}
<b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &amp;F) {
errs() &lt;&lt; "<i>Hello: </i>" &lt;&lt; F.getName() &lt;&lt; "\n";
@@ -337,7 +337,7 @@ is supplied as fourth argument. </p>
};
char Hello::ID = 0;
- INITIALIZE_PASS(Hello, "<i>Hello</i>", "<i>Hello World Pass</i>", false, false);
+ static RegisterPass<Hello> X("hello", "Hello World Pass", false, false);
}
</pre></div>
@@ -361,7 +361,7 @@ them) to be useful.</p>
<p>Now that you have a brand new shiny shared object file, we can use the
<tt>opt</tt> command to run an LLVM program through your pass. Because you
-registered your pass with the <tt>INITIALIZE_PASS</tt> macro, you will be able to
+registered your pass with <tt>RegisterPass</tt>, you will be able to
use the <tt>opt</tt> tool to access it, once loaded.</p>
<p>To test it, follow the example at the end of the <a
@@ -1057,10 +1057,10 @@ remember, you may not modify the LLVM <tt>Function</tt> or its contents from a
pass registration works, and discussed some of the reasons that it is used and
what it does. Here we discuss how and why passes are registered.</p>
-<p>As we saw above, passes are registered with the <b><tt>INITIALIZE_PASS</tt></b>
-macro. The first parameter is the name of the pass that is to be used on
+<p>As we saw above, passes are registered with the <b><tt>RegisterPass</tt></b>
+template. The template parameter is the name of the pass that is to be used on
the command line to specify that the pass should be added to a program (for
-example, with <tt>opt</tt> or <tt>bugpoint</tt>). The second argument is the
+example, with <tt>opt</tt> or <tt>bugpoint</tt>). The first argument is the
name of the pass, which is to be used for the <tt>-help</tt> output of
programs, as
well as for debug output generated by the <tt>--debug-pass</tt> option.</p>
OpenPOWER on IntegriCloud