The "name" fields of anonymous types contain the source paths. This
commit changes them to relative paths.
Test: ./test.py
Bug: 154177636
Change-Id: I1b8e0272acf32f078f0d980dad97b9dda0731e88
This commit adds --root-dir as a parameter to the ABI tools. It defaults
to current working directory. The source_file fields in the dump files
are relative to the root dir, so the file content doesn't depend on the
absolute path to Android source tree.
Test: ./header-checker-unittests
Test: ./test.py
Bug: 154177636
Change-Id: Ia07d0d3b913c921e9e91ea01c4f1e9c3c62c6ea9
The definitions of anonymous enums are stored in "enum_types" entry in
lsdump files. The linker_set_key for an anonymous enum consists of the
enclosing scopes and the lexicographically smallest field.
Bug: 141709599
Test: ./test.py
Change-Id: I4cecfd593e29c5432af6847de2429350a4178842
This commit removes type_id and replace them with linker_set_key so
that a more deterministic output can be generated.
This should improve the human-readability of the ABI dump files.
Bug: 74764811
Bug: 109867439
Test: ./tests/test.py
Change-Id: I15df481058c5be6820189b1e60726cefd59d4d5f
This commit removes unique_id because it seems that there are some
overlapping between unique_id and linker_set_key. Furthermore, this
helps us centralize type ID related code.
Bug: 74764811
Test: ./tests/test.py
Test: lunch walleye-userdebug && make
Change-Id: Ie7a27a428f9f8d729134047debc05d5a597e2452
This commit redirects header-abi-dumper output to ModuleIR and then
write ModuleIR with `IRDumper::Dump(module)`. This decouples ABI
information extraction from IRDumper and allows post-processing ModuleIR
before writing to files.
This commit also sorts the reference test data.
Test: ./tests/test.py
Change-Id: Ibc7a9a94c08df496ff76351f951170bddc1a66a9
This commit removes "is_inlined" flag from lsdump's VTableComponent,
because the clang library used to walk the ast doesn't report accurate
information about whether a member function is inlined or not.
Also update the testcases.
Bug: 80217511
Test: ./tests/test.py
Change-Id: I0e133b140a4f3debff8030de7d6712590cf98d76
- abi_dump.proto: Adds is_inlined and is_pure flag to VTableComponent.
is_inlined means a virtual function is inlined and probably not exported.
is_pure means a virtual function is pure and probably not exported.
Bug: 80217511
Test: ./tests/test.py
Change-Id: Ic1562ed47faba1f3d7eec6dffe94991296ba7176
Function signatures produced by header-abi-dumper should specify which
parameters are 'this'.
Bug: 72697345
Test: tests/test.py
Change-Id: I18a1f974e1530b6caa8f081dcd2101616ba3dc19
- Use 'anonymous at <source>:<line>:<column>' as a name for anonymous records
within a translation unit
- Don't depend on clang's getFullyQualifiedName() for computing type-ids since
it isn't reliable (can miss out qualification of template parameters).
Factor in the final destination type, i.e either built-in type name or
tag type mangledCXXRTTI name. This is an internal name and not exposed
through intermediate .sdump files, so should not affect backwards
compatibility.
Bug: 77649155
Test: tests/test.py
Change-Id: I8890cc59fbe24fb6083e191d69be7fff45b51861
Also use non-mangled name for C structs and enums as their unique id.
We do this as attempt to protect against bugs similar to those mentioned
in https://android-review.googlesource.com/c/platform/external/clang/+/599002
which might not have been discovered yet.
Bug: 71486971
Test: Build android source tree for aosp_arm64_ab with -no-filter on
header-abi-dumper.
Test: tests/test.py
Change-Id: I3e25425d9f3015cd7dece3bd5a27f88e050c1acb
Some structs could be included without extern "C" guards. If the same
struct is included in a C++ source file and a C source file, it's unique
type name will be mangled in one and its name in the other. To work
around this inconsistency, mangle their names regardless of context.
Bug: 69568963
Test: tests/test.py
Change-Id: Ie285c4691dbaa58389a041fee5116ccbfc7985ce
libclang's getFullyQualifiedName API can miss default template arguments
and sometimes does not fully qualify template parameters as well. So for
type uniquing, use the API used by LLVM for TBAA : mangleCXXRTTIName.
Test: tests/test.py, all tests pass.
Bug: 69568963
Change-Id: Ibc97f5d3b0a1cb0eeed5f5df3e9c373bcb9573b4
1) We do not involve the build system to create test reference dumps. Symbols
in tests, are faked through version scripts to avoid checking in prebuilt .so
test files.
2) Also add a script to create reference abi dumps.
3) Fix a comment in ast_processing.cpp
Test: Run tests/test.py, all tests run and pass on generic arm64, mips64
and x86_64 builds.
Change-Id: Id3a420c1ae093a05a79da4c29e85071f28d714d1