3 <!-- This HTML file has been created by texi2html 1.54
4 from suif1.texi on 28 April 1999 -->
6 <TITLE>The SUIF Version
1 Library - Finding Exposed References
</TITLE>
7 <link href=
"suif1_87.html" rel=Next
>
8 <link href=
"suif1_85.html" rel=Previous
>
9 <link href=
"suif1_toc.html" rel=ToC
>
13 <p>Go to the
<A HREF=
"suif1_1.html">first
</A>,
<A HREF=
"suif1_85.html">previous
</A>,
<A HREF=
"suif1_87.html">next
</A>,
<A HREF=
"suif1_113.html">last
</A> section,
<A HREF=
"suif1_toc.html">table of contents
</A>.
17 <H2><A NAME=
"SEC86" HREF=
"suif1_toc.html#TOC86">Finding Exposed References
</A></H2>
25 The first step in the cloning process is to scan through the code being
26 copied to search for references to objects that are not visible in the
27 destination scope. The
<CODE>tree_node_list
</CODE>,
<CODE>tree_node
</CODE>,
28 <CODE>operand
</CODE>,
<CODE>instruction
</CODE>, and
<CODE>block_symtab
</CODE> classes have
29 <CODE>find_exposed_refs
</CODE> methods to perform this operation. The results
30 are returned in a
<CODE>replacements
</CODE> structure by putting the exposed
31 references in the lists of original objects. The lists of new objects
37 Besides checking for exposed references in the objects themselves, the
38 <CODE>find_exposed_refs
</CODE> methods also check for references contained in
39 annotations attached to the objects. Both flat and structured
40 annotations are checked, but unregistered annotations are ignored since
41 they are not copied. The
<CODE>find_annote_refs
</CODE> method is used to
42 check a
<CODE>suif_object
</CODE> for exposed references.
46 Label symbols are a special case. Even if a label symbol is visible in
47 the destination scope, it must be replaced if the label instruction is
48 to be cloned. Otherwise, there would be two label instructions sharing
49 the same label symbol! Thus, the
<CODE>find_exposed_refs
</CODE> method adds
50 the symbol in a label instruction to the list of exposed references.
51 The exception to this is that label symbols that are defined within
52 cloned symbol tables will automatically be replaced and are not included
53 in the exposed references.
58 <p>Go to the
<A HREF=
"suif1_1.html">first
</A>,
<A HREF=
"suif1_85.html">previous
</A>,
<A HREF=
"suif1_87.html">next
</A>,
<A HREF=
"suif1_113.html">last
</A> section,
<A HREF=
"suif1_toc.html">table of contents
</A>.