Skip to content
  1. Feb 06, 2010
  2. Feb 05, 2010
  3. Feb 04, 2010
  4. Feb 03, 2010
    • Daniel Dunbar's avatar
      Revert "Numerous changes to selector handling:", this breaks a whole bunch of · 45858d2d
      Daniel Dunbar authored
      working code, for no apparent reason.
      
      llvm-svn: 95244
      45858d2d
    • Anders Carlsson's avatar
      66498388
    • Anders Carlsson's avatar
    • Anders Carlsson's avatar
      More cleanup. · b247350e
      Anders Carlsson authored
      llvm-svn: 95226
      b247350e
    • Anders Carlsson's avatar
      Revert the new reference binding code; I came up with a way simpler solution... · 3b227bd6
      Anders Carlsson authored
      Revert the new reference binding code; I came up with a way simpler solution for the reference binding bug that is preventing self-hosting.
      
      llvm-svn: 95223
      3b227bd6
    • David Chisnall's avatar
      First pass at adding GC support for GNU runtime. GC ivar maps not yet... · 5bb4efdf
      David Chisnall authored
      First pass at adding GC support for GNU runtime.  GC ivar maps not yet constructed, GC flag not set.
      
      Please don't try using this yet - the runtime support is still very immature and your code will almost certainly crash if you do.  
      
      llvm-svn: 95222
      5bb4efdf
    • Douglas Gregor's avatar
      When a function or variable somehow depends on a type or declaration · 7dc5c17d
      Douglas Gregor authored
      that is in an anonymous namespace, give that function or variable
      internal linkage.
      
      This change models an oddity of the C++ standard, where names declared
      in an anonymous namespace have external linkage but, because anonymous
      namespace are really "uniquely-named" namespaces, the names cannot be
      referenced from other translation units. That means that they have
      external linkage for semantic analysis, but the only sensible
      implementation for code generation is to give them internal
      linkage. We now model this notion via the UniqueExternalLinkage
      linkage type. There are several changes here:
      
        - Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage
          when the declaration is in an anonymous namespace.
        - Added Type::getLinkage() to determine the linkage of a type, which
          is defined as the minimum linkage of the types (when we're dealing
          with a compound type that is not a struct/class/union).
        - Extended NamedDecl::getLinkage() to consider the linkage of the
          template arguments and template parameters of function template
          specializations and class template specializations.
        - Taught code generation to rely on NamedDecl::getLinkage() when
          determining the linkage of variables and functions, also
          considering the linkage of the types of those variables and
          functions (C++ only). Map UniqueExternalLinkage to internal
          linkage, taking out the explicit checks for
          isInAnonymousNamespace().
      
      This fixes much of PR5792, which, as discovered by Anders Carlsson, is
      actually the reason behind the pass-manager assertion that causes the
      majority of clang-on-clang regression test failures. With this fix,
      Clang-built-Clang+LLVM passes 88% of its regression tests (up from
      67%). The specific numbers are:
      
      LLVM:
        Expected Passes    : 4006
        Expected Failures  : 32
        Unsupported Tests  : 40
        Unexpected Failures: 736
      
      Clang:
        Expected Passes    : 1903
        Expected Failures  : 14
        Unexpected Failures: 75
      
      Overall:
        Expected Passes    : 5909
        Expected Failures  : 46
        Unsupported Tests  : 40
        Unexpected Failures: 811
      
      Still to do:
        - Improve testing
        - Check whether we should allow the presence of types with
        InternalLinkage (in addition to UniqueExternalLinkage) given
        variables/functions internal linkage in C++, as mentioned in
        PR5792. 
        - Determine how expensive the getLinkage() calls are in practice;
        consider caching the result in NamedDecl.
        - Assess the feasibility of Chris's idea in comment #1 of PR5792.
      
      llvm-svn: 95216
      7dc5c17d
    • Chris Lattner's avatar
      remove a big chunk of #if 0 code. · eb1e610d
      Chris Lattner authored
      llvm-svn: 95201
      eb1e610d
    • Douglas Gregor's avatar
      Provide a real fix for PR6199, reverting the old workaround. Here, we · db56b919
      Douglas Gregor authored
      realize that CXXConstructExpr is always implicit, so we should just
      return its argument (if there is only one) rather than directly
      invoking the constructor.
      
      llvm-svn: 95192
      db56b919
    • David Chisnall's avatar
      Numerous changes to selector handling: · 92b762e2
      David Chisnall authored
      - Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon.  This also simplifies the code generated by the GNU runtime a bit.  
      
      - Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant.
      
      - Recognise @selector() expressions as valid static initialisers (as GCC does).
      
      - Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants.  These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load.
      
      - Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector.  This is needed for generating typed selectors from @selector() expressions (as GCC does).  Ideally, this information should be stored in the Selector, but that would be an invasive change.  We should eventually add checks for common uses of @selector() expressions.  Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this:
      
      - (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL)
                 withObject: (id)object;
      
      Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature.  We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes.
      
      - Made @selector() expressions emit type info if available and the runtime supports it.
      
      Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac.  This currently just assert()s.
      
      llvm-svn: 95189
      92b762e2
Loading