diff --git a/wasm/codegen/helpers/common.py b/wasm/codegen/helpers/common.py index 59071d1b..84fc03c1 100644 --- a/wasm/codegen/helpers/common.py +++ b/wasm/codegen/helpers/common.py @@ -78,12 +78,6 @@ def try_cast_to_scalar_type(value: str) -> int | float | str: return value -def debug_print(msg: str): - """Prints a message to the console if STRUCT_DEBUG_MODE is enabled.""" - if constants.STRUCT_DEBUG_MODE: - print(msg) - - def replace_lines_containing_marker( lines: list[str], marker_to_replace: str, diff --git a/wasm/codegen/helpers/constants.py b/wasm/codegen/helpers/constants.py index 10e9ccb8..541e8a56 100644 --- a/wasm/codegen/helpers/constants.py +++ b/wasm/codegen/helpers/constants.py @@ -462,11 +462,6 @@ BYTE_FIELDS: Dict[str, Dict[str, str]] = { "arena": {"size": "narena"}, } -# Boolean flag to enable debug prints during the struct wrapper and binding -# generation process. When set to `True`, it will print additional information -# about the steps being executed. -STRUCT_DEBUG_MODE: bool = False - # These structs require specific function calls for creation and/or deletion, # or some of their fields need to be handled manually for now; # making their wrapper constructors/destructors non-trivial. diff --git a/wasm/codegen/helpers/structs.py b/wasm/codegen/helpers/structs.py index 532bddfc..c8600aa9 100644 --- a/wasm/codegen/helpers/structs.py +++ b/wasm/codegen/helpers/structs.py @@ -27,8 +27,6 @@ from wasm.codegen.helpers import common from wasm.codegen.helpers import constants -debug_print = common.debug_print - introspect_structs = structs.STRUCTS @@ -269,9 +267,6 @@ class StructFieldHandler: inner_type_name.startswith("mj") and inner_type_name not in constants.PRIMITIVE_TYPES ): - debug_print( - f"\tcomplex pointer type: needs manual wrapper: {self.field.name}" - ) # it's a pointer to a single struct, # like the `element` field in mjs structs # and the struct is not manually added @@ -296,10 +291,6 @@ class StructFieldHandler: initialization=f", {self.field.name}(ptr_->{self.field.name})", ) else: - debug_print( - "\tcomplex pointer type with array extent: needs manual wrapper:" - f" {self.field.name}" - ) return self._get_manual_definition(comment_type="complex pointer field") return WrappedFieldData( @@ -342,10 +333,8 @@ class StructFieldHandler: elif inner_type.name.startswith("mj") and not inner_type.name.startswith( "mjt" ): - debug_print(f"\tarray to vector wrapper needed: {self.field.name}") return self._get_manual_definition(comment_type="array field") - debug_print(f"\tNOT IMPLEMENTED ARRAY field: {self.field.name}") return WrappedFieldData( definition=( f"// TODO: NOT IMPLEMENTED ARRAY wrapper for {self.field.name}" @@ -727,8 +716,6 @@ def generate_wasm_bindings( else: raise RuntimeError(f"Struct not found: {struct_name}") - debug_print(f"Wrapping struct: {struct_name}") - wrapped_fields: List[WrappedFieldData] = [] for field in struct_fields: wrapped_field = StructFieldHandler(field, wrapped_name).generate()