Szelethus added inline comments.
================ Comment at: lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp:36 + const ProgramStateRef PS; + SValBuilder &SVB; + ---------------- NoQ wrote: > ZaMaZaN4iK wrote: > > Szelethus wrote: > > > You can acquire `SValBuilder` from `ProgramState`: > > > `PS->getStateManager()->getSvalBuilder()` > > Is there any difference? Is it critical to get `SValBuilder` from > > `CheckerContext' ? > There's only one instance of `SValBuilder` in existence at any particular > moment of time. The same applies to `BasicValueFactory`, `SymbolManager`, > `MemRegionManager`, `ConstraintManager`, `StoreManager`, > `ProgramStateManager`, ... > > All these objects live within `ExprEngine` and have the same lifetime. > > `ExprEngine`, together with all these objects, is created from scratch for > every analysis of a top-level function. > > AST entities, such ast `ASTContex`, on the contrary, live much longer - only > one is created per clang process. That is, until somebody takes `ASTImporter` > and tries to frankenstein multiple ASTs into one :) Then I guess no, it's not critical. ^-^ https://reviews.llvm.org/D33672 _______________________________________________ cfe-commits mailing list [email protected] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
