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

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Fri Mar 21 01:20:15 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 03557169e0ad0fe6bdfc680473c5ebdeb63d9ddb
      https://github.com/llvm/llvm-project/commit/03557169e0ad0fe6bdfc680473c5ebdeb63d9ddb
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2025-03-21 (Fri, 21 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
    M bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s

  Log Message:
  -----------
  [BOLT] Gadget scanner: streamline issue reporting (#131896)

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