blob: f08123f0af4a67794b480a16c7d2810afd6b5ae6 [file] [log] [blame]
Chris Lattner9355b472002-09-06 02:50:58 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><title>LLVM Programmer's Manual</title></head>
3
4<body bgcolor=white>
5
Chris Lattner9355b472002-09-06 02:50:58 +00006<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
7<tr><td>&nbsp; <font size=+3 color="#EEEEFF" face="Georgia,Palatino,Times,Roman"><b>LLVM Programmer's Manual</b></font></td>
8</tr></table>
9
10<ol>
11 <li><a href="#introduction">Introduction</a>
12 <li><a href="#general">General Information</a>
13 <ul>
14 <li><a href="#stl">The C++ Standard Template Library</a>
15 <li>The isa&lt;&gt;, cast&lt;&gt; and dyn_cast&lt;&gt; templates
16 </ul>
Chris Lattnera30ed382002-09-06 16:33:54 +000017 <li><a href="#coreclasses">The Core LLVM Class Heirarchy Reference</a>
Chris Lattner9355b472002-09-06 02:50:58 +000018 <ul>
19 <li><a href="#Value">The <tt>Value</tt> class</a>
20 <ul>
21 <li><a href="#User">The <tt>User</tt> class</a>
22 <ul>
23 <li><a href="#Instruction">The <tt>Instruction</tt> class</a>
24 <ul>
25 <li>
26 <li>
27 </ul>
28 <li><a href="#GlobalValue">The <tt>GlobalValue</tt> class</a>
29 <ul>
30 <li><a href="#BasicBlock">The <tt>BasicBlock</tt> class</a>
31 <li><a href="#Function">The <tt>Function</tt> class</a>
32 <li><a href="#GlobalVariable">The <tt>GlobalVariable</tt> class</a>
33 </ul>
34 <li><a href="#Module">The <tt>Module</tt> class</a>
35 <li><a href="#Constant">The <tt>Constant</tt> class</a>
36 <ul>
37 <li>
38 <li>
39 </ul>
40 </ul>
41 <li><a href="#Type">The <tt>Type</tt> class</a>
42 <li><a href="#Argument">The <tt>Argument</tt> class</a>
43 </ul>
44 <li>The <tt>SymbolTable</tt> class
45 <li>The <tt>ilist</tt> and <tt>iplist</tt> classes
46 <ul>
47 <li>Creating, inserting, moving and deleting from LLVM lists
48 </ul>
49 <li>Important iterator invalidation semantics to be aware of
50 </ul>
51
52<!--
53III. Useful things to know about the LLVM source base:
54
55III.1 Useful links that introduce the STL
56III.2 isa<>, cast<>, dyn_cast<>
57III.3 Makefiles, useful options
58III.4 How to use opt & analyze to debug stuff
59III.5 How to write a regression test
60III.6 DEBUG() and Statistics (-debug & -stats)
61III.7 The -time-passes option
62III.8 ... more as needed ...
63
64-->
65
66 <p><b>Written by <a href="mailto:dhurjati@cs.uiuc.edu">Dinakar Dhurjati</a>
67 and <a href="mailto:sabre@nondot.org">Chris Lattner</a></b><p>
68</ol>
69
70
71<!-- *********************************************************************** -->
72<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
73<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
74<a name="introduction">Introduction
75</b></font></td></tr></table><ul>
76<!-- *********************************************************************** -->
77
78This document is meant to hi-light some of the important classes and interfaces
79available in the LLVM source-base. This manual is not indended to explain what
80LLVM is, how it works, and what LLVM code looks like. It assumes that you know
81the basics of LLVM and are interested in writing transformations or otherwise
82analyzing or manipulating the code.<p>
83
84This document should get you oriented so that you can find your way in the
85continuously growing source code that makes up the LLVM infrastructure. Note
86that this manual is not intended to serve as a replacement for reading the
87source code, so if you think there should be a method in one of these classes to
88do something, but it's not listed, check the source. Links to the <a
89href="/doxygen/">doxygen</a> sources are provided to make this as easy as
90possible.<p>
91
92The first section of this document describes general information that is useful
93to know when working in the LLVM infrastructure, and the second describes the
94Core LLVM classes. In the future this manual will be extended with information
95describing how to use extension libraries, such as dominator information, CFG
96traversal routines, and useful utilities like the <tt><a
97href="/doxygen/InstVisitor_8h-source.html">InstVisitor</a></tt> template.<p>
98
99
100<!-- *********************************************************************** -->
101</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
102<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
103<a name="general">General Information
104</b></font></td></tr></table><ul>
105<!-- *********************************************************************** -->
106
107This section contains general information that is useful if you are working in
108the LLVM source-base, but that isn't specific to any particular API.<p>
109
110
111<!-- ======================================================================= -->
112</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
113<tr><td>&nbsp;</td><td width="100%">&nbsp;
114<font color="#EEEEFF" face="Georgia,Palatino"><b>
115<a name="stl">The C++ Standard Template Library</a>
116</b></font></td></tr></table><ul>
117
118LLVM makes heavy use of the C++ Standard Template Library (STL), perhaps much
119more than you are used to, or have seen before. Because of this, you might want
120to do a little background reading in the techniques used and capabilities of the
121library. There are many good pages that discuss the STL, and several books on
122the subject that you can get, so it will not be discussed in this document.<p>
123
124Here are some useful links:<p>
125<ol>
126<li><a href="http://www.dinkumware.com/htm_cpl/index.html">Dinkumware C++
127Library reference</a> - an excellent reference for the STL and other parts of
128the standard C++ library.<br>
129
130<li><a href="http://www.parashift.com/c++-faq-lite/">C++ Frequently Asked
131Questions</a>
132
133<li><a href="http://www.sgi.com/tech/stl/">SGI's STL Programmer's Guide</a> -
134Contains a useful <a
135href="http://www.sgi.com/tech/stl/stl_introduction.html">Introduction to the
136STL</a>.
137
138<li><a href="http://www.research.att.com/~bs/C++.html">Bjarne Stroustrup's C++
139Page</a>
140
141</ol><p>
142
143You are also encouraged to take a look at the <a
144href="CodingStandards.html">LLVM Coding Standards</a> guide which focuses on how
145to write maintainable code more than where to put your curly braces.<p>
146
147
148
149<!-- *********************************************************************** -->
150</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
151<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
Chris Lattnera30ed382002-09-06 16:33:54 +0000152<a name="coreclasses">The Core LLVM Class Heirarchy Reference
Chris Lattner9355b472002-09-06 02:50:58 +0000153</b></font></td></tr></table><ul>
154<!-- *********************************************************************** -->
155
156The Core LLVM classes are the primary means of representing the program being
157inspected or transformed. The core LLVM classes are defined in header files in
158the <tt>include/llvm/</tt> directory, and implemented in the <tt>lib/VMCore</tt>
159directory.<p>
160
161
162<!-- ======================================================================= -->
163</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
164<tr><td>&nbsp;</td><td width="100%">&nbsp;
165<font color="#EEEEFF" face="Georgia,Palatino"><b>
166<a name="Value">The <tt>Value</tt> class</a>
167</b></font></td></tr></table><ul>
168
169<tt>#include "<a href="/doxygen/Value_8h-source.html">llvm/Value.h</a>"</tt></b><br>
170doxygen info: <a href="/doxygen/classValue.html">Value Class</a><p>
171
172
173The <tt>Value</tt> class is the most important class in LLVM Source base. It
174represents a typed value that may be used (among other things) as an operand to
175an instruction. There are many different types of <tt>Value</tt>s, such as <a
176href="#Constant"><tt>Constant</tt></a>s, <a
177href="#Argument"><tt>Argument</tt></a>s, and even <a
178href="#Instruction"><tt>Instruction</tt></a>s and <a
179href="#Function"><tt>Function</tt></a>s are <tt>Value</tt>s.<p>
180
181A particular <tt>Value</tt> may be used many times in the LLVM representation
182for a program. For example, an incoming argument to a function (represented
183with an instance of the <a href="#Argument">Argument</a> class) is "used" by
184every instruction in the function that references the argument. To keep track
185of this relationship, the <tt>Value</tt> class keeps a list of all of the <a
186href="#User"><tt>User</tt></a>s that is using it (the <a
187href="#User"><tt>User</tt></a> class is a base class for all nodes in the LLVM
188graph that can refer to <tt>Value</tt>s). This use list is how LLVM represents
189def-use information in the program, and is accessable through the <tt>use_</tt>*
190methods, shown below.<p>
191
192Because LLVM is a typed representation, every LLVM <tt>Value</tt> is typed, and
193this <a href="#Type">Type</a> is available through the <tt>getType()</tt>
194method. <a name="#nameWarning">In addition, all LLVM values can be named. The
195"name" of the <tt>Value</tt> is symbolic string printed in the LLVM code:<p>
196
197<pre>
198 %<b>foo</b> = add int 1, 2
199</pre>
200
201The name of this instruction is "foo". <b>NOTE</b> that the name of any value
202may be missing (an empty string), so names should <b>ONLY</b> be used for
203debugging (making the source code easier to read, debugging printouts), they
204should not be used to keep track of values or map between them. For this
205purpose, use a <tt>std::map</tt> of pointers to the <tt>Value</tt> itself
206instead.<p>
207
208One important aspect of LLVM is that there is no distinction between an SSA
209variable and the operation that produces it. Because of this, any reference to
210the value produced by an instruction (or the value available as an incoming
211argument, for example) is represented as a direct pointer to the class that
212represents this value. Although this may take some getting used to, it
213simplifies the representation and makes it easier to manipulate.<p>
214
215
216<!-- _______________________________________________________________________ -->
217</ul><h4><a name="m_Value"><hr size=0>Important Public Members of
218the <tt>Value</tt> class</h4><ul>
219
220<li><tt>Value::use_iterator</tt> - Typedef for iterator over the use-list<br>
221 <tt>Value::use_const_iterator</tt>
222 - Typedef for const_iterator over the use-list<br>
223 <tt>unsigned use_size()</tt> - Returns the number of users of the value.<br>
224 <tt>bool use_empty()</tt> - Returns true if there are no users.<br>
225 <tt>use_iterator use_begin()</tt>
226 - Get an iterator to the start of the use-list.<br>
227 <tt>use_iterator use_end()</tt>
228 - Get an iterator to the end of the use-list.<br>
229 <tt><a href="#User">User</a> *use_back()</tt>
230 - Returns the last element in the list.<p>
231
232These methods are the interface to access the def-use information in LLVM. As with all other iterators in LLVM, the naming conventions follow the conventions defined by the <a href="#stl">STL</a>.<p>
233
234<li><tt><a href="#Type">Type</a> *getType() const</tt><p>
235This method returns the Type of the Value.
236
237<li><tt>bool hasName() const</tt><br>
238 <tt>std::string getName() const</tt><br>
239 <tt>void setName(const std::string &amp;Name)</tt><p>
240
241This family of methods is used to access and assign a name to a <tt>Value</tt>,
242be aware of the <a href="#nameWarning">precaution above</a>.<p>
243
244
245<li><tt>void replaceAllUsesWith(Value *V)</tt><p>
246
247This method traverses the use list of a <tt>Value</tt> changing all <a
248href="#User"><tt>User</tt>'s</a> of the current value to refer to "<tt>V</tt>"
249instead. For example, if you detect that an instruction always produces a
250constant value (for example through constant folding), you can replace all uses
251of the instruction with the constant like this:<p>
252
253<pre>
254 Inst-&gt;replaceAllUsesWith(ConstVal);
255</pre><p>
256
257
258
259<!-- ======================================================================= -->
260</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
261<tr><td>&nbsp;</td><td width="100%">&nbsp;
262<font color="#EEEEFF" face="Georgia,Palatino"><b>
263<a name="User">The <tt>User</tt> class</a>
264</b></font></td></tr></table><ul>
265
266<tt>#include "<a href="/doxygen/User_8h-source.html">llvm/User.h</a>"</tt></b><br>
267doxygen info: <a href="/doxygen/classUser.html">User Class</a><br>
268Superclass: <a href="#Value"><tt>Value</tt></a><p>
269
270
271The <tt>User</tt> class is the common base class of all LLVM nodes that may
272refer to <a href="#Value"><tt>Value</tt></a>s. It exposes a list of "Operands"
273that are all of the <a href="#Value"><tt>Value</tt></a>s that the User is
274referring to. The <tt>User</tt> class itself is a subclass of
275<tt>Value</tt>.<p>
276
277The operands of a <tt>User</tt> point directly to the LLVM <a
278href="#Value"><tt>Value</tt></a> that it refers to. Because LLVM uses Static
279Single Assignment (SSA) form, there can only be one definition referred to,
280allowing this direct connection. This connection provides the use-def
281information in LLVM.<p>
282
283<!-- _______________________________________________________________________ -->
284</ul><h4><a name="m_User"><hr size=0>Important Public Members of
285the <tt>User</tt> class</h4><ul>
286
287The <tt>User</tt> class exposes the operand list in two ways: through an index
288access interface and through an iterator based interface.<p>
289
290<li><tt>Value *getOperand(unsigned i)</tt><br>
291 <tt>unsigned getNumOperands()</tt><p>
292
293These two methods expose the operands of the <tt>User</tt> in a convenient form
294for direct access.<p>
295
296<li><tt>User::op_iterator</tt> - Typedef for iterator over the operand list<br>
297 <tt>User::op_const_iterator</tt>
298 <tt>use_iterator op_begin()</tt>
299 - Get an iterator to the start of the operand list.<br>
300 <tt>use_iterator op_end()</tt>
301 - Get an iterator to the end of the operand list.<p>
302
303Together, these methods make up the iterator based interface to the operands of
304a <tt>User</tt>.<p>
305
306
307
308<!-- ======================================================================= -->
309</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
310<tr><td>&nbsp;</td><td width="100%">&nbsp;
311<font color="#EEEEFF" face="Georgia,Palatino"><b>
312<a name="Instruction">The <tt>Instruction</tt> class</a>
313</b></font></td></tr></table><ul>
314
315<tt>#include "<a
316href="/doxygen/Instruction_8h-source.html">llvm/Instruction.h</a>"</tt></b><br>
317doxygen info: <a href="/doxygen/classInstruction.html">Instruction Class</a><br>
318Superclasses: <a href="#User"><tt>User</tt></a>, <a
319href="#Value"><tt>Value</tt></a><p>
320
321The <tt>Instruction</tt> class is the common base class for all LLVM
322instructions. It provides only a few methods, but is a very commonly used
323class. The primary data tracked by the <tt>Instruction</tt> class itself is the
324opcode (instruction type) and the parent <a
325href="#BasicBlock"><tt>BasicBlock</tt></a> the <tt>Instruction</tt> is embedded
326into. To represent a specific type of instruction, one of many subclasses of
327<tt>Instruction</tt> are used.<p>
328
329Because the <tt>Instruction</tt> class subclasses the <a
330href="#User"><tt>User</tt></a> class, its operands can be accessed in the same
331way as for other <a href="#User"><tt>User</tt></a>s (with the
332<tt>getOperand()</tt>/<tt>getNumOperands()</tt> and
333<tt>op_begin()</tt>/<tt>op_end()</tt> methods).<p>
334
335
336<!-- _______________________________________________________________________ -->
337</ul><h4><a name="m_Instruction"><hr size=0>Important Public Members of
338the <tt>Instruction</tt> class</h4><ul>
339
340<li><tt><a href="#BasicBlock">BasicBlock</a> *getParent()</tt><p>
341
342Returns the <a href="#BasicBlock"><tt>BasicBlock</tt></a> that this
343<tt>Instruction</tt> is embedded into.<p>
344
345<li><tt>bool hasSideEffects()</tt><p>
346
347Returns true if the instruction has side effects, i.e. it is a <tt>call</tt>,
348<tt>free</tt>, <tt>invoke</tt>, or <tt>store</tt>.<p>
349
350<li><tt>unsigned getOpcode()</tt><p>
351
352Returns the opcode for the <tt>Instruction</tt>.<p>
353
354<!--
355
356\subsection{Subclasses of Instruction :}
357\begin{itemize}
358<li>BinaryOperator : This subclass of Instruction defines a general interface to the all the instructions involvong binary operators in LLVM.
359 \begin{itemize}
360 <li><tt>bool swapOperands()</tt>: Exchange the two operands to this instruction. If the instruction cannot be reversed (i.e. if it's a Div), it returns true.
361 \end{itemize}
362<li>TerminatorInst : This subclass of Instructions defines an interface for all instructions that can terminate a BasicBlock.
363 \begin{itemize}
364 <li> <tt>unsigned getNumSuccessors()</tt>: Returns the number of successors for this terminator instruction.
365 <li><tt>BasicBlock *getSuccessor(unsigned i)</tt>: As the name suggests returns the ith successor BasicBlock.
366 <li><tt>void setSuccessor(unsigned i, BasicBlock *B)</tt>: sets BasicBlock B as the ith succesor to this terminator instruction.
367 \end{itemize}
368
369<li>PHINode : This represents the PHI instructions in the SSA form.
370 \begin{itemize}
371 <li><tt> unsigned getNumIncomingValues()</tt>: Returns the number of incoming edges to this PHI node.
372 <li><tt> Value *getIncomingValue(unsigned i)</tt>: Returns the ith incoming Value.
373 <li><tt>void setIncomingValue(unsigned i, Value *V)</tt>: Sets the ith incoming Value as V
374 <li><tt>BasicBlock *getIncomingBlock(unsigned i)</tt>: Returns the Basic Block corresponding to the ith incoming Value.
375 <li><tt> void addIncoming(Value *D, BasicBlock *BB)</tt>:
376 Add an incoming value to the end of the PHI list
377 <li><tt> int getBasicBlockIndex(const BasicBlock *BB) const</tt>:
378 Returns the first index of the specified basic block in the value list for this PHI. Returns -1 if no instance.
379 \end{itemize}
380<li>CastInst : In LLVM all casts have to be done through explicit cast instructions. CastInst defines the interface to the cast instructions.
381<li>CallInst : This defines an interface to the call instruction in LLVM. ARguments to the function are nothing but operands of the instruction.
382 \begin{itemize}
383 <li>: <tt>Function *getCalledFunction()</tt>: Returns a handle to the function that is being called by this Function.
384 \end{itemize}
385<li>LoadInst, StoreInst, GetElemPtrInst : These subclasses represent load, store and getelementptr instructions in LLVM.
386 \begin{itemize}
387 <li><tt>Value * getPointerOperand ()</tt>: Returns the Pointer Operand which is typically the 0th operand.
388 \end{itemize}
389<li>BranchInst : This is a subclass of TerminatorInst and defines the interface for conditional and unconditional branches in LLVM.
390 \begin{itemize}
391 <li><tt>bool isConditional()</tt>: Returns true if the branch is a conditional branch else returns false
392 <li> <tt>Value *getCondition()</tt>: Returns the condition if it is a conditional branch else returns null.
393 <li> <tt>void setUnconditionalDest(BasicBlock *Dest)</tt>: Changes the current branch to an unconditional one targetting the specified block.
394 \end{itemize}
395
396\end{itemize}
397
398-->
399
400
401<!-- ======================================================================= -->
402</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
403<tr><td>&nbsp;</td><td width="100%">&nbsp;
404<font color="#EEEEFF" face="Georgia,Palatino"><b>
405<a name="BasicBlock">The <tt>BasicBlock</tt> class</a>
406</b></font></td></tr></table><ul>
407
408<tt>#include "<a
409href="/doxygen/BasicBlock_8h-source.html">llvm/BasicBlock.h</a>"</tt></b><br>
410doxygen info: <a href="/doxygen/classBasicBlock.html">BasicBlock Class</a><br>
411Superclass: <a href="#Value"><tt>Value</tt></a><p>
412
413
414This class represents a single entry multiple exit section of the code, commonly
415known as a basic block by the compiler community. The <tt>BasicBlock</tt> class
416maintains a list of <a href="#Instruction"><tt>Instruction</tt></a>s, which form
417the body of the block. Matching the language definition, the last element of
418this list of instructions is always a terminator instruction (a subclass of the
419<a href="#TerminatorInst"><tt>TerminatorInst</tt></a> class).<p>
420
421In addition to tracking the list of instructions that make up the block, the
422<tt>BasicBlock</tt> class also keeps track of the <a
423href="#Function"><tt>Function</tt></a> that it is embedded into.<p>
424
425Note that <tt>BasicBlock</tt>s themselves are <a
426href="#Value"><tt>Value</tt></a>s, because they are referenced by instructions
427like branches and can go in the switch tables. <tt>BasicBlock</tt>s have type
428<tt>label</tt>.<p>
429
430
431<!-- _______________________________________________________________________ -->
432</ul><h4><a name="m_BasicBlock"><hr size=0>Important Public Members of
433the <tt>BasicBlock</tt> class</h4><ul>
434
435<li><tt>BasicBlock(const std::string &amp;Name = "", <a
436href="#Function">Function</a> *Parent = 0)</tt><p>
437
438The <tt>BasicBlock</tt> constructor is used to create new basic blocks for
439insertion into a function. The constructor simply takes a name for the new
440block, and optionally a <a href="#Function"><tt>Function</tt></a> to insert it
441into. If the <tt>Parent</tt> parameter is specified, the new
442<tt>BasicBlock</tt> is automatically inserted at the end of the specified <a
443href="#Function"><tt>Function</tt></a>, if not specified, the BasicBlock must be
444manually inserted into the <a href="#Function"><tt>Function</tt></a>.<p>
445
446<li><tt>BasicBlock::iterator</tt> - Typedef for instruction list iterator<br>
447 <tt>BasicBlock::const_iterator</tt> - Typedef for const_iterator.<br>
448 <tt>begin()</tt>, <tt>end()</tt>, <tt>front()</tt>, <tt>back()</tt>,
449 <tt>size()</tt>, <tt>empty()</tt>, <tt>rbegin()</tt>, <tt>rend()</tt><p>
450
451These methods and typedefs are forwarding functions that have the same semantics
452as the standard library methods of the same names. These methods expose the
453underlying instruction list of a basic block in a way that is easy to
454manipulate. To get the full complement of container operations (including
455operations to update the list), you must use the <tt>getInstList()</tt>
456method.<p>
457
458<li><tt>BasicBlock::InstListType &amp;getInstList()</tt><p>
459
460This method is used to get access to the underlying container that actually
461holds the Instructions. This method must be used when there isn't a forwarding
462function in the <tt>BasicBlock</tt> class for the operation that you would like
463to perform. Because there are no forwarding functions for "updating"
464operations, you need to use this if you want to update the contents of a
465<tt>BasicBlock</tt>.<p>
466
467<li><tt><A href="#Function">Function</a> *getParent()</tt><p>
468
469Returns a pointer to <a href="#Function"><tt>Function</tt></a> the block is
470embedded into, or a null pointer if it is homeless.<p>
471
472<li><tt><a href="#TerminatorInst">TerminatorInst</a> *getTerminator()</tt><p>
473
474Returns a pointer to the terminator instruction that appears at the end of the
475<tt>BasicBlock</tt>. If there is no terminator instruction, or if the last
476instruction in the block is not a terminator, then a null pointer is
477returned.<p>
478
479
480<!-- ======================================================================= -->
481</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
482<tr><td>&nbsp;</td><td width="100%">&nbsp;
483<font color="#EEEEFF" face="Georgia,Palatino"><b>
484<a name="GlobalValue">The <tt>GlobalValue</tt> class</a>
485</b></font></td></tr></table><ul>
486
487<tt>#include "<a
488href="/doxygen/GlobalValue_8h-source.html">llvm/GlobalValue.h</a>"</tt></b><br>
489doxygen info: <a href="/doxygen/classGlobalValue.html">GlobalValue Class</a><br>
490Superclasses: <a href="#User"><tt>User</tt></a>, <a
491href="#Value"><tt>Value</tt></a><p>
492
493Global values (<A href="#GlobalVariable"><tt>GlobalVariable</tt></a>s or <a
494href="#Function"><tt>Function</tt></a>s) are the only LLVM values that are
495visible in the bodies of all <a href="#Function"><tt>Function</tt></a>s.
496Because they are visible at global scope, they are also subject to linking with
497other globals defined in different translation units. To control the linking
498process, <tt>GlobalValue</tt>s know their linkage rules. Specifically,
499<tt>GlobalValue</tt>s know whether they have internal or external linkage.<p>
500
501If a <tt>GlobalValue</tt> has internal linkage (equivalent to being
502<tt>static</tt> in C), it is not visible to code outside the current translation
503unit, and does not participate in linking. If it has external linkage, it is
504visible to external code, and does participate in linking. In addition to
505linkage information, <tt>GlobalValue</tt>s keep track of which <a
506href="#Module"><tt>Module</tt></a> they are currently part of.<p>
507
508Because <tt>GlobalValue</tt>s are memory objects, they are always referred to by
509their address. As such, the <a href="#Type"><tt>Type</tt></a> of a global is
510always a pointer to its contents. This is explained in the LLVM Language
511Reference Manual.<p>
512
513
514<!-- _______________________________________________________________________ -->
515</ul><h4><a name="m_GlobalValue"><hr size=0>Important Public Members of
516the <tt>GlobalValue</tt> class</h4><ul>
517
518<li><tt>bool hasInternalLinkage() const</tt><br>
519 <tt>bool hasExternalLinkage() const</tt><br>
520 <tt>void setInternalLinkage(bool HasInternalLinkage)</tt><p>
521
522These methods manipulate the linkage characteristics of the
523<tt>GlobalValue</tt>.<p>
524
525<li><tt><a href="#Module">Module</a> *getParent()</tt><p>
526
527This returns the <a href="#Module"><tt>Module</tt></a> that the GlobalValue is
528currently embedded into.<p>
529
530
531
532<!-- ======================================================================= -->
533</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
534<tr><td>&nbsp;</td><td width="100%">&nbsp;
535<font color="#EEEEFF" face="Georgia,Palatino"><b>
536<a name="Function">The <tt>Function</tt> class</a>
537</b></font></td></tr></table><ul>
538
539<tt>#include "<a
540href="/doxygen/Function_8h-source.html">llvm/Function.h</a>"</tt></b><br>
541doxygen info: <a href="/doxygen/classFunction.html">Function Class</a><br>
542Superclasses: <a href="#GlobalValue"><tt>GlobalValue</tt></a>, <a
543href="#User"><tt>User</tt></a>, <a href="#Value"><tt>Value</tt></a><p>
544
545The <tt>Function</tt> class represents a single procedure in LLVM. It is
546actually one of the more complex classes in the LLVM heirarchy because it must
547keep track of a large amount of data. The <tt>Function</tt> class keeps track
548of a list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s, a list of formal <a
549href="#Argument"><tt>Argument</tt></a>s, and a <a
550href="#SymbolTable"><tt>SymbolTable</tt></a>.<p>
551
552The list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s is the most commonly
553used part of <tt>Function</tt> objects. The list imposes an implicit ordering
554of the blocks in the function, which indicate how the code will be layed out by
555the backend. Additionally, the first <a
556href="#BasicBlock"><tt>BasicBlock</tt></a> is the implicit entry node for the
557<tt>Function</tt>. It is not legal in LLVM explicitly branch to this initial
558block. There are no implicit exit nodes, and in fact there may be multiple exit
559nodes from a single <tt>Function</tt>. If the <a
560href="#BasicBlock"><tt>BasicBlock</tt></a> list is empty, this indicates that
561the <tt>Function</tt> is actually a function declaration: the actual body of the
562function hasn't been linked in yet.<p>
563
564In addition to a list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s, the
565<tt>Function</tt> class also keeps track of the list of formal <a
566href="#Argument"><tt>Argument</tt></a>s that the function receives. This
567container manages the lifetime of the <a href="#Argument"><tt>Argument</tt></a>
568nodes, just like the <a href="#BasicBlock"><tt>BasicBlock</tt></a> list does for
569the <a href="#BasicBlock"><tt>BasicBlock</tt></a>s.<p>
570
571The <a href="#SymbolTable"><tt>SymbolTable</tt></a> is a very rarely used LLVM
572feature that is only used when you have to look up a value by name. Aside from
573that, the <a href="#SymbolTable"><tt>SymbolTable</tt></a> is used internally to
574make sure that there are not conflicts between the names of <a
575href="#Instruction"><tt>Instruction</tt></a>s, <a
576href="#BasicBlock"><tt>BasicBlock</tt></a>s, or <a
577href="#Argument"><tt>Argument</tt></a>s in the function body.<p>
578
579
580<!-- _______________________________________________________________________ -->
581</ul><h4><a name="m_Function"><hr size=0>Important Public Members of
582the <tt>Function</tt> class</h4><ul>
583
584<li><tt>Function(const <a href="#FunctionType">FunctionType</a> *Ty, bool isInternal, const std::string &amp;N = "")</tt><p>
585
586Constructor used when you need to create new <tt>Function</tt>s to add the the
587program. The constructor must specify the type of the function to create and
588whether or not it should start out with internal or external linkage.<p>
589
590<li><tt>bool isExternal()</tt><p>
591
592Return whether or not the <tt>Function</tt> has a body defined. If the function
593is "external", it does not have a body, and thus must be resolved by linking
594with a function defined in a different translation unit.<p>
595
596
597<li><tt>Function::iterator</tt> - Typedef for basic block list iterator<br>
598 <tt>Function::const_iterator</tt> - Typedef for const_iterator.<br>
599 <tt>begin()</tt>, <tt>end()</tt>, <tt>front()</tt>, <tt>back()</tt>,
600 <tt>size()</tt>, <tt>empty()</tt>, <tt>rbegin()</tt>, <tt>rend()</tt><p>
601
602These are forwarding methods that make it easy to access the contents of a
603<tt>Function</tt> object's <a href="#BasicBlock"><tt>BasicBlock</tt></a>
604list.<p>
605
606<li><tt>Function::BasicBlockListType &amp;getBasicBlockList()</tt><p>
607
608Returns the list of <a href="#BasicBlock"><tt>BasicBlock</tt></a>s. This is
609neccesary to use when you need to update the list or perform a complex action
610that doesn't have a forwarding method.<p>
611
612
613<li><tt>Function::aiterator</tt> - Typedef for the argument list iterator<br>
614 <tt>Function::const_aiterator</tt> - Typedef for const_iterator.<br>
615 <tt>abegin()</tt>, <tt>aend()</tt>, <tt>afront()</tt>, <tt>aback()</tt>,
616 <tt>asize()</tt>, <tt>aempty()</tt>, <tt>arbegin()</tt>, <tt>arend()</tt><p>
617
618These are forwarding methods that make it easy to access the contents of a
619<tt>Function</tt> object's <a href="#Argument"><tt>Argument</tt></a> list.<p>
620
621<li><tt>Function::ArgumentListType &amp;getArgumentList()</tt><p>
622
623Returns the list of <a href="#Argument"><tt>Argument</tt></a>s. This is
624neccesary to use when you need to update the list or perform a complex action
625that doesn't have a forwarding method.<p>
626
627
628
629<li><tt><a href="#BasicBlock">BasicBlock</a> &getEntryNode()</tt><p>
630
631Returns the entry <a href="#BasicBlock"><tt>BasicBlock</tt></a> for the
632function. Because the entry block for the function is always the first block,
633this returns the first block of the <tt>Function</tt>.<p>
634
635<li><tt><a href="#Type">Type</a> *getReturnType()</tt><br>
636 <tt><a href="#FunctionType">FunctionType</a> *getFunctionType()</tt><p>
637
638This traverses the <a href="#Type"><tt>Type</tt></a> of the <tt>Function</tt>
639and returns the return type of the function, or the <a
640href="#FunctionType"><tt>FunctionType</tt></a> of the actual function.<p>
641
642
643<li><tt>bool hasSymbolTable() const</tt><p>
644
645Return true if the <tt>Function</tt> has a symbol table allocated to it and if
646there is at least one entry in it.<p>
647
648<li><tt><a href="#SymbolTable">SymbolTable</a> *getSymbolTable()</tt><p>
649
650Return a pointer to the <a href="#SymbolTable"><tt>SymbolTable</tt></a> for this
651<tt>Function</tt> or a null pointer if one has not been allocated (because there
652are no named values in the function).<p>
653
654<li><tt><a href="#SymbolTable">SymbolTable</a> *getSymbolTableSure()</tt><p>
655
656Return a pointer to the <a href="#SymbolTable"><tt>SymbolTable</tt></a> for this
657<tt>Function</tt> or allocate a new <a
658href="#SymbolTable"><tt>SymbolTable</tt></a> if one is not already around. This
659should only be used when adding elements to the <a
660href="#SymbolTable"><tt>SymbolTable</tt></a>, so that empty symbol tables are
661not left laying around.<p>
662
663
664
665<!-- ======================================================================= -->
666</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
667<tr><td>&nbsp;</td><td width="100%">&nbsp;
668<font color="#EEEEFF" face="Georgia,Palatino"><b>
669<a name="GlobalVariable">The <tt>GlobalVariable</tt> class</a>
670</b></font></td></tr></table><ul>
671
672<tt>#include "<a
673href="/doxygen/GlobalVariable_8h-source.html">llvm/GlobalVariable.h</a>"</tt></b><br>
674doxygen info: <a href="/doxygen/classGlobalVariable.html">GlobalVariable Class</a><br>
675Superclasses: <a href="#GlobalValue"><tt>GlobalValue</tt></a>, <a
676href="#User"><tt>User</tt></a>, <a href="#Value"><tt>Value</tt></a><p>
677
Chris Lattner0377de42002-09-06 14:50:55 +0000678Global variables are represented with the (suprise suprise)
679<tt>GlobalVariable</tt> class. Like functions, <tt>GlobalVariable</tt>s are
680also subclasses of <a href="#GlobalValue"><tt>GlobalValue</tt></a>, and as such
681are always referenced by their address (global values must live in memory, so
682their "name" refers to their address). Global variables may have an initial
683value (which must be a <a href="#Constant"><tt>Constant</tt></a>), and if they
684have an initializer, they may be marked as "constant" themselves (indicating
685that their contents never change at runtime).<p>
Chris Lattner9355b472002-09-06 02:50:58 +0000686
687
688<!-- _______________________________________________________________________ -->
Chris Lattner0377de42002-09-06 14:50:55 +0000689</ul><h4><a name="m_GlobalVariable"><hr size=0>Important Public Members of the
690<tt>GlobalVariable</tt> class</h4><ul>
Chris Lattner9355b472002-09-06 02:50:58 +0000691
692<li><tt>GlobalVariable(const <a href="#Type">Type</a> *Ty, bool isConstant, bool
693isInternal, <a href="#Constant">Constant</a> *Initializer = 0, const std::string
694&amp;Name = "")</tt><p>
695
Chris Lattner0377de42002-09-06 14:50:55 +0000696Create a new global variable of the specified type. If <tt>isConstant</tt> is
697true then the global variable will be marked as unchanging for the program, and
698if <tt>isInternal</tt> is true the resultant global variable will have internal
699linkage. Optionally an initializer and name may be specified for the global variable as well.<p>
700
701
Chris Lattner9355b472002-09-06 02:50:58 +0000702<li><tt>bool isConstant() const</tt><p>
703
704Returns true if this is a global variable is known not to be modified at
705runtime.<p>
706
Chris Lattner0377de42002-09-06 14:50:55 +0000707
Chris Lattner9355b472002-09-06 02:50:58 +0000708<li><tt>bool hasInitializer()</tt><p>
709
710Returns true if this <tt>GlobalVariable</tt> has an intializer.<p>
711
Chris Lattner0377de42002-09-06 14:50:55 +0000712
Chris Lattner9355b472002-09-06 02:50:58 +0000713<li><tt><a href="#Constant">Constant</a> *getInitializer()</tt><p>
714
Chris Lattner0377de42002-09-06 14:50:55 +0000715Returns the intial value for a <tt>GlobalVariable</tt>. It is not legal to call
716this method if there is no initializer.<p>
717
718
719<!-- ======================================================================= -->
720</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
721<tr><td>&nbsp;</td><td width="100%">&nbsp;
722<font color="#EEEEFF" face="Georgia,Palatino"><b>
723<a name="Module">The <tt>Module</tt> class</a>
724</b></font></td></tr></table><ul>
725
726<tt>#include "<a
727href="/doxygen/Module_8h-source.html">llvm/Module.h</a>"</tt></b><br>
728doxygen info: <a href="/doxygen/classModule.html">Module Class</a><p>
729
730The <tt>Module</tt> class represents the top level structure present in LLVM
731programs. An LLVM module is effectively either a translation unit of the
732original program or a combination of several translation units merged by the
733linker. The <tt>Module</tt> class keeps track of a list of <a
734href="#Function"><tt>Function</tt></a>s, a list of <a
735href="#GlobalVariable"><tt>GlobalVariable</tt></a>s, and a <a
736href="#SymbolTable"><tt>SymbolTable</tt></a>. Additionally, it contains a few
737helpful member functions that try to make common operations easy.<p>
738
739
740<!-- _______________________________________________________________________ -->
741</ul><h4><a name="m_Module"><hr size=0>Important Public Members of the
742<tt>Module</tt> class</h4><ul>
743
744<li><tt>Module::iterator</tt> - Typedef for function list iterator<br>
745 <tt>Module::const_iterator</tt> - Typedef for const_iterator.<br>
746 <tt>begin()</tt>, <tt>end()</tt>, <tt>front()</tt>, <tt>back()</tt>,
747 <tt>size()</tt>, <tt>empty()</tt>, <tt>rbegin()</tt>, <tt>rend()</tt><p>
748
749These are forwarding methods that make it easy to access the contents of a
750<tt>Module</tt> object's <a href="#Function"><tt>Function</tt></a>
751list.<p>
752
753<li><tt>Module::FunctionListType &amp;getFunctionList()</tt><p>
754
755Returns the list of <a href="#Function"><tt>Function</tt></a>s. This is
756neccesary to use when you need to update the list or perform a complex action
757that doesn't have a forwarding method.<p>
758
759<!-- Global Variable -->
760<hr size=0>
761
762<li><tt>Module::giterator</tt> - Typedef for global variable list iterator<br>
763 <tt>Module::const_giterator</tt> - Typedef for const_iterator.<br>
764 <tt>gbegin()</tt>, <tt>gend()</tt>, <tt>gfront()</tt>, <tt>gback()</tt>,
765 <tt>gsize()</tt>, <tt>gempty()</tt>, <tt>grbegin()</tt>, <tt>grend()</tt><p>
766
767These are forwarding methods that make it easy to access the contents of a
768<tt>Module</tt> object's <a href="#GlobalVariable"><tt>GlobalVariable</tt></a>
769list.<p>
770
771<li><tt>Module::GlobalListType &amp;getGlobalList()</tt><p>
772
773Returns the list of <a href="#GlobalVariable"><tt>GlobalVariable</tt></a>s.
774This is neccesary to use when you need to update the list or perform a complex
775action that doesn't have a forwarding method.<p>
776
777
778<!-- Symbol table stuff -->
779<hr size=0>
780
781<li><tt>bool hasSymbolTable() const</tt><p>
782
783Return true if the <tt>Module</tt> has a symbol table allocated to it and if
784there is at least one entry in it.<p>
785
786<li><tt><a href="#SymbolTable">SymbolTable</a> *getSymbolTable()</tt><p>
787
788Return a pointer to the <a href="#SymbolTable"><tt>SymbolTable</tt></a> for this
789<tt>Module</tt> or a null pointer if one has not been allocated (because there
790are no named values in the function).<p>
791
792<li><tt><a href="#SymbolTable">SymbolTable</a> *getSymbolTableSure()</tt><p>
793
794Return a pointer to the <a href="#SymbolTable"><tt>SymbolTable</tt></a> for this
795<tt>Module</tt> or allocate a new <a
796href="#SymbolTable"><tt>SymbolTable</tt></a> if one is not already around. This
797should only be used when adding elements to the <a
798href="#SymbolTable"><tt>SymbolTable</tt></a>, so that empty symbol tables are
799not left laying around.<p>
800
801
802<!-- Convenience methods -->
803<hr size=0>
804
805<li><tt><a href="#Function">Function</a> *getFunction(const std::string &amp;Name, const <a href="#FunctionType">FunctionType</a> *Ty)</tt><p>
806
807Look up the specified function in the <tt>Module</tt> <a
808href="#SymbolTable"><tt>SymbolTable</tt></a>. If it does not exist, return
809<tt>null</tt>.<p>
810
811
812<li><tt><a href="#Function">Function</a> *getOrInsertFunction(const std::string
813 &amp;Name, const <a href="#FunctionType">FunctionType</a> *T)</tt><p>
814
815Look up the specified function in the <tt>Module</tt> <a
816href="#SymbolTable"><tt>SymbolTable</tt></a>. If it does not exist, add an
817external declaration for the function and return it.<p>
818
819
820<li><tt>std::string getTypeName(const <a href="#Type">Type</a> *Ty)</tt><p>
821
822If there is at least one entry in the <a
823href="#SymbolTable"><tt>SymbolTable</tt></a> for the specified <a
824href="#Type"><tt>Type</tt></a>, return it. Otherwise return the empty
825string.<p>
826
827
828<li><tt>bool addTypeName(const std::string &Name, const <a href="#Type">Type</a>
829*Ty)</tt><p>
830
831Insert an entry in the <a href="#SymbolTable"><tt>SymbolTable</tt></a> mapping
832<tt>Name</tt> to <tt>Ty</tt>. If there is already an entry for this name, true
833is returned and the <a href="#SymbolTable"><tt>SymbolTable</tt></a> is not
834modified.<p>
835
Chris Lattner9355b472002-09-06 02:50:58 +0000836
837<!-- ======================================================================= -->
838</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
839<tr><td>&nbsp;</td><td width="100%">&nbsp;
840<font color="#EEEEFF" face="Georgia,Palatino"><b>
841<a name="Constant">The <tt>Constant</tt> class and subclasses</a>
842</b></font></td></tr></table><ul>
843
844Constant represents a base class for different types of constants. It is
845subclassed by ConstantBool, ConstantInt, ConstantSInt, ConstantUInt,
846ConstantArray etc for representing the various types of Constants.<p>
847
848
849<!-- _______________________________________________________________________ -->
850</ul><h4><a name="m_Value"><hr size=0>Important Public Methods</h4><ul>
851
852<li><tt>bool isConstantExpr()</tt>: Returns true if it is a ConstantExpr
853
854
855
856
857\subsection{Important Subclasses of Constant}
858\begin{itemize}
859<li>ConstantSInt : This subclass of Constant represents a signed integer constant.
860 \begin{itemize}
861 <li><tt>int64_t getValue () const</tt>: Returns the underlying value of this constant.
862 \end{itemize}
863<li>ConstantUInt : This class represents an unsigned integer.
864 \begin{itemize}
865 <li><tt>uint64_t getValue () const</tt>: Returns the underlying value of this constant.
866 \end{itemize}
867<li>ConstantFP : This class represents a floating point constant.
868 \begin{itemize}
869 <li><tt>double getValue () const</tt>: Returns the underlying value of this constant.
870 \end{itemize}
871<li>ConstantBool : This represents a boolean constant.
872 \begin{itemize}
873 <li><tt>bool getValue () const</tt>: Returns the underlying value of this constant.
874 \end{itemize}
875<li>ConstantArray : This represents a constant array.
876 \begin{itemize}
877 <li><tt>const std::vector<Use> &amp;getValues() const</tt>: Returns a Vecotr of component constants that makeup this array.
878 \end{itemize}
879<li>ConstantStruct : This represents a constant struct.
880 \begin{itemize}
881 <li><tt>const std::vector<Use> &amp;getValues() const</tt>: Returns a Vecotr of component constants that makeup this array.
882 \end{itemize}
883<li>ConstantPointerRef : This represents a constant pointer value that is initialized to point to a global value, which lies at a constant fixed address.
884 \begin{itemize}
885<li><tt>GlobalValue *getValue()</tt>: Returns the global value to which this pointer is pointing to.
886 \end{itemize}
887\end{itemize}
888
889
890<!-- ======================================================================= -->
891</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
892<tr><td>&nbsp;</td><td width="100%">&nbsp;
893<font color="#EEEEFF" face="Georgia,Palatino"><b>
894<a name="Type">The <tt>Type</tt> class and Derived Types</a>
895</b></font></td></tr></table><ul>
896
897Type as noted earlier is also a subclass of a Value class. Any primitive
898type (like int, short etc) in LLVM is an instance of Type Class. All
899other types are instances of subclasses of type like FunctionType,
900ArrayType etc. DerivedType is the interface for all such dervied types
901including FunctionType, ArrayType, PointerType, StructType. Types can have
902names. They can be recursive (StructType). There exists exactly one instance
903of any type structure at a time. This allows using pointer equality of Type *s for comparing types.
904
905<!-- _______________________________________________________________________ -->
906</ul><h4><a name="m_Value"><hr size=0>Important Public Methods</h4><ul>
907
908<li><tt>PrimitiveID getPrimitiveID () const</tt>: Returns the base type of the type.
909<li><tt> bool isSigned () const</tt>: Returns whether an integral numeric type is signed. This is true for SByteTy, ShortTy, IntTy, LongTy. Note that this is not true for Float and Double.
910<li><tt>bool isUnsigned () const</tt>: Returns whether a numeric type is unsigned. This is not quite the complement of isSigned... nonnumeric types return false as they do with isSigned. This returns true for UByteTy, UShortTy, UIntTy, and ULongTy.
911<li><tt> bool isInteger () const</tt>: Equilivent to isSigned() || isUnsigned(), but with only a single virtual function invocation.
912<li><tt>bool isIntegral () const</tt>: Returns true if this is an integral type, which is either Bool type or one of the Integer types.
913
914<li><tt>bool isFloatingPoint ()</tt>: Return true if this is one of the two floating point types.
915<li><tt>bool isRecursive () const</tt>: Returns rue if the type graph contains a cycle.
916<li><tt>isLosslesslyConvertableTo (const Type *Ty) const</tt>: Return true if this type can be converted to 'Ty' without any reinterpretation of bits. For example, uint to int.
917<li><tt>bool isPrimitiveType () const</tt>: Returns true if it is a primitive type.
918<li><tt>bool isDerivedType () const</tt>: Returns true if it is a derived type.
919<li><tt>const Type * getContainedType (unsigned i) const</tt>:
920This method is used to implement the type iterator. For derived types, this returns the types 'contained' in the derived type, returning 0 when 'i' becomes invalid. This allows the user to iterate over the types in a struct, for example, really easily.
921<li><tt>unsigned getNumContainedTypes () const</tt>: Return the number of types in the derived type.
922
923
924
925\subsection{Derived Types}
926\begin{itemize}
927<li>SequentialType : This is subclassed by ArrayType and PointerType
928 \begin{itemize}
929 <li><tt>const Type * getElementType () const</tt>: Returns the type of each of the elements in the sequential type.
930 \end{itemize}
931<li>ArrayType : This is a subclass of SequentialType and defines interface for array types.
932 \begin{itemize}
933 <li><tt>unsigned getNumElements () const</tt>: Returns the number of elements in the array.
934 \end{itemize}
935<li>PointerType : Subclass of SequentialType for pointer types.
936<li>StructType : subclass of DerivedTypes for struct types
937<li>FunctionType : subclass of DerivedTypes for function types.
938 \begin{itemize}
939
940 <li><tt>bool isVarArg () const</tt>: Returns true if its a vararg function
941 <li><tt> const Type * getReturnType () const</tt>: Returns the return type of the function.
942 <li><tt> const ParamTypes &amp;getParamTypes () const</tt>: Returns a vector of parameter types.
943 <li><tt>const Type * getParamType (unsigned i)</tt>: Returns the type of the ith parameter.
944 <li><tt> const unsigned getNumParams () const</tt>: Returns the number of formal parameters.
945 \end{itemize}
946\end{itemize}
947
948
949
950
951<!-- ======================================================================= -->
952</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
953<tr><td>&nbsp;</td><td width="100%">&nbsp;
954<font color="#EEEEFF" face="Georgia,Palatino"><b>
955<a name="Argument">The <tt>Argument</tt> class</a>
956</b></font></td></tr></table><ul>
957
958This subclass of Value defines the interface for incoming formal arguments to a
959function. A Function maitanis a list of its formal arguments. An argument has a
960pointer to the parent Function.
961
962
963
964
965<!-- *********************************************************************** -->
966</ul>
967<!-- *********************************************************************** -->
968
969<hr><font size-1>
970<address>By: <a href="mailto:dhurjati@cs.uiuc.edu">Dinakar Dhurjati</a> and
971<a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
972<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
973<!-- hhmts start -->
Chris Lattnera30ed382002-09-06 16:33:54 +0000974Last modified: Fri Sep 6 11:21:49 CDT 2002
Chris Lattner9355b472002-09-06 02:50:58 +0000975<!-- hhmts end -->
976</font></body></html>