[all-commits] [llvm/llvm-project] cf9baa: [BOLT] Gadget scanner: streamline issue reporting

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Tue Mar 18 12:19:26 PDT 2025


  Branch: refs/heads/users/atrosinenko/bolt-gs-streamline-issue-reporting
  Home:   https://github.com/llvm/llvm-project
  Commit: cf9baa5d67b1ba5a492591fc7af337a57756fb58
      https://github.com/llvm/llvm-project/commit/cf9baa5d67b1ba5a492591fc7af337a57756fb58
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2025-03-18 (Tue, 18 Mar 2025)

  Changed paths:
    R bolt/include/bolt/Passes/NonPacProtectedRetAnalysis.h
    A bolt/include/bolt/Passes/PAuthGadgetScanner.h
    M bolt/lib/Passes/CMakeLists.txt
    R bolt/lib/Passes/NonPacProtectedRetAnalysis.cpp
    A bolt/lib/Passes/PAuthGadgetScanner.cpp
    M bolt/lib/Rewrite/RewriteInstance.cpp
    M bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
    M bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s

  Log Message:
  -----------
  [BOLT] Gadget scanner: streamline issue reporting

In preparation for adding more gadget kinds to detect, streamline
issue reporting.

Rename classes representing issue reports. In particular, rename
`Annotation` base class to `Report`, as it has nothing to do with
"annotations" in `MCPlus` terms anymore. Remove references to "return
instructions" from variable names and report messages, use generic
terms instead. Rename NonPacProtectedRetAnalysis to PAuthGadgetScanner.

Remove `GeneralDiagnostic` as a separate class, make `GenericReport`
(former `GenDiag`) store `std::string Text` directly. Remove unused
`operator=` and `operator==` methods, as `Report`s are created on the
heap and referenced via `shared_ptr`s.

Introduce `GadgetKind` class - currently, it only wraps a `const char *`
description to display to the user. This description is intended to be
a per-gadget-kind constant (or a few hard-coded constants), so no need
to store it to `std::string` field in each report instance. To handle
both free-form `GenericReport`s and statically-allocated messages
without unnecessary overhead, move printing of the report header to the
base class (and take the message argument as a `StringRef`).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list