[PATCH] D49715: [analyzer] CallEvent: Add partially working methods for obtaining the callee stack frame.

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 12:05:55 PDT 2018


george.karpenkov requested changes to this revision.
george.karpenkov added a comment.
This revision now requires changes to proceed.

Minor nits mostly.



================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:411
+  /// for bad reasons, returning null, even in post-call of an inlined function.
+  AnalysisDeclContext *getCalleeAnalysisDeclContext() const;
+
----------------
Could we be more succinct here?
e.g. \return Best-effort getter for AnalysisDeclContext, returns null on failure.

Same for all the methods below.


================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:776
 
+public:
   /// If the given statement corresponds to an object under construction,
----------------
Could we group it with other public methods at the top?


================
Comment at: lib/StaticAnalyzer/Core/CallEvent.cpp:193
+  const Expr *E = getOriginExpr();
+  // We cannot lookup a CFG element without an origin-expression.
+  if (!E)
----------------
"we cannot have" comments seem redundant, it's usually implied by the code.
This one is up to you though.


================
Comment at: lib/StaticAnalyzer/Core/CallEvent.cpp:197
+
+  // Recover CFG block via reverse lookup. Maybe it should just be a part of the
+  // CallEvent object? That would have been convenient.
----------------
Can we remove "maybe" / "that would have been" comments?


Repository:
  rC Clang

https://reviews.llvm.org/D49715





More information about the cfe-commits mailing list