Use is_using_fission in legacy_fields_migrator

Since unknown commit is submitted, the principled variable to use in per_object_debug_info is is_using_fission, not per_object_debug_info_file (in case of thinlto build, the former is present also for thinlto bitcode compile, the latter only for backend compile).

RELNOTES: None.
PiperOrigin-RevId: 237192121
This commit is contained in:
hlopko 2019-03-07 00:01:43 -08:00 committed by Copybara-Service
parent 2d3bc12294
commit 0b8e7b5940
2 changed files with 7 additions and 3 deletions

View File

@ -126,6 +126,7 @@ def migrate_legacy_fields(crosstool):
toolchain, "per_object_debug_info"):
# feature {
# name: "per_object_debug_info"
# enabled: true
# flag_set {
# action: "assemble"
# action: "preprocess-assemble"
@ -134,7 +135,7 @@ def migrate_legacy_fields(crosstool):
# action: "c++-module-codegen"
# action: "lto-backend"
# flag_group {
# expand_if_all_available: 'per_object_debug_info_file'",
# expand_if_all_available: 'is_using_fission'",
# flag: "-gsplit-dwarf"
# }
# }
@ -148,7 +149,7 @@ def migrate_legacy_fields(crosstool):
"preprocess-assemble", "lto-backend"
]
flag_group = flag_set.flag_group.add()
flag_group.expand_if_all_available[:] = ["per_object_debug_info_file"]
flag_group.expand_if_all_available[:] = ["is_using_fission"]
flag_group.flag[:] = ["-gsplit-dwarf"]
if toolchain.objcopy_embed_flag and not _get_feature(

View File

@ -941,6 +941,9 @@ class LegacyFieldsMigrationLibTest(unittest.TestCase):
output = crosstool.toolchain[0]
self.assertEqual(output.feature[0].name, "per_object_debug_info")
self.assertEqual(output.feature[0].enabled, True)
self.assertEqual(
output.feature[0].flag_set[0].flag_group[0].expand_if_all_available,
["is_using_fission"])
def test_supports_fission_not_migrated_on_false(self):
crosstool = make_crosstool("supports_fission: false")