aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
3 daysMerge branch 'upstream-main' into 'main'HEADmastermainGiuliano Procida
* aosp/upstream-main: rust: add test where discriminant is offset from beginning in the variant data layout rust: add test with variant having a single member rust: add test with an empty enum and optional empty enum rust: model `Variant` discriminant as an optional member DWARF processor: fix whitespace in conditional expression Signed-off-by: Giuliano Procida <gprocida@google.com> Change-Id: Iec16ca936eb08da2c5e4a6423ce739c95592b191
3 daysrust: add test where discriminant is offset from beginning in the variant ↵upstream-mainSid Nayyar
data layout This is an optimisation which the Rust compiler can make by overlapping the discriminant with variant members data locations while exploiting bit patterns which would be illegal for the variant members. PiperOrigin-RevId: 635414233 Change-Id: I5da9db7326dfea4756b8edebd19fa8e6c30ea30a
3 daysrust: add test with variant having a single memberSid Nayyar
This exercises the DWARF processor in the case where there is no need for a discriminator at all. PiperOrigin-RevId: 635401909 Change-Id: I53a72c11e7b2df3cce33e987544ff31b90ac1fb7
3 daysrust: add test with an empty enum and optional empty enumSid Nayyar
PiperOrigin-RevId: 634747075 Change-Id: Ic28a6c6e33f0b996f16563c980092473d4a02ecd
3 daysrust: model `Variant` discriminant as an optional memberSid Nayyar
The Rust compiler can choose to place the discriminant at non-zero offset in the data layout of a variant. Moreover, the discriminant can completely be absent in cases where there is zero or only one possible value of the discriminant. Lastly, the Rust compiler can optimise for space by letting the discriminant overlap with the variant members data location by using values which would be illegal for the members. Therefore, it makes sense to model the discriminant as an optional `Member` node for the `Variant` node. PiperOrigin-RevId: 634746801 Change-Id: I0a20d1766570f312c4e3415229da83b7cffe04ea
9 daysDWARF processor: fix whitespace in conditional expressionGiuliano Procida
PiperOrigin-RevId: 633605510 Change-Id: I056deaf06caeb586796e25cfc7a6b156b431d5fd
10 daysMerge branch 'upstream-main' into 'main'Giuliano Procida
* aosp/upstream-main: DWARF processor: handle DW_TAG_GNU_formal_parameter_pack DIEs rust: delegate DWARF processing for `variant_part` to variant DWARF processor rust: add DWARF processor for `Variant` node rust: add DWARF processor for `VariantMember` nodes Signed-off-by: Giuliano Procida <gprocida@google.com> Change-Id: I0d3cf9167a0c6edc43f4a8c60bb428d9ea602bab
10 daysDWARF processor: handle DW_TAG_GNU_formal_parameter_pack DIEsGiuliano Procida
These DIEs may contain children which should be processed in the context of determining the type of a variadic template function. PiperOrigin-RevId: 633510535 Change-Id: Icf9b3d88483332440b76d1a2ec7adb413ebe6241
10 daysrust: delegate DWARF processing for `variant_part` to variant DWARF processorSid Nayyar
Since variant DWARF processor adds a node for the variant itself, return from the struct/union DWARF processor without adding any nodes. PiperOrigin-RevId: 633252963 Change-Id: I1ce3086ed5b2ab0324288a1f3e50b5d316c51457
10 daysrust: add DWARF processor for `Variant` nodeSid Nayyar
PiperOrigin-RevId: 633252091 Change-Id: I43e3505248fd79fab67efa890d141e4a430e76dd
10 daysrust: add DWARF processor for `VariantMember` nodesSid Nayyar
PiperOrigin-RevId: 633199025 Change-Id: I2089b60947382dcd06539b43f7126a6dc44ff381
2024-05-10Merge branch 'upstream-main' into 'main'Giuliano Procida
* aosp/upstream-main: CMake build: add dependency version information CMake build: add check for Linux UAPI headers rust: add a test case for tagged enum with negative discriminant Signed-off-by: Giuliano Procida <gprocida@google.com> Change-Id: I565348756b71a48c1a87e7682382725c8176f627
2024-05-10CMake build: add dependency version informationGiuliano Procida
* CMake: 3.14 is some years old and supports everything we need * elfutils: 0.189 contains an interface we contributed and need * libxml: 2.9 is an older version supporting everything we need * Linux UAPI: 5.19 has the BTF node definition for enum64 types * Protocol Buffers: the repeated field header files are in 3.19 * jemalloc: 5 is the current major version and is in common use * Catch: versions 2 and 3 are not compatible and we are using 2 PiperOrigin-RevId: 632388642 Change-Id: Ic58d0b01997f5a640e1e42cedabdd4bf366ca767
2024-05-10CMake build: add check for Linux UAPI headersGiuliano Procida
The header `<linux/btf.h>` contains BTF node definitions. PiperOrigin-RevId: 632388465 Change-Id: I51cd5937e35536e9224baebe8d658bd98791d36b
2024-05-10rust: add a test case for tagged enum with negative discriminantSid Nayyar
PiperOrigin-RevId: 630052456 Change-Id: Ie9240303cf8427edcf73eca2459ab4a25d9d0109
2024-04-25Merge branch 'upstream-main' into 'main'Giuliano Procida
* aosp/upstream-main: CMake: express current dependency on Catch2 v2 proto writer: take references to key/value pairs in ID mapping loop rust: add test case for rust tagged enums comparison: use a cleaner enum for Ignore options rust: add `Variant` node rust: add `VariantMember` node rust: add info test for member functions in Rust enums test suite: rename Abigail reader input files to `<test-name>_<language>.xml` Signed-off-by: Giuliano Procida <gprocida@google.com> Change-Id: Ie3d7a6e3c84586328b4e1b5edb297090381ec7b0
2024-04-25CMake: express current dependency on Catch2 v2Giuliano Procida
This is needed to prevent compilation errors on systems where Catch2 has been upgraded to v3. PiperOrigin-RevId: 628152977 Change-Id: I9ecfbb502d2173f45611ac2bd0ef7a03f4d5f70e
2024-04-25proto writer: take references to key/value pairs in ID mapping loopGiuliano Procida
This inhibits compiler warnings about copying. PiperOrigin-RevId: 628145549 Change-Id: I3ec78035affdb34f8a1b70f419e44de89f4002a7
2024-04-25rust: add test case for rust tagged enumsSid Nayyar
PiperOrigin-RevId: 628050972 Change-Id: I856ffb8f0e5c743d1fecb2e29ce7708f60a58307
2024-04-25comparison: use a cleaner enum for Ignore optionsGiuliano Procida
We lose the automatically-sized bitset type but gain not having to maintain a list of powers of 2. PiperOrigin-RevId: 625696627 Change-Id: Ibd6f3f6311e1a16be37cc5d2e209773500020858
2024-04-25rust: add `Variant` nodeSid Nayyar
These nodes will be used to represent 'fieldful' or tagged Rust enums. STG Rust ABI representation is unstable and is not yet subject to format versioning. PiperOrigin-RevId: 625282784 Change-Id: Ife43024161f7d47cc98584c1f9d7afd08f08a345
2024-04-25rust: add `VariantMember` nodeSid Nayyar
These nodes will be used to represent members of 'fieldful' or tagged Rust enums. STG Rust ABI representation is unstable and is not yet subject to format versioning. PiperOrigin-RevId: 625281842 Change-Id: I67a9a694c01d144b7942eef15921a5ca6050fccf
2024-04-25rust: add info test for member functions in Rust enumsSid Nayyar
PiperOrigin-RevId: 621878723 Change-Id: I48f439a4cb2f4d00c3dd27d0eff20d40f581b5ae
2024-04-25test suite: rename Abigail reader input files to `<test-name>_<language>.xml`Sid Nayyar
This will make the input file name format for abigail reader tests consistent with expectation files and test names. Furthermore, this will allow language names to the folded into test names and therefore get rid of string manipulation to determine input file names. PiperOrigin-RevId: 617497701 Change-Id: Id8172d882725c787610ec01aea41d6fc823be9ad
2024-03-08Merge branch 'upstream-main' into 'main'Giuliano Procida
* aosp/upstream-main: DWARF processor: do not apply file filters to types in Rust objects DWARF processor: add language awareness to STG DWARF processor DWARF wrappers: add DWARF getter for mandatory attributes order: rework ExtendOrder as CombineOrders order: fix vector reservations in `Reorder` order test: make some order combination tests a bit clearer order test: rename local variables for clarity order: tweak order merging to prefer second sequence test suite: all expected STG output files are now annotated proto: add an option to print annotations for STG output naming: emit method type instead of mangled name proto writer: fix created file permissions proto writer: add annotating printer for fields denoting IDs proto writer: add method returning a mapping from external to internal IDs proto writer: print directly to a zero copy file output stream proto writer: move printing code into `Writer::Write` method Signed-off-by: Giuliano Procida <gprocida@google.com> Change-Id: I655cfd11fb8ba2a073378306fb6051972c8ca267
2024-03-08DWARF processor: do not apply file filters to types in Rust objectsSid Nayyar
Rust does not have incomplete types. Therefore it does not make sense to filter type information for Rust types. PiperOrigin-RevId: 613908280 Change-Id: Idd486e1912a01749c4760765f3438f2dbdd0e365
2024-03-08DWARF processor: add language awareness to STG DWARF processorSid Nayyar
This will enable STG to selectively apply file filters based on the language of the current compilation unit being processed. PiperOrigin-RevId: 613908095 Change-Id: I47edda1caf40c57cba8e7077687aec5fc6d53484
2024-03-08DWARF wrappers: add DWARF getter for mandatory attributesSid Nayyar
It is a common pattern in DWARF processor to get an optional value and check for its presence. This helper checks for the presence and directly returns the underlying value, eliminating the need to check for presence check by the user. PiperOrigin-RevId: 613907941 Change-Id: Idddd9694f665935fc2b12fce161d85ab3250e324
2024-03-08order: rework ExtendOrder as CombineOrdersGiuliano Procida
The algorithm is essentially the same, but now expressed as something that greedily interleaves items unique to the first input sequence between subsequences of the second input sequence, each either ending with an item from the first input sequence or the last item from the second input sequence. Code changes: * inputs are immutable * separate result vector sized to known number of unique indexes * quadratic worst case cost of insertions eliminated * comments updated and expanded PiperOrigin-RevId: 609342492 Change-Id: I020efec49231cc7a7f4de4ab9af9c244b266e414
2024-03-08order: fix vector reservations in `Reorder`Giuliano Procida
This was missed as part of the previous change which swapped the roles of `indexes1` and `indexes2`. PiperOrigin-RevId: 609340194 Change-Id: I8f5e9a883ac541e9f4c48e48341f6863973041d7
2024-03-08order test: make some order combination tests a bit clearerGiuliano Procida
* move initialisation of combined ordering closer to use * simplify one check PiperOrigin-RevId: 609309062 Change-Id: I8fbf2c53c964e9d94ab0b8a0c5a292f691e85fe2
2024-03-08order test: rename local variables for clarityGiuliano Procida
PiperOrigin-RevId: 609308829 Change-Id: Id008f7dcffa498b5bc85afc2353d3caeb84bfe45
2024-03-08order: tweak order merging to prefer second sequenceGiuliano Procida
The order functionality is used in the presentation of diffs of sequences. If there is a source code change from ``` struct s { int x; }; ``` to ``` struct s { long y; }; ``` then STG will now present this as the removal of `x` followed by the addition of `y` (instead of the other way around). This is how `diff(1)` presents things. The change also affects how permutations of sequences are presented. With the change from ``` struct s { int x; long y; }; ``` to ``` struct s { long y; int x; }; ``` STG will now mention the change of offset of `y` before that of `x` (instead of the other way around). These examples seem to be in opposition, but the consistent behaviour is that STG now preserves the order of the second sequence and greedily emits elements from the first sequence that respect this (instead of the other way around). Insertions, removals and renamings are more common than reorderings. This change pragmatically favours a more familiar presentation order for the more common cases. PiperOrigin-RevId: 609069142 Change-Id: I0b81cc1d9b115584241976a23921a67e5ebf1a8d
2024-03-08test suite: all expected STG output files are now annotatedSid Nayyar
PiperOrigin-RevId: 608943654 Change-Id: I57a7066f4e2c7c37e37d33db484417023f875e15
2024-03-08proto: add an option to print annotations for STG outputSid Nayyar
Collect field descriptors for all edges in STG, which are used to register the `AnnotationPrinter` for fields which represent edges. Also, add `--annotate` option description to STG documentation. PiperOrigin-RevId: 608939591 Change-Id: I40378866aaaed78087609c5326ec282758626e7f
2024-03-08naming: emit method type instead of mangled nameGiuliano Procida
The type is more useful and meaningful in the context of virtual methods than the mangled name. PiperOrigin-RevId: 608643576 Change-Id: I9fdd9eee4df9ff89eb702b045335c57689ae28b7
2024-03-08proto writer: fix created file permissionsSid Nayyar
Following the change to use protobuf zero copy output streams, files were being created with no group or other permissions, regardless of umask. We now pass `0666` to `open(2)`. PiperOrigin-RevId: 608588716 Change-Id: I92d5bdf98966e063f698ba09d4fd8b3ee258e3f2
2024-03-08proto writer: add annotating printer for fields denoting IDsSid Nayyar
PiperOrigin-RevId: 608373406 Change-Id: I97652db17e9ff3012beb9a0bf15a55177cc49f26
2024-03-08proto writer: add method returning a mapping from external to internal IDsSid Nayyar
This mapping in the STG proto transformer will be used to describe STG graph nodes, using their external IDs for edge annotation. Also rename external ID map for better code clarity. PiperOrigin-RevId: 608373212 Change-Id: I5da4cd3f1dcd2932a73787df76ca1b99af7923ea
2024-03-08proto writer: print directly to a zero copy file output streamSid Nayyar
This avoids serialisation to an intermediate string and can save ~10% of the time taken writing STG output. PiperOrigin-RevId: 608373030 Change-Id: I67ec7e00b93180e970d3ccbd3559790bde2b83b0
2024-03-08proto writer: move printing code into `Writer::Write` methodSid Nayyar
There are going to be too many parameters for the `Print` function with annotations. Since there is no advantage to abstract the printing code out, it was better to pull it into `Writer::Write` method. PiperOrigin-RevId: 608355274 Change-Id: I72d29f7bedb81f2a434847f354f643309cfcb1a1
2024-02-12Merge "Turn off native coverage for stg to prevent duplicate symbol error." ↵Yu Liu
into main am: eb4bb7c513 Original change: https://android-review.googlesource.com/c/platform/external/stg/+/2877294 Change-Id: Idfda23d3f8cfb5e818be84c7c79f4d6822500645 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-12Merge "Turn off native coverage for stg to prevent duplicate symbol error." ↵Yu Liu
into main
2024-02-12Merge branch 'upstream-main' into 'main' am: 90a10e1c32Giuliano Procida
Original change: https://android-review.googlesource.com/c/platform/external/stg/+/2953234 Change-Id: Ic5d0e501cf28d190182be1e3f3737d0482e25bd5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-09Merge branch 'upstream-main' into 'main'Giuliano Procida
* aosp/upstream-main: DWARF processor: always pass short type name to type definition filter check DWARF processor: Process member functions of enums Always format zero as hex with a leading 0x proto: Use more appropriate data type for bytesize of primitive type nodes Abigail reader: add corpus group test runtime: rename files metrics.* to runtime.* rename Metrics to Runtime and put runtime function parameters first sort header include directives consistently use auto for results returned by Graph::Apply deduplication.cc: include more things abigail_reader.cc: fix parameter whitespace in SetAttribute make local values and references const where possible make all Time objects const Abigailed reader: compare against nullptr in a couple of places metrics_test.cc: do not include <cstdint> abigail_reader.cc: do not include <iomanip> fingerprint.cc: include <cstdint> stgdiff.cc: add missing includes Abigail reader test: fix order of #includes metrics: emit or discard metrics immediately metrics: make Metrics responsible for output DWARF processor: better missing type declaration file error message DWARF processor: always pass full type name to type definition filter check DWARF processor: use consistent type name variable names DWARF processor: Ignore DWARF entries related to Rust enum features DWARF processor: give some locals more precise types DWARF processor: rename GetIdForReferredType to GetReferredTypeId Cleanup: Put methods before members in function object definitions test cases: add template template parameter test test cases: add template value parameter test metrics test: make metrics object const in empty test metrics: eliminate `operator<<` overload for Standard Library types metrics test: slightly nicer bulk time metrics metrics: make all the metric types immovable metrics test: avoid copying Time values in test Change-Id: I3f5a9a8ff11491bc7f3ba9e967ac89e45ba15a10 Signed-off-by: Giuliano Procida <gprocida@google.com>
2024-02-09DWARF processor: always pass short type name to type definition filter checkGiuliano Procida
The name is currently only used for diagnostics and for checking for rare built-in types when the declaration file attribute is missing. Contrary to previous expectations, the rare built-in types can be in the `std` namespace. The check looks for `__` as a prefix to determine whether a type is built in. PiperOrigin-RevId: 605634489 Change-Id: I05579facc10fbb8bd01ab9a90ed6c6a0858c97b4
2024-02-09DWARF processor: Process member functions of enumsSid Nayyar
PiperOrigin-RevId: 605594047 Change-Id: I48a954a2fdeaaa347de54d4c9fbd3274854411e5
2024-02-09Always format zero as hex with a leading 0xGiuliano Procida
The standard library's `std::setbase` specifies special behaviour for zero (no leading `0x`). Clang doesn't follow the standard, but GCC does. This change avoids both the problem of unexpected (but standards-compliant) output with GCC and the inconsistency between the two toolchains. PiperOrigin-RevId: 604344160 Change-Id: I320fd033f291b887e53ee4dc2723615458da0f3e
2024-02-09proto: Use more appropriate data type for bytesize of primitive type nodesSid Nayyar
`fixed32` type should only be used for fields which hold node Ids. PiperOrigin-RevId: 604271986 Change-Id: If933e0aa41bdf70da0a0ac708b5b16bf38eca1ac
2024-02-09Abigail reader: add corpus group testGiuliano Procida
PiperOrigin-RevId: 603323786 Change-Id: Ibbaa02b9d541b2ba92c4bdd9f59e0425b54bd0e8