diff --git a/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp b/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp index dd654cc38..435d0a858 100644 --- a/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp +++ b/vndk/tools/header-checker/header-abi-dumper/src/abi_wrappers.cpp @@ -156,14 +156,10 @@ std::string RecordDeclWrapper::GetMangledRTTI( std::string ABIWrapper::GetTypeUniqueId(const clang::TagDecl *tag_decl) { clang::QualType qual_type = tag_decl->getTypeForDecl()->getCanonicalTypeInternal(); - // We need to mangle type names for C++ contexts. - if (!tag_decl->isExternCContext() && ast_contextp_->getLangOpts().CPlusPlus) { - llvm::SmallString<256> uid; - llvm::raw_svector_ostream out(uid); - mangle_contextp_->mangleCXXRTTIName(qual_type, out); - return uid.str(); - } - return ABIWrapper::QualTypeToString(qual_type); + llvm::SmallString<256> uid; + llvm::raw_svector_ostream out(uid); + mangle_contextp_->mangleCXXRTTIName(qual_type, out); + return uid.str(); } // CreateBasicNamedAndTypedDecl creates a BasicNamedAndTypedDecl : that'll diff --git a/vndk/tools/header-checker/tests/expected/example1.cpp b/vndk/tools/header-checker/tests/expected/example1.cpp index d1f79a497..0a72db531 100644 --- a/vndk/tools/header-checker/tests/expected/example1.cpp +++ b/vndk/tools/header-checker/tests/expected/example1.cpp @@ -204,7 +204,7 @@ record_types { is_anonymous: true record_kind: struct_kind tag_info { - unique_id: "Hello::(anonymous)::(anonymous)" + unique_id: "_ZTSN5HelloUt1_Ut_E" } } record_types { @@ -238,7 +238,7 @@ record_types { is_anonymous: true record_kind: struct_kind tag_info { - unique_id: "Hello::(anonymous)" + unique_id: "_ZTSN5HelloUt1_E" } } record_types { @@ -289,7 +289,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Hello" + unique_id: "_ZTS5Hello" } } record_types { diff --git a/vndk/tools/header-checker/tests/expected/example1.h b/vndk/tools/header-checker/tests/expected/example1.h index d1f79a497..0a72db531 100644 --- a/vndk/tools/header-checker/tests/expected/example1.h +++ b/vndk/tools/header-checker/tests/expected/example1.h @@ -204,7 +204,7 @@ record_types { is_anonymous: true record_kind: struct_kind tag_info { - unique_id: "Hello::(anonymous)::(anonymous)" + unique_id: "_ZTSN5HelloUt1_Ut_E" } } record_types { @@ -238,7 +238,7 @@ record_types { is_anonymous: true record_kind: struct_kind tag_info { - unique_id: "Hello::(anonymous)" + unique_id: "_ZTSN5HelloUt1_E" } } record_types { @@ -289,7 +289,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Hello" + unique_id: "_ZTS5Hello" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump index e11393cf2..be5232193 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump index 66e8cf32d..76367c4be 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/arm/libc_and_cpp_with_unused_struct.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump index 81f71f8de..358c99667 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump index e276c0d75..012c760fa 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/arm64/libc_and_cpp_with_unused_struct.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump index e11393cf2..be5232193 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump index 66e8cf32d..76367c4be 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/mips/libc_and_cpp_with_unused_struct.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump index 81f71f8de..358c99667 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump index e276c0d75..012c760fa 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/mips64/libc_and_cpp_with_unused_struct.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump index e11393cf2..be5232193 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump index 66e8cf32d..76367c4be 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/x86/libc_and_cpp_with_unused_struct.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump index 81f71f8de..358c99667 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types { diff --git a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump index e276c0d75..012c760fa 100644 --- a/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump +++ b/vndk/tools/header-checker/tests/reference_dumps/x86_64/libc_and_cpp_with_unused_struct.so.lsdump @@ -16,7 +16,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cinner" + unique_id: "_ZTS6Cinner" } } record_types { @@ -43,7 +43,7 @@ record_types { access: public_access record_kind: struct_kind tag_info { - unique_id: "Cstruct" + unique_id: "_ZTS7Cstruct" } } record_types {