[llvm-commits] CVS: llvm/docs/ProgrammersManual.html
Brian Gaeke
gaeke at cs.uiuc.edu
Fri Nov 7 13:26:01 PST 2003
Changes in directory llvm/docs:
ProgrammersManual.html updated: 1.48 -> 1.49
---
Log message:
Mention class CallSite
---
Diffs of the changes: (+28 -1)
Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.48 llvm/docs/ProgrammersManual.html:1.49
--- llvm/docs/ProgrammersManual.html:1.48 Mon Oct 27 12:18:16 2003
+++ llvm/docs/ProgrammersManual.html Fri Nov 7 13:25:45 2003
@@ -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 & use-def
chains</a>
</ul>
@@ -742,6 +744,31 @@
};
</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 &
use-def chains</h4><ul>
@@ -1791,6 +1818,6 @@
<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>
More information about the llvm-commits
mailing list