Class Hierarchy Compound List File List Header Files Compound Members File Members
TypeBuilder Class Reference
Utility functions for building, retrieving, and manipulating types.
More...
#include <type_builder.h>
Class diagram for TypeBuilder:
List of all members.Public Members
- virtual void init (SuifEnv* suif)
- virtual const LString& getName ()
- DataType* unqualify_data_type (Type *t)
- Type* unqualify_type ( Type* t )
- virtual VoidType* get_void_type ()
- virtual BooleanType* get_boolean_type ( IInteger size_in_bits, int alignment_in_bits )
- virtual BooleanType* get_boolean_type ()
- virtual IntegerType* get_integer_type ( IInteger size_in_bits, int alignment_in_bits, bool is_signed = true )
- virtual IntegerType* get_smallest_integer_type ()
- Find a small integer type. More...
- virtual IntegerType* get_integer_type (bool is_signed = true)
- virtual FloatingPointType* get_floating_point_type ( IInteger size_in_bits, int alignment_in_bits )
- virtual FloatingPointType* get_floating_point_type ()
- virtual FloatingPointType* get_double_floating_point_type ()
- virtual PointerType* get_pointer_type ( IInteger size_in_bits, int alignment_in_bits, Type* reference_type)
- virtual PointerType* get_pointer_type (Type* reference_type)
- virtual ReferenceType* get_reference_type ( IInteger size_in_bits, int alignment_in_bits, Type* reference_type)
- virtual ReferenceType* get_reference_type (Type* reference_type)
- virtual ArrayType* get_array_type ( IInteger size_in_bits, int alignment_in_bits, QualifiedType* element_type, Expression *lower_bound, Expression *upper_bound)
- virtual ArrayType* get_array_type ( QualifiedType* element_type, const IInteger &lower_bound, const IInteger &upper_bound)
- array type with calculated size and alignment.
- virtual ArrayType* get_array_type ( QualifiedType* element_type, Expression *lower_bound, Expression *upper_bound)
- virtual MultiDimArrayType* get_multi_dim_array_type ( IInteger size_in_bits, int alignment_in_bits, QualifiedType* element_type, suif_vector<Expression *> &lower_bounds, suif_vector<Expression *> &upper_bounds)
- virtual MultiDimArrayType* get_multi_dim_array_type ( QualifiedType* element_type, suif_vector<Expression *> &lower_bounds, suif_vector<Expression *> &upper_bounds)
- virtual QualifiedType* get_qualified_type (DataType *base_type, list<LString> qualifiers )
- virtual QualifiedType* get_qualified_type (DataType *base_type, const LString &qualifier )
- virtual QualifiedType* get_qualified_type (QualifiedType *base_type, list<LString> qualifiers )
- virtual QualifiedType* get_qualified_type (QualifiedType *base_type, const LString &qualifier )
- virtual QualifiedType* get_qualified_type (DataType *base_type)
- virtual LabelType* get_label_type ()
- virtual CProcedureType* get_c_procedure_type ( DataType * result_type, list<QualifiedType *> argument_list, bool has_varags = false, bool arguments_known = true, int bit_alignment = 0)
- virtual GroupType* get_group_type ( list<SymbolTable*>symbol_tables, list<LString>&names, list<QualifiedType *> &type_list)
- get a group type, returning an existing group if it exists the name list is may be empty or partial - missing names are empty if a new group is created it is created in the first symbol table enclosing all the types, or the last symbol table if none.
- virtual UnionType* get_union_type ( list<SymbolTable*>symbol_tables, list<LString>&names, list<QualifiedType *> &type_list)
- get a union type, returning an existing union if it exists the name list is may be empty or partial - missing names are empty if a new union is created it is created in the first symbol table enclosing all the types, or the last symbol table if none.
- virtual FieldSymbol* add_symbol_to_group ( GroupType *group, const LString &symbol_name, const QualifiedType *symbol_type)
- virtual FieldSymbol* add_union_symbol_to_group ( GroupType *group, const LString &symbol_name, const QualifiedType *symbol_type, int pos = -1)
- Add a union to a union type the last optional field positions the union. More...
- virtual FieldSymbol* find_field_of_type ( GroupType *group, const Type *field_type)
- Find a field of a given type. More...
- virtual FieldSymbol* find_symbol_containing_offset ( GroupType *group, IInteger offset)
- find the field containing the offset In the case of unions, the first union containing the field is returned.
- virtual FieldSymbol* find_non_group_symbol_containing_offset ( GroupType *group, IInteger offset)
- as above, but groups are looked through until a suitable non-group field is found.
- virtual DataType* find_type_of_field_containing_offset ( GroupType *group, IInteger offset)
- returns the type of the non_group_symbol, but arrays are also looked through to find a non-group, non-array type.
- void get_array_bounds (Type *type,int bound,IInteger &low,IInteger &high)
- Get the bounds of an array of a multidimensional array If the given bound is not an integer constant, or if the bound is not determined, undetermined is returned bound is the number of the bound to get, 0 based from left to right.
Static Public Members
Detailed Description
Utility functions for building, retrieving, and manipulating types.
For each class of type, the get_type functions look for that type in the appropriate symbol tables. If none is found, then the type is created and inserted into the highest valid symbol table.
For each class of type, there is generally a get_type routine which takes all parameters and one which defaults the size and alignment parameters. The defaults for these are looked up in the TargetInformationBlock or, if no target information block has been found, they are derived from the types on the HOST machine. This will be bad if the host machine and the target machine are not the same.
The default size will be a size best suited to a variable in memory.
Member Function Documentation
virtual void TypeBuilder::init (SuifEnv * suif) [virtual]
virtual const LString & TypeBuilder::getName () [virtual]
DataType * TypeBuilder::unqualify_data_type (Type * t)
Type * TypeBuilder::unqualify_type (Type * t)
virtual VoidType * TypeBuilder::get_void_type () [virtual]
virtual BooleanType * TypeBuilder::get_boolean_type (IInteger size_in_bits, int alignment_in_bits) [virtual]
virtual BooleanType * TypeBuilder::get_boolean_type () [virtual]
virtual IntegerType * TypeBuilder::get_integer_type (IInteger size_in_bits, int alignment_in_bits, bool is_signed = true) [virtual]
virtual IntegerType * TypeBuilder::get_smallest_integer_type () [virtual]
Find a small integer type.
This should be type char. This can be taken as the smallest type creatable on the machine (ie, one addressing unit) However, if a front end fails to generate this, you will get the smallest type generated.
virtual IntegerType * TypeBuilder::get_integer_type (bool is_signed = true) [virtual]
virtual FloatingPointType * TypeBuilder::get_floating_point_type (IInteger size_in_bits, int alignment_in_bits) [virtual]
virtual FloatingPointType * TypeBuilder::get_floating_point_type () [virtual]
virtual FloatingPointType * TypeBuilder::get_double_floating_point_type () [virtual]
virtual PointerType * TypeBuilder::get_pointer_type (IInteger size_in_bits, int alignment_in_bits, Type * reference_type) [virtual]
virtual PointerType * TypeBuilder::get_pointer_type (Type * reference_type) [virtual]
virtual ReferenceType * TypeBuilder::get_reference_type (IInteger size_in_bits, int alignment_in_bits, Type * reference_type) [virtual]
virtual ReferenceType * TypeBuilder::get_reference_type (Type * reference_type) [virtual]
virtual ArrayType * TypeBuilder::get_array_type (IInteger size_in_bits, int alignment_in_bits, QualifiedType * element_type, Expression * lower_bound, Expression * upper_bound) [virtual]
virtual ArrayType * TypeBuilder::get_array_type (QualifiedType * element_type, const IInteger & lower_bound, const IInteger & upper_bound) [virtual]
array type with calculated size and alignment.
virtual ArrayType * TypeBuilder::get_array_type (QualifiedType * element_type, Expression * lower_bound, Expression * upper_bound) [virtual]
virtual MultiDimArrayType * TypeBuilder::get_multi_dim_array_type (IInteger size_in_bits, int alignment_in_bits, QualifiedType * element_type, suif_vector<Expression *>& lower_bounds, suif_vector<Expression *>& upper_bounds) [virtual]
virtual MultiDimArrayType * TypeBuilder::get_multi_dim_array_type (QualifiedType * element_type, suif_vector<Expression *>& lower_bounds, suif_vector<Expression *>& upper_bounds) [virtual]
virtual QualifiedType * TypeBuilder::get_qualified_type (DataType * base_type, list<LString> qualifiers) [virtual]
virtual QualifiedType * TypeBuilder::get_qualified_type (DataType * base_type, const LString & qualifier) [virtual]
virtual QualifiedType * TypeBuilder::get_qualified_type (QualifiedType * base_type, list<LString> qualifiers) [virtual]
virtual QualifiedType * TypeBuilder::get_qualified_type (QualifiedType * base_type, const LString & qualifier) [virtual]
virtual QualifiedType * TypeBuilder::get_qualified_type (DataType * base_type) [virtual]
virtual LabelType * TypeBuilder::get_label_type () [virtual]
virtual CProcedureType * TypeBuilder::get_c_procedure_type (DataType * result_type, list<QualifiedType *> argument_list, bool has_varags = false, bool arguments_known = true, int bit_alignment = 0) [virtual]
virtual GroupType * TypeBuilder::get_group_type (list<SymbolTable *> symbol_tables, list<LString>& names, list<QualifiedType *>& type_list) [virtual]
get a group type, returning an existing group if it exists the name list is may be empty or partial - missing names are empty if a new group is created it is created in the first symbol table enclosing all the types, or the last symbol table if none.
virtual UnionType * TypeBuilder::get_union_type (list<SymbolTable *> symbol_tables, list<LString>& names, list<QualifiedType *>& type_list) [virtual]
get a union type, returning an existing union if it exists the name list is may be empty or partial - missing names are empty if a new union is created it is created in the first symbol table enclosing all the types, or the last symbol table if none.
virtual FieldSymbol * TypeBuilder::add_symbol_to_group (GroupType * group, const LString & symbol_name, const QualifiedType * symbol_type) [virtual]
virtual FieldSymbol * TypeBuilder::add_union_symbol_to_group (GroupType * group, const LString & symbol_name, const QualifiedType * symbol_type, int pos = -1) [virtual]
Add a union to a union type the last optional field positions the union.
Useful when the new union is the default (for initialization)
virtual FieldSymbol * TypeBuilder::find_field_of_type (GroupType * group, const Type * field_type) [virtual]
Find a field of a given type.
Useful when building unions to do type breaking activities. The field_type can be either of a QualifiedType or a simple type. If it is a simple type, any qualifications on the field symbol's type are ignored in matching
virtual FieldSymbol * TypeBuilder::find_symbol_containing_offset (GroupType * group, IInteger offset) [virtual]
find the field containing the offset In the case of unions, the first union containing the field is returned.
virtual FieldSymbol * TypeBuilder::find_non_group_symbol_containing_offset (GroupType * group, IInteger offset) [virtual]
as above, but groups are looked through until a suitable non-group field is found.
virtual DataType * TypeBuilder::find_type_of_field_containing_offset (GroupType * group, IInteger offset) [virtual]
returns the type of the non_group_symbol, but arrays are also looked through to find a non-group, non-array type.
void TypeBuilder::get_array_bounds (Type * type, int bound, IInteger & low, IInteger & high)
Get the bounds of an array of a multidimensional array If the given bound is not an integer constant, or if the bound is not determined, undetermined is returned bound is the number of the bound to get, 0 based from left to right.
const LString & TypeBuilder::get_class_name () [static]
bool TypeBuilder::is_argument_types_match (list<QualifiedType *>& argument_list, CProcedureType * typ) [static]
Return true if the argument types in argument_list matches with that in typ.
Two types match if they are the same Type object.
SymbolTable * TypeBuilder::most_nested_common_scope (SymbolTable * newtable, SymbolTable * table) [static]
Given two symbol tables, return the one that is least nested.
Return NULL if they are not related and no common parent exists
SymbolTable * TypeBuilder::most_nested_common_scope (list<QualifiedType *>& tlist, SymbolTable * table) [static]
bool TypeBuilder::is_ancestor_of (SuifObject * ancestor, SuifObject * child) [static]
The documentation for this class was generated from the following file:
Generated at Mon Nov 22 19:43:53 1999 for NCI SUIF by
written by Dimitri van Heesch, © 1997-1999