Skip to content
  1. Jan 26, 2009
  2. Jan 23, 2009
  3. Jan 22, 2009
    • Ted Kremenek's avatar
      Fix RegionStore::getLValueElement() to handle the case when the base region is... · 92d48a71
      Ted Kremenek authored
      Fix RegionStore::getLValueElement() to handle the case when the base region is not an ElementRegion (also do some cleanups of its core logic).
      This gets array-struct.c to work with RegionStore.
      
      llvm-svn: 62781
      92d48a71
    • Ted Kremenek's avatar
      Static analyzer: Remove a bunch of outdated SymbolData objects and · 74040833
      Ted Kremenek authored
      their associated APIs.  We no longer need separate SymbolData objects
      for fields, variables, etc.  Instead, we now associated symbols with
      the "rvalue" of a MemRegion (i.e., the value stored at that region).
      Now we only have two kinds of SymbolData objects: SymbolRegionRValue
      and SymbolConjured.
      
      This cleanup also makes the distinction between a SymbolicRegion and a
      symbolic value that is a location much clearer.  A SymbolicRegion
      represents a chunk of symbolic memory, while a symbolic location is
      just a "pointer" with different possible values.  Without any specific
      knowledge, a symbolic location resolves (i.e., via a dereference) to a
      SymbolicRegion.  In the future, when we do better alias reasoning, a
      symbolic location can become an alias for another location, thus
      merging the constraints on the referred SymbolicRegion with the other
      region.
      
      llvm-svn: 62769
      74040833
  4. Jan 21, 2009
  5. Jan 13, 2009
  6. Jan 07, 2009
  7. Jan 06, 2009
  8. Dec 24, 2008
  9. 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
  10. Dec 16, 2008
  11. Dec 14, 2008
  12. 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
  13. Dec 11, 2008
    • Douglas Gregor's avatar
      7a4fad1b
    • Douglas Gregor's avatar
      Unifies the name-lookup mechanisms used in various parts of the AST · 91f84216
      Douglas Gregor authored
      and separates lexical name lookup from qualified name lookup. In
      particular:
        * Make DeclContext the central data structure for storing and
          looking up declarations within existing declarations, e.g., members
          of structs/unions/classes, enumerators in C++0x enums, members of
          C++ namespaces, and (later) members of Objective-C
          interfaces/implementations. DeclContext uses a lazily-constructed
          data structure optimized for fast lookup (array for small contexts,
          hash table for larger contexts). 
      
        * Implement C++ qualified name lookup in terms of lookup into
          DeclContext.
      
        * Implement C++ unqualified name lookup in terms of
          qualified+unqualified name lookup (since unqualified lookup is not
          purely lexical in C++!)
      
        * Limit the use of the chains of declarations stored in
          IdentifierInfo to those names declared lexically.
      
        * Eliminate CXXFieldDecl, collapsing its behavior into
          FieldDecl. (FieldDecl is now a ScopedDecl).
      
        * Make RecordDecl into a DeclContext and eliminates its
          Members/NumMembers fields (since one can just iterate through the
          DeclContext to get the fields).
      
      llvm-svn: 60878
      91f84216
  14. Dec 05, 2008
  15. Dec 04, 2008
  16. Dec 02, 2008
  17. Nov 30, 2008
  18. Nov 29, 2008
  19. Nov 28, 2008
    • Zhongxing Xu's avatar
      Fix a serious bug. · e31a8ebf
      Zhongxing Xu authored
      When initialized, the index of the ElementRegion was unsigned. But the index
      value of the ArraySubscriptExpr is signed. This inconsistency caused the value
      of the array element retrieved to be UnknownVal despite it was initialized to
      symbolic.
      
      This is only a hack. Real fix of this problem is required.
      
      llvm-svn: 60207
      e31a8ebf
    • Zhongxing Xu's avatar
      Use std::make_pair instead of std::pair's ctor. · 85b6e201
      Zhongxing Xu authored
      llvm-svn: 60205
      85b6e201
  20. Nov 27, 2008
  21. Nov 24, 2008
Loading