|
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) |
| 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) |
| Set[types.ESIType] | _collect_decls_from_type (self, types.ESIType wrapped) |
| Tuple[List[types.ESIType], bool] | _ordered_emit_types (self) |
Plan C++ type naming and ordering from an ESI manifest.
Definition at line 84 of file codegen.py.
| None esiaccel.codegen.CppTypePlanner.__init__ | ( | self, | |
| type_table | |||
| ) |
Initialize the generator with the manifest and target namespace.
Definition at line 87 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 145 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._reserve_name(), and esiaccel.codegen.CppTypePlanner._sanitize_name().
Referenced by esiaccel.codegen.CppTypePlanner._collect_structs().
|
protected |
Scan for aliases and reserve their names (recursive).
Definition at line 180 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 207 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._visit_types().
Referenced by esiaccel.codegen.CppTypePlanner._ordered_emit_types().
|
protected |
Scan for structs needing auto-names and reserve them (recursive).
Definition at line 193 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._auto_struct_name(), esiaccel.codegen.CppTypePlanner._visit_types(), and esiaccel.codegen.CppTypeEmitter.type_id_map.
Referenced by esiaccel.codegen.CppTypePlanner._prepare_types().
|
protected |
Return child types in a stable order for traversal.
Definition at line 153 of file codegen.py.
Referenced by esiaccel.codegen.CppTypePlanner._visit_types().
|
protected |
Collect and order types for deterministic emission.
Definition at line 226 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._collect_decls_from_type(), 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 99 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._collect_aliases(), and esiaccel.codegen.CppTypePlanner._collect_structs().
|
protected |
Reserve a globally unique identifier using the sanitized base name.
Definition at line 129 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._sanitize_name().
Referenced by esiaccel.codegen.CppTypePlanner._auto_struct_name(), and esiaccel.codegen.CppTypePlanner._collect_aliases().
|
protected |
Create a C++-safe identifier from the manifest-provided name.
Definition at line 112 of file codegen.py.
References isdigit.
Referenced by esiaccel.codegen.CppTypePlanner._auto_struct_name(), and esiaccel.codegen.CppTypePlanner._reserve_name().
|
protected |
Traverse types with alphabetical child ordering in post-order.
Definition at line 167 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(), and esiaccel.codegen.CppTypePlanner._visit_types().
| esiaccel.codegen.CppTypePlanner.has_cycle |
Definition at line 96 of file codegen.py.
Referenced by esiaccel.codegen.CppTypeEmitter.write_header().
| esiaccel.codegen.CppTypePlanner.ordered_types |
Definition at line 110 of file codegen.py.
Referenced by esiaccel.codegen.CppTypePlanner.__init__(), and esiaccel.codegen.CppTypeEmitter.write_header().