Skip to content
  1. Jan 21, 2009
  2. Jan 20, 2009
    • Douglas Gregor's avatar
      Remove ScopedDecl, collapsing all of its functionality into Decl, so · 6e6ad602
      Douglas Gregor authored
      that every declaration lives inside a DeclContext.
      
      Moved several things that don't have names but were ScopedDecls (and,
      therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
      including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
      store empty DeclarationNames for these things, nor do we try to insert
      them into DeclContext's lookup structure.
      
      The serialization tests are temporarily disabled. We'll re-enable them
      once we've sorted out the remaining ownership/serialiazation issues
      between DeclContexts and TranslationUnion, DeclGroups, etc.
      
      llvm-svn: 62562
      6e6ad602
  3. Jan 17, 2009
  4. Jan 13, 2009
  5. Jan 06, 2009
    • Douglas Gregor's avatar
      Add QualifiedDeclRefExpr, which retains additional source-location · c7acfdfe
      Douglas Gregor authored
      information for declarations that were referenced via a qualified-id,
      e.g., N::C::value. We keep track of the location of the start of the
      nested-name-specifier. Note that the difference between
      QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
      semantics of function calls in two ways:
        1) The use of a qualified-id instead of an unqualified-id suppresses
           argument-dependent lookup
        2) If the name refers to a virtual function, the qualified-id
        version will call the function determined statically while the
        unqualified-id version will call the function determined dynamically
        (by looking up the appropriate function in the vtable).
      
      Neither of these features is implemented yet, but we do print out
      qualified names for QualifiedDeclRefExprs as part of the AST printing.
      
      llvm-svn: 61789
      c7acfdfe
  6. Dec 22, 2008
  7. Dec 21, 2008
  8. 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
  9. Dec 16, 2008
    • Ted Kremenek's avatar
      ProgramPoint: · 9e08ff40
      Ted Kremenek authored
      - Added four new ProgramPoint types that subclass PostStmt for use in
        GRExprEngine::EvalLocation:
        - PostOutOfBoundsCheckFailed
        - PostUndefLocationCheckFailed
        - PostNullCheckFailed
        - PostLocationChecksSucceed
        These were created because of a horribly subtle caching bug in EvalLocation
        where a node representing an "bug condition" in EvalLocation (e.g. a null
        dereference) could be re-used as the "non-bug condition" because the Store did
        not contain any information to differentiate between the two. The extra
        program points just disables any accidental caching between EvalLocation and
        its callers.
      
      GRExprEngine:
      - EvalLocation now returns a NodeTy* instead of GRState*.  This should be used as the "vetted" predecessor for EvalLoad/EvalStore.
      
      llvm-svn: 61105
      9e08ff40
  10. Dec 15, 2008
  11. 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
  12. Dec 09, 2008
  13. Dec 08, 2008
  14. Dec 06, 2008
  15. Dec 05, 2008
  16. Nov 30, 2008
  17. Nov 28, 2008
  18. Nov 27, 2008
    • Zhongxing Xu's avatar
      Add support for pluggable components of static analyzer. · 16e3f0e0
      Zhongxing Xu authored
       - Creator function pointers are saved in ManagerRegistry.
       - The Register* class is used to notify ManagerRegistry new module is 
         available.
       - AnalysisManager queries ManagerRegistry for configurable module. Then it
         passes them to GRExprEngine, in turn to GRStateManager.
      
      llvm-svn: 60143
      16e3f0e0
  19. Nov 24, 2008
    • Ted Kremenek's avatar
      Remove FIXME comment. · 01c414c0
      Ted Kremenek authored
      llvm-svn: 59973
      01c414c0
    • Zhongxing Xu's avatar
      Add support for AllocaRegion extent with GDM. · 9165ed69
      Zhongxing Xu authored
      One design problem that is emerging is the signed-ness problem during static
      analysis. Many unsigned value have to be converted into signed value because
      it partipates in operations with signed values. 
      
      On the other hand, we cannot blindly make all values occuring in static analysis
      signed, because we do have cases where unsignedness is required, for example,
      integer overflow detection.
      
      llvm-svn: 59957
      9165ed69
    • Zhongxing Xu's avatar
      Cleanup code with utility method. · 6587c754
      Zhongxing Xu authored
      llvm-svn: 59951
      6587c754
  20. Nov 23, 2008
  21. Nov 22, 2008
  22. Nov 21, 2008
  23. Nov 16, 2008
  24. Nov 15, 2008
  25. Nov 14, 2008
    • Ted Kremenek's avatar
      Second attempt at implementation transfer function support for... · 537f6387
      Ted Kremenek authored
      Second attempt at implementation transfer function support for ObjCForCollectionStmt.  We now assume that the 'element' expression can be any lvalue.
      
      llvm-svn: 59313
      537f6387
    • Douglas Gregor's avatar
      Add a new expression node, CXXOperatorCallExpr, which expresses a · 993603d8
      Douglas Gregor authored
      function call created in response to the use of operator syntax that
      resolves to an overloaded operator in C++, e.g., "str1 +
      str2" that resolves to std::operator+(str1, str2)". We now build a
      CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
      only for binary operators, where we actually implement overloading)
      
      I decided *not* to refactor the current CallExpr to make it abstract
      (with FunctionCallExpr and CXXOperatorCallExpr as derived
      classes). Doing so would allow us to make CXXOperatorCallExpr a little
      bit smaller, at the cost of making the argument and callee accessors
      virtual. We won't know if this is going to be a win until we can parse
      lots of C++ code to determine how much memory we'll save by making
      this change vs. the performance penalty due to the extra virtual
      calls.
      
      llvm-svn: 59306
      993603d8
    • Zhongxing Xu's avatar
      Improve comments. · c967d035
      Zhongxing Xu authored
      llvm-svn: 59294
      c967d035
  26. Nov 13, 2008
Loading