Skip to content
  1. Feb 06, 2010
  2. Jan 25, 2010
    • Ted Kremenek's avatar
      Split libAnalysis into two libraries: libAnalysis and libChecker. · d6b87086
      Ted Kremenek authored
      (1) libAnalysis is a generic analysis library that can be used by
          Sema.  It defines the CFG, basic dataflow analysis primitives, and
          inexpensive flow-sensitive analyses (e.g. LiveVariables).
      
      (2) libChecker contains the guts of the static analyzer, incuding the
          path-sensitive analysis engine and domain-specific checks.
      
      Now any clients that want to use the frontend to build their own tools
      don't need to link in the entire static analyzer.
      
      This change exposes various obvious cleanups that can be made to the
      layout of files and headers in libChecker.  More changes pending.  :)
      
      This change also exposed a layering violation between AnalysisContext
      and MemRegion.  BlockInvocationContext shouldn't explicitly know about
      BlockDataRegions.  For now I've removed the BlockDataRegion* from
      BlockInvocationContext (removing context-sensitivity; although this
      wasn't used yet).  We need to have a better way to extend
      BlockInvocationContext (and any LocationContext) to add
      context-sensitivty.
      
      llvm-svn: 94406
      d6b87086
  3. Jan 11, 2010
  4. Jan 09, 2010
  5. Jan 05, 2010
  6. Dec 17, 2009
  7. Dec 16, 2009
  8. Dec 14, 2009
  9. Dec 11, 2009
  10. Dec 07, 2009
    • Ted Kremenek's avatar
      Add analysis support for blocks. This includes a few key changes: · 04af9f20
      Ted Kremenek authored
      - Refactor the MemRegion hierarchy to distinguish between different StackSpaceRegions for locals and parameters.
      - VarRegions for "captured" variables now have the BlockDataRegion as their super region (except those passed by reference)
      - Add transfer function support to GRExprEngine for BlockDeclRefExprs.
      
      This change also supports analyzing blocks as an analysis entry point
      (top-of-the-stack), which required pushing more context-sensitivity
      around in the MemRegion hierarchy via the use of LocationContext
      objects.  Functionally almost everything is the same, except we track
      LocationContexts in a few more areas and StackSpaceRegions now refer
      to a StackFrameContext object.  In the future we will need to modify
      MemRegionManager to allow multiple StackSpaceRegions in flight at once
      (for the analysis of multiple stack frames).
      
      llvm-svn: 90809
      04af9f20
  11. Dec 04, 2009
  12. Dec 03, 2009
  13. Dec 01, 2009
  14. Nov 26, 2009
    • Ted Kremenek's avatar
      Add iterators to BlockDataRegion that allow clients to iterate over the... · 3378b610
      Ted Kremenek authored
      Add iterators to BlockDataRegion that allow clients to iterate over the VarRegions for "captured" variables for a block.
      
      llvm-svn: 89927
      3378b610
    • Ted Kremenek's avatar
      Refine MemRegions for blocks. Add a new region called · b63ad7a6
      Ted Kremenek authored
      'BlockDataRegion' to distinguish between the code associated with a
      block (which is represented by 'BlockTextRegion') and an instance of a
      block, which includes both code and data.  'BlockDataRegion' has an
      associated LocationContext, which can be used to eventually model the
      lifetime of a block object once LocationContexts can represent scopes
      (and iterations around a loop, etc.).
      
      llvm-svn: 89900
      b63ad7a6
  15. Nov 25, 2009
  16. Nov 10, 2009
  17. Sep 09, 2009
  18. Aug 28, 2009
  19. Aug 22, 2009
    • Ted Kremenek's avatar
      Remove 'SelfRegion' field from both BasicStoreManager and RegionStoreManager. · 608677a2
      Ted Kremenek authored
      SelfRegion represented the object bound to 'self' (when analyzing Objective-C
      methods) upon entry to a method. Having this region stored on the side ignores
      the current stack frame that we might be analyzing (among other things), and is
      a problem for interprocedural analysis.
      
      For RegionStoreManager, the value for SelfRegion is just lazily created.
      
      For BasicStoreManager, the value for SelfRegion is bound eagerly to 'self', but
      no explicit tracking of SelfRegion on the side is made.
      
      As part of this change, remove the restriction in BasicStoreManager that we only
      track ivars for 'self'. This shouldn't actually change anything in terms of
      precision, and simplifies the logic.
      
      llvm-svn: 79694
      608677a2
    • Ted Kremenek's avatar
  20. Aug 01, 2009
    • Ted Kremenek's avatar
      This is a fairly large patch, which resulted from a cascade of changes · 1f22aa74
      Ted Kremenek authored
      made to RegionStore (and related classes) in order to handle some
      analyzer failures involving casts and manipulation of symbolic memory.
      
      The root of the change is in StoreManager::CastRegion().  Instead of
      using ad hoc heuristics to decide when to layer an ElementRegion on a
      casted MemRegion, we now always layer an ElementRegion when the cast
      type is different than the original type of the region.  This carries
      the current cast information associated with a region around without
      resorting to the error prone recording of "casted types" in GRState.
      
      Along with this new policy of layering ElementRegions, I added a new
      algorithm to strip away existing ElementRegions when they simply
      represented casts of a base memory object.  This algorithm computes
      the raw "byte offset" that an ElementRegion represents from the base
      region, and allows the new ElementRegion to be based off that offset.
      The added benefit is that this naturally handles a series of casts of
      a MemRegion without building up a set of redundant ElementRegions
      (thus canonicalizing the region view).
      
      Other related changes that cascaded from this one (as tests were
      failing in RegionStore):
      
      - Revamped RegionStoreManager::InvalidateRegion() to completely remove
        all bindings and default values from a region and all subregions.
        Now invalidated fields are not bound directly to new symbolic
        values; instead the base region has a "default" symbol value from
        which "derived symbols" can be created.  The main advantage of this
        approach is that it allows us to invalidate a region hierarchy and
        then lazily instantiate new values no matter how deep the hierarchy
        went (i.e., regardless of the number of field accesses,
        e.g. x->f->y->z->...).  The previous approach did not do this.
      
      - Slightly reworked RegionStoreManager::RemoveDeadBindings() to also
        incorporate live symbols and live regions that do not have direct
        bindings but also have "default values" used for lazy instantiation.
        The changes to 'InvalidateRegion' revealed that these were necessary
        in order to achieve lazy instantiation of values in the region store
        with those bindings being removed too early.
      
      - The changes to InvalidateRegion() and RemoveDeadBindings() revealed
        a serious bug in 'getSubRegionMap()' where not all region -> subregion
        relationships involved in actually bindings (explicit and implicit)
        were being recorded.  This has been fixed by using a worklist algorithm
        to iteratively fill in the region map.
      
      - Added special support to RegionStoreManager::Bind()/Retrieve() to handle
        OSAtomicCompareAndSwap in light of the new 'CastRegion' changes and the
        layering of ElementRegions.
      
      - Fixed a bug in SymbolReaper::isLive() where derived symbols were not
        being marked live if the symbol they were derived from was also live.
        This fix was critical for getting lazy instantiation in RegionStore
        to work.
      
      - Tidied up the implementation of ValueManager::getXXXSymbolVal() methods
        to use SymbolManager::canSymbolicate() to decide whether or not a
        symbol should be symbolicated.
      
      - 'test/Analysis/misc-ps-xfail.m' now passes; that test case has been
        moved to 'test/Analysis/misc-ps.m'.
      
      - Tweaked some pretty-printing of MemRegions, and implemented
        'ElementRegion::getRawOffset()' for use with the CastRegion changes.
      
      llvm-svn: 77782
      1f22aa74
  21. Jul 29, 2009
  22. Jul 19, 2009
  23. Jul 16, 2009
    • Ted Kremenek's avatar
      Move RegionStoreManager over to using new · c7b1dade
      Ted Kremenek authored
      ValueManager::makeArrayIndex()/convertArrayIndex() methods.  This
      handles yet another crash case when reasoning about array indices of
      different bitwidth and signedness.
      
      llvm-svn: 75884
      c7b1dade
  24. Jul 14, 2009
  25. Jul 10, 2009
  26. Jul 03, 2009
  27. Jul 02, 2009
  28. Jun 30, 2009
    • Chris Lattner's avatar
      Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions. · c61089a6
      Chris Lattner authored
      This is simple enough, but then I thought it would be nice to make PrintingPolicy
      get a LangOptions so that various things can key off "bool" and "C++" independently.
      This spiraled out of control.  There are many fixme's, but I think things are slightly
      better than they were before.
      
      One thing that can be improved: CFG should probably have an ASTContext pointer in it,
      which would simplify its clients.
      
      llvm-svn: 74493
      c61089a6
  29. Jun 23, 2009
Loading