[PATCH] D15448: [analyzer] SVal Visitor.

Anna Zaks via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 15 17:09:31 PST 2015


zaks.anna added a comment.

Can/Should something like this be used when dumping SVals (during debugging)? (Possibly in addition to the debug checker.)
What are the advantages of implementing this using visitors? Can this be implemented similarly to SVal::dumpToStream? Do you envision other use cases for the visitors?

A couple of suggestions regarding the implementation of the visitors if we decide to keep them.
You should either use http://llvm.org/docs/TableGen/ like ./include/clang/AST/DeclVisitor.h or even better use something similar to https://github.com/apple/swift/blob/master/include/swift/AST/ExprNodes.def and it's users.


================
Comment at: include/clang/StaticAnalyzer/Checkers/SValExplainer.h:88
@@ +87,3 @@
+  std::string VisitNonLocLazyCompoundVal(nonloc::LazyCompoundVal V) {
+    return "frozen compound value of " + Visit(V.getRegion());
+  }
----------------
Using a different name here could lead to confusion.


http://reviews.llvm.org/D15448





More information about the cfe-commits mailing list