summaryrefslogtreecommitdiff
path: root/docs/ProgrammersManual.html
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-11-07 19:25:45 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-11-07 19:25:45 +0000
commitf1972c6aa2629d64edff0baba84a00d171557bdc (patch)
tree390b0607673e7ae3ff8c3a5c838f50c2297c1ee1 /docs/ProgrammersManual.html
parent4ba0f57904613bb2ea0d7f0a8ff6a0c04647044d (diff)
downloadllvm-f1972c6aa2629d64edff0baba84a00d171557bdc.tar.gz
llvm-f1972c6aa2629d64edff0baba84a00d171557bdc.tar.bz2
llvm-f1972c6aa2629d64edff0baba84a00d171557bdc.tar.xz
Mention class CallSite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ProgrammersManual.html')
-rw-r--r--docs/ProgrammersManual.html29
1 files changed, 28 insertions, 1 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index 61fc213190..8aeec6ea2b 100644
--- a/docs/ProgrammersManual.html
+++ b/docs/ProgrammersManual.html
@@ -49,6 +49,8 @@
pointer</a>
<li><a href="#iterate_complex">Finding call sites: a more complex
example</a>
+ <li><a href="#calls_and_invokes">Treating calls and invokes the
+ same way</a>
<li><a href="#iterate_chains">Iterating over def-use &amp; use-def
chains</a>
</ul>
@@ -742,6 +744,31 @@ class OurFunctionPass : public FunctionPass {
};
</pre>
+
+<!--_______________________________________________________________________-->
+</ul><h4><a name="calls_and_invokes"><hr size=0>Treating calls and
+invokes the same way</h4><ul>
+
+<p>You may have noticed that the previous example was a bit
+oversimplified in that it did not deal with call sites generated by
+'invoke' instructions. In this, and in other situations, you may find
+that you want to treat <tt>CallInst</tt>s and <tt>InvokeInst</tt>s the
+same way, even though their most-specific common base class is
+<tt>Instruction</tt>, which includes lots of less closely-related
+things. For these cases, LLVM provides a handy wrapper class called <a
+href="http://llvm.cs.uiuc.edu/doxygen/classCallSite.html"><tt>CallSite
+</tt></a>. It is essentially a wrapper around an <tt>Instruction</tt>
+pointer, with some methods that provide functionality common to
+<tt>CallInst</tt>s and <tt>InvokeInst</tt>s.</p>
+
+<p>This class is supposed to have "value semantics". So it should be
+passed by value, not by reference; it should not be dynamically
+allocated or deallocated using <tt>operator new</tt> or <tt>operator
+delete</tt>. It is efficiently copyable, assignable and constructable,
+with costs equivalents to that of a bare pointer. (You will notice, if
+you look at its definition, that it has only a single data member.)</p>
+
+
<!--_______________________________________________________________________-->
</ul><h4><a name="iterate_chains"><hr size=0>Iterating over def-use &amp;
use-def chains</h4><ul>
@@ -1791,6 +1818,6 @@ pointer to the parent Function.
<br>
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
<!-- hhmts start -->
-Last modified: Mon Oct 27 12:00:00 CDT 2003
+Last modified: Fri Nov 7 13:24:22 CST 2003
<!-- hhmts end -->
</font></body></html>