Merge "Remove location information of unnamed elements in dumps to avoid automerge conflict." am: aa22b20007

Original change: https://android-review.googlesource.com/c/platform/development/+/2136214

Change-Id: I84fe081ed2177c8ad2c05c742083c8f5f2133d6b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Mu-Le Lee
2022-06-27 06:06:01 +00:00
committed by Automerger Merge Worker
5 changed files with 22 additions and 19 deletions

View File

@@ -208,6 +208,9 @@ void HeaderASTConsumer::HandleTranslationUnit(clang::ASTContext &ctx) {
// names to avoid inconsistency between C and C++ (for C++ files, this is true // names to avoid inconsistency between C and C++ (for C++ files, this is true
// by default) // by default)
policy.SuppressTagKeyword = true; policy.SuppressTagKeyword = true;
// Hide the location of the anonymous or unnamed structures entity while
// getting QualType string names to avoid automerge conflict
policy.AnonymousTagLocations = false;
PrintNormalizedPath callbacks(options_.root_dirs_); PrintNormalizedPath callbacks(options_.root_dirs_);
policy.Callbacks = &callbacks; policy.Callbacks = &callbacks;
ctx.setPrintingPolicy(policy); ctx.setPrintingPolicy(policy);

View File

@@ -220,7 +220,7 @@ record_types {
} }
record_types { record_types {
type_info { type_info {
name: "Hello::(anonymous struct at development/vndk/tools/header-checker/tests/input/example1.h:19:3)" name: "Hello::(anonymous)"
size: 12 size: 12
alignment: 4 alignment: 4
referenced_type: "_ZTIN5HelloUt1_E" referenced_type: "_ZTIN5HelloUt1_E"
@@ -252,7 +252,7 @@ record_types {
} }
record_types { record_types {
type_info { type_info {
name: "Hello::(anonymous struct at development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at development/vndk/tools/header-checker/tests/input/example1.h:22:5)" name: "Hello::(anonymous)::(anonymous)"
size: 4 size: 4
alignment: 4 alignment: 4
referenced_type: "_ZTIN5HelloUt1_Ut_E" referenced_type: "_ZTIN5HelloUt1_Ut_E"
@@ -448,7 +448,7 @@ enum_types {
} }
enum_types { enum_types {
type_info { type_info {
name: "Hello::(unnamed enum at development/vndk/tools/header-checker/tests/input/example1.h:17:3)" name: "Hello::(unnamed)"
size: 4 size: 4
alignment: 4 alignment: 4
referenced_type: "_ZTIN5Hello2$AE" referenced_type: "_ZTIN5Hello2$AE"
@@ -469,7 +469,7 @@ enum_types {
} }
enum_types { enum_types {
type_info { type_info {
name: "Hello::(unnamed enum at development/vndk/tools/header-checker/tests/input/example1.h:18:3)" name: "Hello::(unnamed)"
size: 4 size: 4
alignment: 4 alignment: 4
referenced_type: "_ZTIN5Hello2$CE" referenced_type: "_ZTIN5Hello2$CE"

View File

@@ -220,7 +220,7 @@ record_types {
} }
record_types { record_types {
type_info { type_info {
name: "Hello::(anonymous struct at development/vndk/tools/header-checker/tests/input/example1.h:19:3)" name: "Hello::(anonymous)"
size: 12 size: 12
alignment: 4 alignment: 4
referenced_type: "_ZTIN5HelloUt1_E" referenced_type: "_ZTIN5HelloUt1_E"
@@ -252,7 +252,7 @@ record_types {
} }
record_types { record_types {
type_info { type_info {
name: "Hello::(anonymous struct at development/vndk/tools/header-checker/tests/input/example1.h:19:3)::(anonymous struct at development/vndk/tools/header-checker/tests/input/example1.h:22:5)" name: "Hello::(anonymous)::(anonymous)"
size: 4 size: 4
alignment: 4 alignment: 4
referenced_type: "_ZTIN5HelloUt1_Ut_E" referenced_type: "_ZTIN5HelloUt1_Ut_E"
@@ -448,7 +448,7 @@ enum_types {
} }
enum_types { enum_types {
type_info { type_info {
name: "Hello::(unnamed enum at development/vndk/tools/header-checker/tests/input/example1.h:17:3)" name: "Hello::(unnamed)"
size: 4 size: 4
alignment: 4 alignment: 4
referenced_type: "_ZTIN5Hello2$AE" referenced_type: "_ZTIN5Hello2$AE"
@@ -469,7 +469,7 @@ enum_types {
} }
enum_types { enum_types {
type_info { type_info {
name: "Hello::(unnamed enum at development/vndk/tools/header-checker/tests/input/example1.h:18:3)" name: "Hello::(unnamed)"
size: 4 size: 4
alignment: 4 alignment: 4
referenced_type: "_ZTIN5Hello2$CE" referenced_type: "_ZTIN5Hello2$CE"

View File

@@ -37,7 +37,7 @@
} }
], ],
"linker_set_key" : "_ZTI2$A", "linker_set_key" : "_ZTI2$A",
"name" : "(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:1:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI2$A", "referenced_type" : "_ZTI2$A",
"self_type" : "_ZTI2$A", "self_type" : "_ZTI2$A",
"size" : 1, "size" : 1,
@@ -54,7 +54,7 @@
} }
], ],
"linker_set_key" : "_ZTI2$B", "linker_set_key" : "_ZTI2$B",
"name" : "(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:5:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI2$B", "referenced_type" : "_ZTI2$B",
"self_type" : "_ZTI2$B", "self_type" : "_ZTI2$B",
"size" : 1, "size" : 1,
@@ -71,7 +71,7 @@
} }
], ],
"linker_set_key" : "_ZTI21$FIRST_ANONYMOUS_ENUM", "linker_set_key" : "_ZTI21$FIRST_ANONYMOUS_ENUM",
"name" : "(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/include_golden.h:1:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI21$FIRST_ANONYMOUS_ENUM", "referenced_type" : "_ZTI21$FIRST_ANONYMOUS_ENUM",
"self_type" : "_ZTI21$FIRST_ANONYMOUS_ENUM", "self_type" : "_ZTI21$FIRST_ANONYMOUS_ENUM",
"size" : 4, "size" : 4,
@@ -92,7 +92,7 @@
} }
], ],
"linker_set_key" : "_ZTIN3$_22$BE", "linker_set_key" : "_ZTIN3$_22$BE",
"name" : "(unnamed struct at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:9:1)::(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:10:3)", "name" : "(unnamed)::(unnamed)",
"referenced_type" : "_ZTIN3$_22$BE", "referenced_type" : "_ZTIN3$_22$BE",
"self_type" : "_ZTIN3$_22$BE", "self_type" : "_ZTIN3$_22$BE",
"size" : 4, "size" : 4,
@@ -113,7 +113,7 @@
} }
], ],
"linker_set_key" : "_ZTIN3$_32$BE", "linker_set_key" : "_ZTIN3$_32$BE",
"name" : "(unnamed struct at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:9:1)::(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:10:3)", "name" : "(unnamed)::(unnamed)",
"referenced_type" : "_ZTIN3$_32$BE", "referenced_type" : "_ZTIN3$_32$BE",
"self_type" : "_ZTIN3$_32$BE", "self_type" : "_ZTIN3$_32$BE",
"size" : 4, "size" : 4,
@@ -140,7 +140,7 @@
], ],
"is_anonymous" : true, "is_anonymous" : true,
"linker_set_key" : "_ZTI3$_2", "linker_set_key" : "_ZTI3$_2",
"name" : "(unnamed struct at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:9:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI3$_2", "referenced_type" : "_ZTI3$_2",
"self_type" : "_ZTI3$_2", "self_type" : "_ZTI3$_2",
"size" : 4, "size" : 4,
@@ -157,7 +157,7 @@
], ],
"is_anonymous" : true, "is_anonymous" : true,
"linker_set_key" : "_ZTI3$_3", "linker_set_key" : "_ZTI3$_3",
"name" : "(unnamed struct at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:9:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI3$_3", "referenced_type" : "_ZTI3$_3",
"self_type" : "_ZTI3$_3", "self_type" : "_ZTI3$_3",
"size" : 4, "size" : 4,

View File

@@ -37,7 +37,7 @@
} }
], ],
"linker_set_key" : "_ZTI2$A", "linker_set_key" : "_ZTI2$A",
"name" : "(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:1:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI2$A", "referenced_type" : "_ZTI2$A",
"self_type" : "_ZTI2$A", "self_type" : "_ZTI2$A",
"size" : 1, "size" : 1,
@@ -54,7 +54,7 @@
} }
], ],
"linker_set_key" : "_ZTI2$B", "linker_set_key" : "_ZTI2$B",
"name" : "(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:5:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI2$B", "referenced_type" : "_ZTI2$B",
"self_type" : "_ZTI2$B", "self_type" : "_ZTI2$B",
"size" : 1, "size" : 1,
@@ -75,7 +75,7 @@
} }
], ],
"linker_set_key" : "_ZTIN3$_22$BE", "linker_set_key" : "_ZTIN3$_22$BE",
"name" : "(unnamed struct at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:9:1)::(unnamed enum at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:10:3)", "name" : "(unnamed)::(unnamed)",
"referenced_type" : "_ZTIN3$_22$BE", "referenced_type" : "_ZTIN3$_22$BE",
"self_type" : "_ZTIN3$_22$BE", "self_type" : "_ZTIN3$_22$BE",
"size" : 4, "size" : 4,
@@ -102,7 +102,7 @@
], ],
"is_anonymous" : true, "is_anonymous" : true,
"linker_set_key" : "_ZTI3$_2", "linker_set_key" : "_ZTI3$_2",
"name" : "(unnamed struct at development/vndk/tools/header-checker/tests/integration/cpp/anonymous_enum/include/golden.h:9:1)", "name" : "(unnamed)",
"referenced_type" : "_ZTI3$_2", "referenced_type" : "_ZTI3$_2",
"self_type" : "_ZTI3$_2", "self_type" : "_ZTI3$_2",
"size" : 4, "size" : 4,