|
CIRCT 23.0.0git
|
Public Member Functions | |
| None | __init__ (self, type_table) |
Public Attributes | |
| has_cycle | |
| ordered_types | |
Protected Member Functions | |
| None | _prepare_types (self, type_table) |
| str | _sanitize_name (self, str name) |
| str | _reserve_name (self, str base, bool is_alias) |
| str | _auto_struct_name (self, types.StructType struct_type) |
| str | _auto_union_name (self, types.UnionType union_type) |
| str | _auto_window_name (self, types.WindowType window_type) |
| types.ESIType | _unwrap_aliases (self, types.ESIType wrapped) |
| bool | _is_supported_window (self, types.ESIType current_type) |
| List[types.ESIType] | _iter_type_children (self, types.ESIType t) |
| None | _visit_types (self, types.ESIType t, Set[str] visited, visit_fn) |
| None | _collect_aliases (self, types.ESIType t, Set[str] visited) |
| None | _collect_structs (self, types.ESIType t, Set[str] visited) |
| None | _collect_windows (self, types.ESIType t, Set[str] visited) |
| Set[types.ESIType] | _collect_decls_from_type (self, types.ESIType wrapped) |
| Set[types.ESIType] | _collect_decls_from_window (self, types.WindowType window_type) |
| Tuple[List[types.ESIType], bool] | _ordered_emit_types (self) |
Plan C++ type naming and ordering from an ESI manifest.
Definition at line 85 of file codegen.py.
| None esiaccel.codegen.CppTypePlanner.__init__ | ( | self, | |
| type_table | |||
| ) |
Initialize the generator with the manifest and target namespace.
Definition at line 88 of file codegen.py.
References esiaccel.codegen.CppTypePlanner.ordered_types, esiaccel.codegen.CppTypeEmitter.ordered_types, and esiaccel.codegen.CppTypeEmitter.type_id_map.
Referenced by synth.LongestPathCollection.drop_non_critical_paths(), and synth.LongestPathCollection.merge().
|
protected |
Derive a deterministic name for anonymous structs from their fields.
Definition at line 150 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._reserve_name(), and esiaccel.codegen.CppTypePlanner._sanitize_name().
Referenced by esiaccel.codegen.CppTypePlanner._collect_structs().
|
protected |
Derive a deterministic name for anonymous unions from their fields.
Definition at line 158 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._reserve_name(), and esiaccel.codegen.CppTypePlanner._sanitize_name().
Referenced by esiaccel.codegen.CppTypePlanner._collect_structs().
|
protected |
Derive a deterministic name for generated window helpers.
Definition at line 166 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._reserve_name().
Referenced by esiaccel.codegen.CppTypePlanner._collect_windows().
|
protected |
Scan for aliases and reserve their names (recursive).
Definition at line 247 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._reserve_name(), esiaccel.codegen.CppTypePlanner._visit_types(), and esiaccel.codegen.CppTypeEmitter.type_id_map.
Referenced by esiaccel.codegen.CppTypePlanner._prepare_types().
|
protected |
Collect types that require top-level declarations for a given type.
Definition at line 287 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._is_supported_window(), and esiaccel.codegen.CppTypePlanner._visit_types().
Referenced by esiaccel.codegen.CppTypePlanner._collect_decls_from_window(), and esiaccel.codegen.CppTypePlanner._ordered_emit_types().
|
protected |
Collect only the declarations referenced by a generated window helper.
Definition at line 311 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._collect_decls_from_type(), esiaccel.codegen.CppTypePlanner._unwrap_aliases(), and esiaccel.codegen.CppTypeEmitter._unwrap_aliases().
Referenced by esiaccel.codegen.CppTypePlanner._ordered_emit_types().
|
protected |
Scan for structs/unions needing auto-names and reserve them.
Definition at line 260 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._auto_struct_name(), esiaccel.codegen.CppTypePlanner._auto_union_name(), esiaccel.codegen.CppTypePlanner._visit_types(), and esiaccel.codegen.CppTypeEmitter.type_id_map.
Referenced by esiaccel.codegen.CppTypePlanner._prepare_types().
|
protected |
Scan for supported window types and reserve helper names.
Definition at line 274 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._auto_window_name(), esiaccel.codegen.CppTypePlanner._is_supported_window(), esiaccel.codegen.CppTypePlanner._visit_types(), and esiaccel.codegen.CppTypeEmitter.type_id_map.
Referenced by esiaccel.codegen.CppTypePlanner._prepare_types().
|
protected |
Definition at line 178 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._unwrap_aliases(), and esiaccel.codegen.CppTypeEmitter._unwrap_aliases().
Referenced by esiaccel.codegen.CppTypePlanner._collect_decls_from_type(), esiaccel.codegen.CppTypePlanner._collect_windows(), and esiaccel.codegen.CppTypePlanner._ordered_emit_types().
|
protected |
Return child types in a stable order for traversal.
Definition at line 214 of file codegen.py.
Referenced by esiaccel.codegen.CppTypePlanner._visit_types().
|
protected |
Collect and order types for deterministic emission.
Definition at line 327 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._collect_decls_from_type(), esiaccel.codegen.CppTypePlanner._collect_decls_from_window(), esiaccel.codegen.CppTypePlanner._is_supported_window(), esiaccel.codegen.CppTypePlanner._unwrap_aliases(), esiaccel.codegen.CppTypeEmitter._unwrap_aliases(), and esiaccel.codegen.CppTypeEmitter.type_id_map.
|
protected |
Name the types and prepare for emission by registering all reachable types and assigning.
Definition at line 100 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._collect_aliases(), esiaccel.codegen.CppTypePlanner._collect_structs(), and esiaccel.codegen.CppTypePlanner._collect_windows().
|
protected |
Reserve a globally unique identifier using the sanitized base name.
Definition at line 134 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._sanitize_name().
Referenced by esiaccel.codegen.CppTypePlanner._auto_struct_name(), esiaccel.codegen.CppTypePlanner._auto_union_name(), esiaccel.codegen.CppTypePlanner._auto_window_name(), and esiaccel.codegen.CppTypePlanner._collect_aliases().
|
protected |
Create a C++-safe identifier from the manifest-provided name.
Definition at line 117 of file codegen.py.
References isdigit.
Referenced by esiaccel.codegen.CppTypePlanner._auto_struct_name(), esiaccel.codegen.CppTypePlanner._auto_union_name(), and esiaccel.codegen.CppTypePlanner._reserve_name().
|
protected |
Definition at line 173 of file codegen.py.
Referenced by esiaccel.codegen.CppTypeEmitter._analyze_window(), esiaccel.codegen.CppTypePlanner._collect_decls_from_window(), esiaccel.codegen.CppTypeEmitter._emit_struct(), esiaccel.codegen.CppTypeEmitter._format_window_ctor_param(), esiaccel.codegen.CppTypeEmitter._format_window_field_decl(), esiaccel.codegen.CppTypePlanner._is_supported_window(), and esiaccel.codegen.CppTypePlanner._ordered_emit_types().
|
protected |
Traverse types with alphabetical child ordering in post-order.
Definition at line 234 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._iter_type_children(), and esiaccel.codegen.CppTypePlanner._visit_types().
Referenced by esiaccel.codegen.CppTypePlanner._collect_aliases(), esiaccel.codegen.CppTypePlanner._collect_decls_from_type(), esiaccel.codegen.CppTypePlanner._collect_structs(), esiaccel.codegen.CppTypePlanner._collect_windows(), and esiaccel.codegen.CppTypePlanner._visit_types().
| esiaccel.codegen.CppTypePlanner.has_cycle |
Definition at line 97 of file codegen.py.
Referenced by esiaccel.codegen.CppTypeEmitter.write_header().
| esiaccel.codegen.CppTypePlanner.ordered_types |
Definition at line 115 of file codegen.py.
Referenced by esiaccel.codegen.CppTypePlanner.__init__(), and esiaccel.codegen.CppTypeEmitter.write_header().