Skip to content
  1. Dec 22, 2010
  2. Dec 02, 2010
  3. May 19, 2010
  4. Apr 21, 2010
    • Douglas Gregor's avatar
      Overhaul the AST representation of Objective-C message send · 9a129194
      Douglas Gregor authored
      expressions, to improve source-location information, clarify the
      actual receiver of the message, and pave the way for proper C++
      support. The ObjCMessageExpr node represents four different kinds of
      message sends in a single AST node:
      
        1) Send to a object instance described by an expression (e.g., [x method:5])
        2) Send to a class described by the class name (e.g., [NSString method:5])
        3) Send to a superclass class (e.g, [super method:5] in class method)
        4) Send to a superclass instance (e.g., [super method:5] in instance method)
      
      Previously these four cases where tangled together. Now, they have
      more distinct representations. Specific changes:
      
        1) Unchanged; the object instance is represented by an Expr*.
      
        2) Previously stored the ObjCInterfaceDecl* referring to the class
        receiving the message. Now stores a TypeSourceInfo* so that we know
        how the class was spelled. This both maintains typedef information
        and opens the door for more complicated C++ types (e.g., dependent
        types). There was an alternative, unused representation of these
        sends by naming the class via an IdentifierInfo *. In practice, we
        either had an ObjCInterfaceDecl *, from which we would get the
        IdentifierInfo *, or we fell into the case below...
      
        3) Previously represented by a class message whose IdentifierInfo *
        referred to "super". Sema and CodeGen would use isStr("super") to
        determine if they had a send to super. Now represented as a
        "class super" send, where we have both the location of the "super"
        keyword and the ObjCInterfaceDecl* of the superclass we're
        targetting (statically).
      
        4) Previously represented by an instance message whose receiver is a
        an ObjCSuperExpr, which Sema and CodeGen would check for via
        isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
        where we have both the location of the "super" keyword and the
        ObjCInterfaceDecl* of the superclass we're targetting
        (statically). Note that ObjCSuperExpr only has one remaining use in
        the AST, which is for "super.prop" references.
      
      The new representation of ObjCMessageExpr is 2 pointers smaller than
      the old one, since it combines more storage. It also eliminates a leak
      when we loaded message-send expressions from a precompiled header. The
      representation also feels much cleaner to me; comments welcome!
      
      This patch attempts to maintain the same semantics we previously had
      with Objective-C message sends. In several places, there are massive
      changes that boil down to simply replacing a nested-if structure such
      as:
      
        if (message has a receiver expression) {
          // instance message
          if (isa<ObjCSuperExpr>(...)) {
           // send to super
          } else {
           // send to an object
         }
        } else {
          // class message
          if (name->isStr("super")) {
            // class send to super
          } else {
            // send to class
          }
        }
      
      with a switch
      
        switch (E->getReceiverKind()) {
        case ObjCMessageExpr::SuperInstance: ...
        case ObjCMessageExpr::Instance: ...
        case ObjCMessageExpr::SuperClass: ...
        case ObjCMessageExpr::Class:...
        }
      
      There are quite a few places (particularly in the checkers) where
      send-to-super is effectively ignored. I've placed FIXMEs in most of
      them, and attempted to address send-to-super in a reasonable way. This
      could use some review.
      
      llvm-svn: 101972
      9a129194
  5. Apr 17, 2010
  6. Jan 26, 2010
  7. Jan 25, 2010
    • Ted Kremenek's avatar
    • 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
  8. Nov 29, 2009
  9. Sep 25, 2009
    • Douglas Gregor's avatar
      Fix checking for a null pointer constant when the expression itself is · 56751b59
      Douglas Gregor authored
      value-dependent. Audit (and fixed) all calls to
      Expr::isNullPointerConstant() to provide the correct behavior with
      value-dependent expressions. Fixes PR5041 and a crash in libstdc++
      <locale>.
      
      In the same vein, properly compute value- and type-dependence for
      ChooseExpr. Fixes PR4996.
      
      llvm-svn: 82748
      56751b59
  10. Sep 09, 2009
  11. Aug 22, 2009
  12. Jul 16, 2009
  13. Jun 30, 2009
  14. Jun 18, 2009
  15. Apr 23, 2009
    • Douglas Gregor's avatar
      Eliminate the three SmallVectors in ObjCImplDecl (for instance · 29bd76fd
      Douglas Gregor authored
      methods, class methods, and property implementations) and instead
      place all of these entities into the DeclContext.
      
      This eliminates more linear walks when looking for class or instance
      methods and should make PCH (de-)serialization of ObjCDecls trivial
      (and lazy).
      
      llvm-svn: 69849
      29bd76fd
  16. Apr 18, 2009
  17. Feb 11, 2009
  18. Dec 08, 2008
  19. 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
  20. Nov 22, 2008
  21. Nov 04, 2008
  22. Oct 30, 2008
  23. Oct 29, 2008
    • Ted Kremenek's avatar
      Patch by Nikita Zhuk: · 3f04949b
      Ted Kremenek authored
      The attached patch adds additional checks to -warn-objc-missing-dealloc. It checks that all ivars which are used in implementation of synthesized properties are either
      
      a) released in dealloc if the property has retain" or "copy" attribute OR
      b) not released in dealloc if the property has "assign" attribute
      
      llvm-svn: 58363
      3f04949b
  24. Aug 10, 2008
  25. Jul 25, 2008
  26. Jul 24, 2008
  27. Jul 16, 2008
  28. Jul 14, 2008
  29. Jul 11, 2008
  30. Jul 07, 2008
  31. Jul 03, 2008
Loading