Mention class CallSite
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 7 Nov 2003 19:25:45 +0000 (19:25 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 7 Nov 2003 19:25:45 +0000 (19:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9783 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ProgrammersManual.html

index 61fc213190b912d66393cb92a7a2815ae7accb3f..8aeec6ea2ba26e51c829d31e3b76ec445b0daaae 100644 (file)
@@ -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>