|
CIRCT 23.0.0git
|
Public Member Functions | |
| None | __init__ (self, type_table) |
Public Attributes | |
| has_cycle | |
| ordered_types | |
Plan C++ type naming and ordering from an ESI manifest.
Definition at line 683 of file codegen.py.
| None esiaccel.codegen.CppTypePlanner.__init__ | ( | self, | |
| type_table | |||
| ) |
Initialize the generator with the manifest and target namespace.
Definition at line 686 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 748 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 756 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. Two distinct windows can wrap the same `into` struct (e.g. serial and parallel encodings of the same payload), so the helper name must be derived from BOTH the inner type's name and the window's own name/id.
Definition at line 764 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._reserve_name(), esiaccel.codegen.CppTypePlanner._sanitize_name(), esiaccel.codegen.CppTypePlanner._unwrap_aliases(), esiaccel.codegen.CppTypeEmitter._unwrap_aliases(), and esiaccel.codegen.CppTypeEmitter.type_id_map.
Referenced by esiaccel.codegen.CppTypePlanner._collect_windows().
|
protected |
Scan for aliases and reserve their names (recursive).
Definition at line 857 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 897 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 921 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 870 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 884 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 |
Return True if `esi_type` is or transitively contains a WindowType. Structs (and aliases/unions that reference them) which embed a window cannot be emitted as C++ packed structs because the C++ window helper is a variable-size multi-frame container. This helper is used to exclude such types from the emission list entirely.
Definition at line 937 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._contains_window(), esiaccel.codegen.CppTypePlanner._unwrap_aliases(), and esiaccel.codegen.CppTypeEmitter._unwrap_aliases().
Referenced by esiaccel.codegen.CppTypePlanner._contains_window(), and esiaccel.codegen.CppTypePlanner._ordered_emit_types().
|
protected |
Definition at line 788 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 824 of file codegen.py.
Referenced by esiaccel.codegen.CppTypePlanner._visit_types().
|
protected |
Collect and order types for deterministic emission.
Definition at line 956 of file codegen.py.
References esiaccel.codegen.CppTypePlanner._collect_decls_from_type(), esiaccel.codegen.CppTypePlanner._collect_decls_from_window(), esiaccel.codegen.CppTypePlanner._contains_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 698 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 732 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 715 of file codegen.py.
References isdigit.
Referenced by esiaccel.codegen.CppTypePlanner._auto_struct_name(), esiaccel.codegen.CppTypePlanner._auto_union_name(), esiaccel.codegen.CppTypePlanner._auto_window_name(), and esiaccel.codegen.CppTypePlanner._reserve_name().
|
protected |
Definition at line 783 of file codegen.py.
Referenced by esiaccel.codegen.CppTypeEmitter._analyze_window(), esiaccel.codegen.CppTypePlanner._auto_window_name(), esiaccel.codegen.CppTypePlanner._collect_decls_from_window(), esiaccel.codegen.CppTypePlanner._contains_window(), esiaccel.codegen.CppTypeEmitter._emit_struct(), esiaccel.codegen.CppTypeEmitter._emit_window_data_accessors(), 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 844 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 695 of file codegen.py.
Referenced by esiaccel.codegen.CppTypeEmitter.write_header().
| esiaccel.codegen.CppTypePlanner.ordered_types |
Definition at line 713 of file codegen.py.
Referenced by esiaccel.codegen.CppTypePlanner.__init__(), and esiaccel.codegen.CppTypeEmitter.write_header().