CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
esiaccel.codegen.CppTypeEmitter Class Reference

Public Member Functions

None __init__ (self, CppTypePlanner planner)
 
str type_identifier (self, types.ESIType type)
 
None write_header (self, Path output_dir, str system_name)
 

Public Attributes

 type_id_map
 
 ordered_types
 
 has_cycle
 

Protected Member Functions

str _get_bitvector_str (self, types.ESIType type)
 
Tuple[str, str] _array_base_and_suffix (self, types.ArrayType array_type)
 
str _format_array_type (self, types.ArrayType array_type)
 
str _cpp_type (self, types.ESIType wrapped)
 
types.ESIType _unwrap_aliases (self, types.ESIType wrapped)
 
str _format_array_decl (self, types.ArrayType array_type, str name)
 
None _emit_struct (self, TextIO hdr, types.StructType struct_type)
 
None _emit_alias (self, TextIO hdr, types.TypeAlias alias_type)
 

Detailed Description

Emit C++ headers from precomputed type ordering.

Definition at line 275 of file codegen.py.

Constructor & Destructor Documentation

◆ __init__()

None esiaccel.codegen.CppTypeEmitter.__init__ (   self,
CppTypePlanner  planner 
)

Member Function Documentation

◆ _array_base_and_suffix()

Tuple[str, str] esiaccel.codegen.CppTypeEmitter._array_base_and_suffix (   self,
types.ArrayType  array_type 
)
protected
Return the base C++ type and bracket suffix for a nested array.

Definition at line 308 of file codegen.py.

References esiaccel.codegen.CppTypeEmitter._cpp_type().

Referenced by esiaccel.codegen.CppTypeEmitter._format_array_decl(), and esiaccel.codegen.CppTypeEmitter._format_array_type().

◆ _cpp_type()

str esiaccel.codegen.CppTypeEmitter._cpp_type (   self,
types.ESIType  wrapped 
)
protected

◆ _emit_alias()

None esiaccel.codegen.CppTypeEmitter._emit_alias (   self,
TextIO  hdr,
types.TypeAlias  alias_type 
)
protected
Emit a using alias when the alias targets a different C++ type.

Definition at line 391 of file codegen.py.

References esiaccel.codegen.CppTypeEmitter._cpp_type(), and esiaccel.codegen.CppTypeEmitter.type_id_map.

Referenced by esiaccel.codegen.CppTypeEmitter.write_header().

◆ _emit_struct()

None esiaccel.codegen.CppTypeEmitter._emit_struct (   self,
TextIO  hdr,
types.StructType  struct_type 
)
protected

◆ _format_array_decl()

str esiaccel.codegen.CppTypeEmitter._format_array_decl (   self,
types.ArrayType  array_type,
str  name 
)
protected
Emit a field declaration for a multi-dimensional array member.

The declaration flattens nested arrays into repeated bracketed sizes for C++.

Definition at line 352 of file codegen.py.

References esiaccel.codegen.CppTypeEmitter._array_base_and_suffix().

Referenced by esiaccel.codegen.CppTypeEmitter._emit_struct().

◆ _format_array_type()

str esiaccel.codegen.CppTypeEmitter._format_array_type (   self,
types.ArrayType  array_type 
)
protected
Return the C++ type string for a nested array alias.

Definition at line 320 of file codegen.py.

References esiaccel.codegen.CppTypeEmitter._array_base_and_suffix().

Referenced by esiaccel.codegen.CppTypeEmitter._cpp_type().

◆ _get_bitvector_str()

str esiaccel.codegen.CppTypeEmitter._get_bitvector_str (   self,
types.ESIType  type 
)
protected
Get the textual code for the storage class of an integer type.

Definition at line 287 of file codegen.py.

Referenced by esiaccel.codegen.CppTypeEmitter._cpp_type().

◆ _unwrap_aliases()

types.ESIType esiaccel.codegen.CppTypeEmitter._unwrap_aliases (   self,
types.ESIType  wrapped 
)
protected
Strip alias wrappers to reach the underlying type.

Definition at line 346 of file codegen.py.

Referenced by esiaccel.codegen.CppTypeEmitter._emit_struct().

◆ type_identifier()

str esiaccel.codegen.CppTypeEmitter.type_identifier (   self,
types.ESIType  type 
)
Get the C++ type string for an ESI type.

Definition at line 283 of file codegen.py.

References esiaccel.codegen.CppTypeEmitter._cpp_type().

◆ write_header()

None esiaccel.codegen.CppTypeEmitter.write_header (   self,
Path  output_dir,
str  system_name 
)

Member Data Documentation

◆ has_cycle

esiaccel.codegen.CppTypeEmitter.has_cycle

Definition at line 281 of file codegen.py.

Referenced by esiaccel.codegen.CppTypeEmitter.write_header().

◆ ordered_types

esiaccel.codegen.CppTypeEmitter.ordered_types

◆ type_id_map

esiaccel.codegen.CppTypeEmitter.type_id_map

The documentation for this class was generated from the following file: