@@ -582,14 +582,38 @@ def main(argv):
582582 'dml12-remove-goto' ,
583583 'dml12-fix-int-quirks' ])
584584
585+ compat_features = {
586+ 'broken_unused_types' : breaking_changes .dml_forbid_broken_unused_types ,
587+ 'broken_conditional_is' : breaking_changes .dml_forbid_broken_conditional_is ,
588+ 'port_proxy_ifaces' : breaking_changes .dml_remove_port_proxy_ifaces ,
589+ 'port_proxy_attrs' : breaking_changes .dml_remove_port_proxy_attrs ,
590+ 'function_in_extern_struct' :
591+ breaking_changes .dml_forbid_function_in_extern_struct ,
592+ 'optional_version_statement' :
593+ breaking_changes .dml_require_version_statement ,
594+ 'io_memory' : breaking_changes .dml_transaction_by_default ,
595+ 'port_obj_param' : breaking_changes .dml_remove_port_obj_param ,
596+ 'shared_logs_on_device' : breaking_changes .dml_shared_logs_locally ,
597+ 'suppress_WLOGMIXUP' : breaking_changes .dml_enable_WLOGMIXUP ,
598+ 'legacy_attributes' : breaking_changes .dml_remove_legacy_attributes ,
599+ 'lenient_typechecking' : breaking_changes .dml_strict_typechecking ,
600+ 'no_method_index_asserts' : breaking_changes .dml_range_check_method_indices ,
601+ 'meaningless_log_levels' : breaking_changes .dml_restrict_log_levels ,
602+ 'dml12_inline' : breaking_changes .dml12_disable_inline_constants ,
603+ 'dml12_not' : breaking_changes .dml12_not_typecheck ,
604+ 'dml12_misc' : breaking_changes .dml12_remove_misc_quirks ,
605+ 'dml12_goto' : breaking_changes .dml12_remove_goto ,
606+ 'dml12_int' : breaking_changes .dml12_fix_int_quirks ,
607+ 'experimental_vect' : breaking_changes .dml_forbid_experimental_vect ,
608+ 'warning_statement' : breaking_changes .dml_forbid_warning_statement ,
609+ }
585610 if options .no_compat :
586611 if options .breaking_change :
587612 parser .error ("cannot pass both --no-compat and --breaking-change" )
588613 for flag in options .no_compat :
589614 for tag in flag .split (',' ):
590- if tag in breaking_changes .compat_features :
591- options .breaking_change .append (
592- breaking_changes .compat_features [tag ].tag ())
615+ if tag in compat_features :
616+ options .breaking_change .append (compat_features [tag ].tag ())
593617 else :
594618 parser .error (f'invalid tag { tag } for --no-compat.' )
595619
@@ -607,11 +631,6 @@ def main(argv):
607631
608632 breaking_changes .BreakingChange .enabled_breaking_changes = set (
609633 changes .values ())
610- # temp hack to make existing code continue to work
611- dml .globals .enabled_compat = {
612- tag for (tag , bc ) in breaking_changes .compat_features .items ()
613- if not bc .enabled
614- }
615634
616635 if not breaking_changes .dml_enable_WLOGMIXUP .enabled :
617636 ignore_warning ('WLOGMIXUP' )
0 commit comments