diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-07 19:25:45 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2003-11-07 19:25:45 +0000 |
commit | f578c05d5783e7394e7f781fb6c219f3b0ffdf77 (patch) | |
tree | 9ee5473c03f18c512435c9f9d8695beaf95c159a /llvm/docs/ProgrammersManual.html | |
parent | a730103518c94b0a519e30db5493c48de0d08a7f (diff) | |
download | bcm5719-llvm-f578c05d5783e7394e7f781fb6c219f3b0ffdf77.tar.gz bcm5719-llvm-f578c05d5783e7394e7f781fb6c219f3b0ffdf77.zip |
Mention class CallSite
llvm-svn: 9783
Diffstat (limited to 'llvm/docs/ProgrammersManual.html')
-rw-r--r-- | llvm/docs/ProgrammersManual.html | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html index 61fc213190b..8aeec6ea2ba 100644 --- a/llvm/docs/ProgrammersManual.html +++ b/llvm/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 & 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 & 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> |