Skip to content
  1. Dec 20, 2008
    • Zhongxing Xu's avatar
      Lazy bingding for region-store manager. · af7415ff
      Zhongxing Xu authored
      * Now Bind() methods take and return GRState* because binding could
        also alter GDM.
      * No variables are initialized except those declared with initial
        values.
      * failed C test cases are due to bugs in RemoveDeadBindings(),
      which removes constraints that is still alive. This will be fixed in later
      patch.
      * default value of array and struct regions will be implemented in later patch.
      
      llvm-svn: 61274
      af7415ff
  2. Dec 17, 2008
  3. Dec 13, 2008
    • Ted Kremenek's avatar
      MemRegion: · b5670fd5
      Ted Kremenek authored
      - Overhauled the notion of "types" for TypedRegions.  We now distinguish between the "lvalue" of a region (via getLValueRegion()) and the "rvalue" of a region (va getRValueRegion()).  Since a region represents a chunk of memory it has both, but we were conflating these concepts in some cases, leading to some insidious bugs.
      - Removed AnonPointeeType, partially because it is unused and because it doesn't have a clear notion of lvalue vs rvalue type.  We can add it back once there is a need for it and we can resolve its role with these concepts.
      
      StoreManager:
      - Overhauled StoreManager::CastRegion.  It expects an *lvalue* type for a region.  This is actually what motivated the overhaul to the MemRegion type mechanism.  It also no longer returns an SVal; we can just return a MemRegion*.
      - BasicStoreManager::CastRegion now overlays an "AnonTypedRegion" for pointer-pointer casts.  This matches with the MemRegion changes.
      - Similar changes to RegionStore, except I've added a bunch of FIXMEs where it wasn't 100% clear where we should use TypedRegion::getRValueRegion() or TypedRegion::getLValueRegion().
      
      AuditCFNumberCreate check:
      - Now blasts through AnonTypedRegions that may layer the original memory region, thus checking if the actually memory block is of the appropriate type.  This change was needed to work with the changes to StoreManager::CastRegion.
      
      GRExprEngine::VisitCast:
      - Conform to the new interface of StoreManager::CastRegion.
      
      Tests:
      - None of the analysis tests fail now for using the "basic store".
      - Disabled the tests 'array-struct.c' and 'rdar-6442306-1.m' pending further testing and bug fixing.
      
      llvm-svn: 60995
      b5670fd5
    • Ted Kremenek's avatar
      A series of cleanups/fixes motivated by <rdar://problem/6442306>: · f065b15f
      Ted Kremenek authored
      GRExprEngine (VisitCast):
      - When using StoreManager::CastRegion, always use the state and value it returns to generate the next node.  Failure to do so means that region values returned that don't require the state to be modified will get ignored.
      
      MemRegion:
      - Tighten the interface for ElementRegion.  Now ElementRegion can only be created with a super region that is a 'TypedRegion' instead of any MemRegion.  Code in BasicStoreManager/RegionStoreManager already assumed this, but it would result in a dynamic assertion check (and crash) rather than just having the compiler forbid the construction of such regions.
      - Added ElementRegion::getArrayRegion() to return the 'typed version' of an ElementRegion's super region.
      - Removed bogus assertion in ElementRegion::getType() that assumed that the super region was an AnonTypedRegion.  All that matters is that it is a TypedRegion, which is now true all the time by design.
      
      BasicStore:
      - Modified getLValueElement() to check if the 'array' region is a TypedRegion before creating an ElementRegion.  This conforms to the updated interface for ElementRegion.
      
      RegionStore:
      - In ArrayToPointer() gracefully handle things we don't reason about, and only create an ElementRegion if the array region is indeed a TypedRegion.
      
      llvm-svn: 60990
      f065b15f
  4. Dec 11, 2008
  5. Dec 05, 2008
  6. Nov 24, 2008
    • Chris Lattner's avatar
      Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of · f3d3faec
      Chris Lattner authored
      uses of getName() with uses of getDeclName().  This upgrades a bunch of
      diags to take DeclNames instead of std::strings.
      
      This also tweaks a couple of diagnostics to be cleaner and changes
      CheckInitializerTypes/PerformInitializationByConstructor to pass
      around DeclarationNames instead of std::strings.
      
      llvm-svn: 59947
      f3d3faec
  7. Nov 17, 2008
  8. Nov 16, 2008
    • Zhongxing Xu's avatar
      Enhances SCA to process untyped region to typed region conversion. · ceca8061
      Zhongxing Xu authored
       - RegionView and RegionViewMap is introduced to assist back-mapping from
         super region to subregions.
       - GDM is used to carry RegionView information.
       - AnonTypedRegion is added to represent a typed region introduced by pointer
         casting. Later AnonTypedRegion can be used in other similar cases, e.g.,
         malloc()'ed region.
       - The specific conversion is delegated to store manager.
      
      llvm-svn: 59382
      ceca8061
  9. Nov 13, 2008
  10. Nov 11, 2008
  11. Nov 10, 2008
  12. Nov 03, 2008
  13. Nov 02, 2008
  14. Oct 27, 2008
  15. Oct 25, 2008
  16. Oct 24, 2008
  17. Oct 21, 2008
  18. Oct 17, 2008
  19. Oct 08, 2008
  20. Oct 06, 2008
  21. Oct 04, 2008
    • Ted Kremenek's avatar
      This is a big patch, but the functionality change is small and the rest of the... · 5ca90a24
      Ted Kremenek authored
      This is a big patch, but the functionality change is small and the rest of the patch consists of deltas due to API changes.
      
      This patch overhauls the "memory region" abstraction that was prototyped (but never really used) as part of the Store.h.  This patch adds MemRegion.h and MemRegion.cpp, which defines the class MemRegion and its subclasses.  This classes serve to define an abstract representation of memory, with regions being layered on other regions to to capture the relationships between fields and variables, variables and the address space they are allocated in, and so on.  
      
      The main motivation of this patch is that key parts of the analyzer assumed that all value bindings were to VarDecls.  In the future this won't be the case, and this patch removes lval::DeclVal and replaces it with lval::MemRegionVal.  Now all pieces of the analyzer must reason about abstract memory blocks instead of just variables.
      
      There should be no functionality change from this patch, but it opens the door for significant improvements to the analyzer such as field-sensitivity and object-sensitivity, both which were on hold until the memory abstraction got generalized.
      
      The memory region abstraction also allows type-information to literally be affixed to a memory region.  This will allow the some now redundant logic to be removed from the retain/release checker.
      
      llvm-svn: 57042
      5ca90a24
Loading