Partial support for integer divisions in access vectors
[suif.git] / html / suif1_59.html
blobbf47adc56abcbbbca190ac383bfcb0e840345650
1 <HTML>
2 <HEAD>
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 - Types</TITLE>
7 <link href="suif1_60.html" rel=Next>
8 <link href="suif1_58.html" rel=Previous>
9 <link href="suif1_toc.html" rel=ToC>
11 </HEAD>
12 <BODY>
13 <p>Go to the <A HREF="suif1_1.html">first</A>, <A HREF="suif1_58.html">previous</A>, <A HREF="suif1_60.html">next</A>, <A HREF="suif1_113.html">last</A> section, <A HREF="suif1_toc.html">table of contents</A>.
14 <P><HR><P>
17 <H1><A NAME="SEC59" HREF="suif1_toc.html#TOC59">Types</A></H1>
18 <P>
19 <A NAME="IDX412"></A>
21 </P>
22 <P>
23 <A NAME="IDX413"></A>
24 <A NAME="IDX414"></A>
25 SUIF types are used to describe the results of instructions and the
26 contents of variables. Each symbol table (see section <A HREF="suif1_40.html#SEC40">Symbol Tables</A>)
27 contains a list of types that are visible within the scope of that
28 table. All SUIF types are derived from the <CODE>type_node</CODE> base class,
29 which is defined in the files <TT>`types.h'</TT> and <TT>`types.cc'</TT>. The
30 <CODE>type_node_list</CODE> class is provided for lists of pointers to types.
32 </P>
33 <P>
34 <A NAME="IDX415"></A>
35 <A NAME="IDX416"></A>
36 Different kinds of type nodes are distinguished by their type operators.
37 The <CODE>op</CODE> method returns the operator for a particular
38 <CODE>type_node</CODE>. Some type operators define complete types by
39 themselves while others build upon existing types. The <CODE>type_ops</CODE>
40 enumeration lists the type operators:
42 </P>
43 <DL COMPACT>
45 <DT><CODE>TYPE_VOID</CODE>
46 <DD>
47 <DT><CODE>TYPE_INT</CODE>
48 <DD>
49 <DT><CODE>TYPE_FLOAT</CODE>
50 <DD>
51 These operators, along with <CODE>TYPE_ENUM</CODE> below, define the base
52 types. They use the <CODE>base_type</CODE> derived class.
54 <DT><CODE>TYPE_PTR</CODE>
55 <DD>
56 A pointer operator defines a type for pointers to an existing
57 type. The <CODE>ptr_type</CODE> derived class holds this kind of type node.
59 <DT><CODE>TYPE_ARRAY</CODE>
60 <DD>
61 The array operator uses the <CODE>array_type</CODE> class and defines a type
62 that is an array with elements of another type.
64 <DT><CODE>TYPE_FUNC</CODE>
65 <DD>
66 The function operator defines a type for a SUIF procedure in terms of
67 the return type and the types of the arguments. The <CODE>func_type</CODE>
68 derived class is used with this operator.
70 <DT><CODE>TYPE_STRUCT</CODE>
71 <DD>
72 <DT><CODE>TYPE_UNION</CODE>
73 <DD>
74 These operators are for named structure and union types and both use the
75 <CODE>struct_type</CODE> derived class. Both combine fields of different
76 types into a single record.
78 <DT><CODE>TYPE_ENUM</CODE>
79 <DD>
80 The enumerated type operator defines an integer type where each value
81 may have a name. Like the ordinary integer types, enumerated types are
82 also base types. Thus, the <CODE>enum_type</CODE> class is derived from the
83 <CODE>base_type</CODE> class.
85 <DT><CODE>TYPE_CONST</CODE>
86 <DD>
87 <DT><CODE>TYPE_VOLATILE</CODE>
88 <DD>
89 <DT><CODE>TYPE_CALL_BY_REF</CODE>
90 <DD>
91 <DT><CODE>TYPE_NULL</CODE>
92 <DD>
93 These operators are modifiers for other types. They use the
94 <CODE>modifier_type</CODE> derived class.
95 </DL>
97 <P>
98 <A NAME="IDX417"></A>
99 The integer, floating-point, pointer, and enumerated types are all
100 classified as <STRONG>scalar</STRONG> types, and the <CODE>is_scalar</CODE> method checks
101 if a type is one of these. The array, structure, and union types
102 are all <STRONG>aggregate</STRONG> types.
104 </P>
106 The <CODE>type_node</CODE> base class defines several methods that are
107 applicable to all types, and those are described in the first section
108 below along with some other comments about types in general. The bulk
109 of this chapter is devoted to the various kinds of types and the
110 corresponding derived classes. The last section describes the common
111 types that are predefined in the global symbol table.
113 </P>
115 <UL>
116 <LI><A HREF="suif1_60.html#SEC60">Type Features</A>: Features shared by all types.
117 <LI><A HREF="suif1_61.html#SEC61">Base Types</A>: Void, integer, and floating-point types.
118 <LI><A HREF="suif1_62.html#SEC62">Pointer Types</A>: Pointers.
119 <LI><A HREF="suif1_63.html#SEC63">Array Types</A>: Arrays.
120 <LI><A HREF="suif1_64.html#SEC64">Function Types</A>: Types for SUIF procedures.
121 <LI><A HREF="suif1_65.html#SEC65">Structure Types</A>: Structures and unions.
122 <LI><A HREF="suif1_66.html#SEC66">Enumerated Types</A>: Lists of named values.
123 <LI><A HREF="suif1_67.html#SEC67">Modifier Types</A>: Qualifiers for other types.
124 <LI><A HREF="suif1_68.html#SEC68">Predefined Types</A>: Simple types in the global symbol table.
125 </UL>
127 <P><HR><P>
128 <p>Go to the <A HREF="suif1_1.html">first</A>, <A HREF="suif1_58.html">previous</A>, <A HREF="suif1_60.html">next</A>, <A HREF="suif1_113.html">last</A> section, <A HREF="suif1_toc.html">table of contents</A>.
129 </BODY>
130 </HTML>