mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Mention class CallSite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9783 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -49,6 +49,8 @@
|
|||||||
pointer</a>
|
pointer</a>
|
||||||
<li><a href="#iterate_complex">Finding call sites: a more complex
|
<li><a href="#iterate_complex">Finding call sites: a more complex
|
||||||
example</a>
|
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
|
<li><a href="#iterate_chains">Iterating over def-use & use-def
|
||||||
chains</a>
|
chains</a>
|
||||||
</ul>
|
</ul>
|
||||||
@ -742,6 +744,31 @@ class OurFunctionPass : public FunctionPass {
|
|||||||
};
|
};
|
||||||
</pre>
|
</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 &
|
</ul><h4><a name="iterate_chains"><hr size=0>Iterating over def-use &
|
||||||
use-def chains</h4><ul>
|
use-def chains</h4><ul>
|
||||||
@ -1791,6 +1818,6 @@ pointer to the parent Function.
|
|||||||
<br>
|
<br>
|
||||||
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
|
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
|
||||||
<!-- hhmts start -->
|
<!-- hhmts start -->
|
||||||
Last modified: Mon Oct 27 12:00:00 CDT 2003
|
Last modified: Fri Nov 7 13:24:22 CST 2003
|
||||||
<!-- hhmts end -->
|
<!-- hhmts end -->
|
||||||
</font></body></html>
|
</font></body></html>
|
||||||
|
Reference in New Issue
Block a user