Skip to content
  1. Jan 28, 2009
  2. Jan 24, 2009
    • Ted Kremenek's avatar
      More hacking on static analyzer diagnostics. When emitting summary... · f08ac278
      Ted Kremenek authored
      More hacking on static analyzer diagnostics.  When emitting summary diagnostics the code paths for diagnostics involving paths or single locations are now unified.  This patch also constifies many arguments/methods that are touched by this logic, leading to a nice overall code cleanup.
      
      llvm-svn: 62903
      f08ac278
  3. Jan 21, 2009
  4. Jan 16, 2009
  5. Jan 12, 2009
    • Ted Kremenek's avatar
      retain/release checker: · 7e90422e
      Ted Kremenek authored
      - Refactor a bunch of logic in the retain/release checker, making it more
        condense and easier to read.
      - Add support for "Create" methods in the DiskArbitration framework
      
      retain/release tests:
      - Rename CFDate.m to retain-release.m, and move test from CFString.c to
        retain-release.m
      - Add DiskArbitration framework tests cases.
      - Add/refine and few more retain/release GC test cases.
      
      llvm-svn: 62106
      7e90422e
  6. Jan 07, 2009
    • Ted Kremenek's avatar
      This commit reflects changes to the retain/release checker motivated by my · 1d92d2c8
      Ted Kremenek authored
      recent discussions with Thomas Clement and Ken Ferry concerning the "fundamental
      rule" for Cocoa memory management
      (http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html).
      
      Here is the revised behavior of the checker concerning tracking retain/release
      counts for objects returned from message expressions involving instance methods:
      
      1) Track the returned object if the return type of the message expression is
      id<..>, id, or a pointer to *any* object that subclasses NSObject. Such objects
      are assumed to have a retain count. Previously the checker only tracked objects
      when the receiver of the message expression was part of the standard Cocoa API
      (i.e., had class names prefixed with 'NS'). This should significantly expand the
      amount of checking performed.
      
      2) Consider the object owned if the selector of the message expression contains
      "alloc", "new", or "copy". Previously we also considered "create", but this
      doesn't follow from the fundamental rule (discussions with the Cocoa folks
      confirms this).
      
      llvm-svn: 61837
      1d92d2c8
  7. Dec 19, 2008
  8. Dec 17, 2008
    • Ted Kremenek's avatar
      Fix <rdar://problem/6451816>: · 300c9cc8
      Ted Kremenek authored
      - Because of the introduction of AnonTypedRegions when reasoning about casts, we
        had a regression in the "symbolication" of variable values passed-by-reference
        to a function. This is now fixed in CFRefCount.cpp (-checker-cfref) by
        blasting through the layer of AnonTypedRegions when symbolicating the value of
        the variable. This logic may get moved elsewhere. Note that this change
        affects only -checker-cfref and not -checker-simple; eventually this logic
        should get pulled out of CFRefCount.cpp into a more common place. All users
        use -checker-cfref by default, and -checker-simple should probably just be
        removed.  
      - Updated test 'Analysis/uninit-vals-ps.c' to only use -checker-cfref and added
        a test case for this regression.
      
      llvm-svn: 61147
      300c9cc8
  9. 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
  10. Dec 05, 2008
  11. Dec 02, 2008
  12. Nov 24, 2008
    • Chris Lattner's avatar
      Rename Selector::getName() to Selector::getAsString(), and add · e4b95698
      Chris Lattner authored
      a new NamedDecl::getAsString() method.
      
      Change uses of Selector::getName() to just pass in a Selector 
      where possible (e.g. to diagnostics) instead of going through
      an std::string.
      
      This also adds new formatters for objcinstance and objcclass
      as described in the dox.
      
      llvm-svn: 59933
      e4b95698
  13. Nov 13, 2008
  14. Nov 12, 2008
  15. Nov 05, 2008
  16. Nov 04, 2008
  17. Oct 31, 2008
  18. Oct 29, 2008
  19. Oct 24, 2008
  20. Oct 23, 2008
  21. Oct 22, 2008
  22. Oct 21, 2008
  23. Oct 18, 2008
  24. Oct 17, 2008
  25. 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
  26. Oct 01, 2008
  27. Sep 28, 2008
Loading