[llvm] [BOLT] Gadget scanner: analyze functions without CFG information (PR #133461)

Kristof Beyls via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 05:32:36 PDT 2025


================
@@ -265,21 +286,24 @@ void PacStatePrinter::print(raw_ostream &OS, const State &S) const {
   OS << ">";
 }
 
-class PacRetAnalysis
-    : public DataflowAnalysis<PacRetAnalysis, State, /*Backward=*/false,
-                              PacStatePrinter> {
-  using Parent =
-      DataflowAnalysis<PacRetAnalysis, State, false, PacStatePrinter>;
-  friend Parent;
-
+class PacRetAnalysis {
----------------
kbeyls wrote:

Naming is hard of course, but I'm wondering if the name of this class `PacRetAnalysis` could be improved somehow? Or would it be possible to add a comment of what it does?
My understanding is that this is effectively a base class now (since it has non-implemented virtual functions).
IIUC, this class has the functionality that is common between 2 concrete PacRet analysis classes:
. 1 that analyzes on a CFG, using the dataflow analysis framework
. 1 that analyzes a BinaryFunction when a CFG is not present, not using the dataflow analysis.

If my understanding as described above is correct, it might be helpful to have a comment explaining something similar.

https://github.com/llvm/llvm-project/pull/133461


More information about the llvm-commits mailing list