summaryrefslogtreecommitdiff
path: root/cil/doc/api/Cil.cilVisitor.html
blob: f8c6496371c9125ffbe8b555535ecc241b6af39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="Start" href="index.html">
<link rel="next" href="Cil.cilPrinter.html">
<link rel="Up" href="Cil.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Pretty" rel="Chapter" href="Pretty.html">
<link title="Errormsg" rel="Chapter" href="Errormsg.html">
<link title="Clist" rel="Chapter" href="Clist.html">
<link title="Stats" rel="Chapter" href="Stats.html">
<link title="Cil" rel="Chapter" href="Cil.html">
<link title="Formatcil" rel="Chapter" href="Formatcil.html">
<link title="Alpha" rel="Chapter" href="Alpha.html">
<link title="Cillower" rel="Chapter" href="Cillower.html">
<link title="Cfg" rel="Chapter" href="Cfg.html">
<link title="Dataflow" rel="Chapter" href="Dataflow.html">
<link title="Dominators" rel="Chapter" href="Dominators.html"><title>CIL API Documentation (version 1.3.5) : Cil.cilVisitor</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="Cil.html">Up</a>
&nbsp;<a href="Cil.cilPrinter.html">Next</a>
</div>
<center><h1>Class type <a href="type_Cil.cilVisitor.html">Cil.cilVisitor</a></h1></center>
<br>
<pre><span class="keyword">class type</span> <a name="TYPEcilVisitor"></a>cilVisitor = <code class="code">object</code> <a href="Cil.cilVisitor.html">..</a> <code class="code">end</code></pre>A visitor interface for traversing CIL trees. Create instantiations of 
 this type by specializing the class <a href="Cil.nopCilVisitor.html"><code class="code">Cil.nopCilVisitor</code></a>. Each of the 
 specialized visiting functions can also call the <code class="code">queueInstr</code> to specify 
 that some instructions should be inserted before the current instruction 
 or statement. Use syntax like <code class="code">self#queueInstr</code> to call a method
 associated with the current object.<br>
<hr width="100%">
<pre><span class="keyword">method</span> <a name="METHODvvdec"></a>vvdec : <code class="type"><a href="Cil.html#TYPEvarinfo">varinfo</a> -> <a href="Cil.html#TYPEvarinfo">varinfo</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Invoked for each variable declaration. The subtrees to be traversed 
 are those corresponding to the type and attributes of the variable. 
 Note that variable declarations are all the <code class="code">GVar</code>, <code class="code">GVarDecl</code>, <code class="code">GFun</code>, 
 all the <code class="code">varinfo</code> in formals of function types, and the formals and 
 locals for function definitions. This means that the list of formals 
 in a function definition will be traversed twice, once as part of the 
 function type and second as part of the formals in a function 
 definition.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvvrbl"></a>vvrbl : <code class="type"><a href="Cil.html#TYPEvarinfo">varinfo</a> -> <a href="Cil.html#TYPEvarinfo">varinfo</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Invoked on each variable use. Here only the <code class="code">SkipChildren</code> and 
 <code class="code">ChangeTo</code> actions make sense since there are no subtrees. Note that 
 the type and attributes of the variable are not traversed for a 
 variable use<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvexpr"></a>vexpr : <code class="type"><a href="Cil.html#TYPEexp">exp</a> -> <a href="Cil.html#TYPEexp">exp</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Invoked on each expression occurrence. The subtrees are the 
 subexpressions, the types (for a <code class="code">Cast</code> or <code class="code">SizeOf</code> expression) or the 
 variable use.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvlval"></a>vlval : <code class="type"><a href="Cil.html#TYPElval">lval</a> -> <a href="Cil.html#TYPElval">lval</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Invoked on each lvalue occurrence<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvoffs"></a>voffs : <code class="type"><a href="Cil.html#TYPEoffset">offset</a> -> <a href="Cil.html#TYPEoffset">offset</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Invoked on each offset occurrence that is *not* as part
 of an initializer list specification, i.e. in an lval or
 recursively inside an offset.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvinitoffs"></a>vinitoffs : <code class="type"><a href="Cil.html#TYPEoffset">offset</a> -> <a href="Cil.html#TYPEoffset">offset</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Invoked on each offset appearing in the list of a 
 CompoundInit initializer.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvinst"></a>vinst : <code class="type"><a href="Cil.html#TYPEinstr">instr</a> -> <a href="Cil.html#TYPEinstr">instr</a> list <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Invoked on each instruction occurrence. The <code class="code">ChangeTo</code> action can
 replace this instruction with a list of instructions<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvstmt"></a>vstmt : <code class="type"><a href="Cil.html#TYPEstmt">stmt</a> -> <a href="Cil.html#TYPEstmt">stmt</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Control-flow statement. The default <code class="code">DoChildren</code> action does not 
 create a new statement when the components change. Instead it updates 
 the contents of the original statement. This is done to preserve the 
 sharing with <code class="code">Goto</code> and <code class="code">Case</code> statements that point to the original 
 statement. If you use the <code class="code">ChangeTo</code> action then you should take care 
 of preserving that sharing yourself.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvblock"></a>vblock : <code class="type"><a href="Cil.html#TYPEblock">block</a> -> <a href="Cil.html#TYPEblock">block</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Block.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvfunc"></a>vfunc : <code class="type"><a href="Cil.html#TYPEfundec">fundec</a> -> <a href="Cil.html#TYPEfundec">fundec</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Function definition. 
                                                    Replaced in place.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvglob"></a>vglob : <code class="type"><a href="Cil.html#TYPEglobal">global</a> -> <a href="Cil.html#TYPEglobal">global</a> list <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Global (vars, types,
                                                      etc.)<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvinit"></a>vinit : <code class="type"><a href="Cil.html#TYPEinit">init</a> -> <a href="Cil.html#TYPEinit">init</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Initializers for globals<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvtype"></a>vtype : <code class="type"><a href="Cil.html#TYPEtyp">typ</a> -> <a href="Cil.html#TYPEtyp">typ</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Use of some type. Note 
 that for structure/union 
 and enumeration types the 
 definition of the 
 composite type is not 
 visited. Use <code class="code">vglob</code> to 
 visit it.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvattr"></a>vattr : <code class="type"><a href="Cil.html#TYPEattribute">attribute</a> -> <a href="Cil.html#TYPEattribute">attribute</a> list <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Attribute. Each attribute can be replaced by a list<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODvattrparam"></a>vattrparam : <code class="type"><a href="Cil.html#TYPEattrparam">attrparam</a> -> <a href="Cil.html#TYPEattrparam">attrparam</a> <a href="Cil.html#TYPEvisitAction">visitAction</a></code></pre><div class="info">
Attribute parameters.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODqueueInstr"></a>queueInstr : <code class="type"><a href="Cil.html#TYPEinstr">instr</a> list -> unit</code></pre><div class="info">
Add here instructions while visiting to queue them to preceede the 
 current statement or instruction being processed. Use this method only 
 when you are visiting an expression that is inside a function body, or 
 a statement, because otherwise there will no place for the visitor to 
 place your instructions.<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODunqueueInstr"></a>unqueueInstr : <code class="type">unit -> <a href="Cil.html#TYPEinstr">instr</a> list</code></pre><div class="info">
Gets the queue of instructions and resets the queue. This is done 
 automatically for you when you visit statments.<br>
</div>
</body></html>