[clang] [analyzer] Introduce the check::BlockEntrance checker callback (PR #140924)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon May 26 12:26:55 PDT 2025


================
@@ -166,6 +179,23 @@ class CheckerDocumentation
   /// check::Bind
   void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &) const {}
 
+  /// Called after a CFG edge is taken within a function.
+  ///
+  /// This callback can be used to obtain information about potential branching
+  /// points or any other constructs that involve traversing a CFG edge.
+  /// Note that when inlining a call, there is no CFG edge between the caller
+  /// and the callee. One will only see the edge between the entry block and
+  /// the body of the function once inlined.
----------------
NagyDonat wrote:

Thanks for clarifying this! You're right that it's important to document this peculiarity of our graph (there is no BlockEdge from the caller to the callee + there is a BlockEdge from the imaginary entry block) and it would be very nice if you could squeeze something like this review comment into the source comment as well :smile: 

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


More information about the cfe-commits mailing list