[PATCH] D38801: [analyzer] In getSVal() API, disable auto-detection of void type as char type.

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 30 04:01:14 PDT 2017


xazax.hun added a comment.

I like the idea of making `ProgramState::getSVal(const MemRegion *)` symmetric to `ProgramState::getSVal(Loc)`.

Just some philosophical questions which should probably be addressed in the future:
But also I wonder, should we maintain all these overloads? I mean, a lot of the APIs accept both `SVal`/`Loc` and `MemRegion *`. Usually, one of the implementations will end up just calling the other after some wrapping/unwrapping.  Maybe ripping `MemRegion *` from the APIs would make it easier to use? E.g.: CallAndMessageChecker just unwraps the region from an SVal just to wrap it back again within the API call. However, we tend to use `MemRegion *` when storing info in the program state.

Otherwise LGTM!



================
Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:307
   /// Returns the "raw" SVal bound to LV before any value simplfication.
   SVal getRawSVal(Loc LV, QualType T= QualType()) const;
 
----------------
The whitespace here is a bit off. I know it is not related to this patch, but this could be fixed if we already touch this file.


https://reviews.llvm.org/D38801





More information about the cfe-commits mailing list