[PATCH] D42300: [Analyzer] Add PreStmt and PostStmt callbacks for OffsetOfExpr

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 11:31:03 PST 2018

NoQ added a comment.

The patch seems correct, but i suspect that your overall approach to the checker you're trying to make is not ideal. `offsetof` returns a concrete value (because, well, symbolic `offsetof`s are not yet supported in the analyzer), and even if you see the concrete value, you'd be unable to track it, because when you get another concrete value with the same integer inside, you won't be able to easily figure out if its the same value or a different value. My intuition suggests that this checker shouldn't be path-sensitive; our path-sensitive analysis does very little to help you with this particular checker, and you might end up with a much easier and more reliable checker if you turn it into a simple AST visitor or an AST matcher. Just a heads up.

  rC Clang


More information about the cfe-commits mailing list