def METHOD_NAME(settings, attr):
    platform_type = str(settings["//command_line_option:apple_platform_type"])
    cpu = _cpu_string(platform_type, settings)
    if settings["//command_line_option:incompatible_enable_apple_toolchain_resolution"]:
        platforms = (
            settings["//command_line_option:apple_platforms"] or
            settings["//command_line_option:platforms"]
        )
        return _output_dictionary(settings, cpu, platform_type, platforms)
    crosstools_are_equal = (
        settings["//command_line_option:crosstool_top"] ==
        settings["//command_line_option:apple_crosstool_top"]
    )
    if cpu == settings["//command_line_option:cpu"] and crosstools_are_equal:
        # No changes necessary.
        return {}
    # Ensure platforms aren't set so that platform mapping can take place.
    return _output_dictionary(settings, cpu, platform_type, semantics.cpu_to_platform(cpu))