[PATCH] D34275: [analyzer] Re-implemente current virtual calls checker in a path-sensitive way

wangxin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 14 10:05:34 PDT 2017


wangxindsb marked 5 inline comments as done.
wangxindsb added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp:72
+REGISTER_MAP_WITH_PROGRAMSTATE(CtorMap, const MemRegion *, bool)
+REGISTER_MAP_WITH_PROGRAMSTATE(DtorMap, const MemRegion *, bool)
+
----------------
xazax.hun wrote:
> I was wondering if there is another way to represent the state.
> We could have a two element (bool based) enum class like:
> ```
> enum class ObjectState : bool {
>   CtorCalled,
>   DtorCalled
> };
> ```
> 
> Se we could have only one map in the GDM. Either the destructor is called for an object or the constructor.  Or in case none of them is called on a path, the state is empty. What do you think? 
> 
Yes, it's better than the previous two maps.


https://reviews.llvm.org/D34275





More information about the cfe-commits mailing list