Skip to content
  1. Jan 09, 2009
  2. Jan 08, 2009
    • Douglas Gregor's avatar
      Revert my previous, failed attempt to pretty-print anonymous struct/union... · e4b414c7
      Douglas Gregor authored
      Revert my previous, failed attempt to pretty-print anonymous struct/union accesses well. Added a FIXME so we know to revisit this later
      
      llvm-svn: 61951
      e4b414c7
    • Ted Kremenek's avatar
      Fix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to iterate and... · 0667123b
      Ted Kremenek authored
      Fix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to iterate and destroy all contained ObjCMethodDecls in one sweep.  This fixes a use-after-free error found by valgrind.
      
      llvm-svn: 61943
      0667123b
    • Douglas Gregor's avatar
    • Douglas Gregor's avatar
      Unify the code for defining tags in C and C++, so that we always · 82ac25e4
      Douglas Gregor authored
      introduce a Scope for the body of a tag. This reduces the number of
      semantic differences between C and C++ structs and unions, and will
      help with other features (e.g., anonymous unions) in C. Some important
      points:
      
        - Fields are now in the "member" namespace (IDNS_Member), to keep
          them separate from tags and ordinary names in C. See the new test
          in Sema/member-reference.c for an example of why this matters. In
          C++, ordinary and member name lookup will find members in both the
          ordinary and member namespace, so the difference between
          IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but
          only in C++!). 
        - We always introduce a Scope and push a DeclContext when we're
          defining a tag, in both C and C++. Previously, we had different
          actions and different Scope/CurContext behavior for enums, C
          structs/unions, and C++ structs/unions/classes. Now, it's one pair
          of actions. (Yay!)
      
      There's still some fuzziness in the handling of struct/union/enum
      definitions within other struct/union/enum definitions in C. We'll
      need to do some more cleanup to eliminate some reliance on CurContext
      before we can solve this issue for real. What we want is for something
      like this:
      
        struct X {
          struct T { int x; } t;
        };
      
      to introduce T into translation unit scope (placing it at the
      appropriate point in the IdentifierResolver chain, too), but it should
      still have struct X as its lexical declaration
      context. PushOnScopeChains isn't smart enough to do that yet, though,
      so there's a FIXME test in nested-redef.c
      
      llvm-svn: 61940
      82ac25e4
    • Steve Naroff's avatar
      Move FIXME to a better location. · 6c879a14
      Steve Naroff authored
      llvm-svn: 61937
      6c879a14
    • Steve Naroff's avatar
      Removed ObjCContainerDecl::getPropertyMethods()...doesn't belong in the AST. · e538c5f3
      Steve Naroff authored
      Moved logic to Sema::ProcessPropertyDecl().
      
      llvm-svn: 61936
      e538c5f3
    • Steve Naroff's avatar
      Remove redundant method context (now that ObjCMethodDecl isa ScopedDecl). · 11b387fe
      Steve Naroff authored
      Convert clients to use the standard getDeclContext() API.
      
      Doug, thanks for the review!
      
      llvm-svn: 61935
      11b387fe
    • Steve Naroff's avatar
      This is a large/messy diff that unifies the ObjC AST's with DeclContext. · 35c62ae6
      Steve Naroff authored
      - ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
      - ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
      - ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
      - Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
      - Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
      - Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
      - Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
      - Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.
      
      This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.
      
      llvm-svn: 61929
      35c62ae6
    • Zhongxing Xu's avatar
      Add isSubRegionOf() method to SubRegion. · 550c1c46
      Zhongxing Xu authored
      llvm-svn: 61924
      550c1c46
    • Ted Kremenek's avatar
      PTH: Hook up getSpelling() caching in PTHLexer. This results in a nice · d5e6e16d
      Ted Kremenek authored
      performance gain. Here's what we see for -Eonly on Cocoa.h (using PTH):
      
      - wall time decreases by 21% (26% speedup overall)
      - system time decreases by 35%
      - user time decreases by 6%
      
      These reductions are due to not paging source files just to get spellings for
      literals. The solution in place doesn't appear to be 100% yet, as we still see
      some of the pages for source files getting mapped in. Using -print-stats, we see
      that SourceManager maps in 7179K less bytes of source text (reduction of 75%).
      Will investigate why the remaining 25% are getting paged in.
      
      With these changes, here's how PTH compares to non-PTH on Cocoa.h:
        -Eonly: PTH takes 64% of the time as non-PTH (54% speedup)
        -fsyntax-only: PTH takes 89% of the time as non-PTH (11% speedup)
      
      llvm-svn: 61913
      d5e6e16d
    • Ted Kremenek's avatar
      PTH: · 884a5584
      Ted Kremenek authored
      - Added stub PTHLexer::getSpelling() that will be used for fetching cached
        spellings from the PTH file.  This doesn't do anything yet.
      - Added a hook in Preprocessor::getSpelling() to call PTHLexer::getSpelling()
        when using a PTHLexer.
      - Updated PTHLexer to read the offsets of spelling tables in the PTH file.
      
      llvm-svn: 61911
      884a5584
    • Fariborz Jahanian's avatar
      Objc's compatibility-alias semantics and code · 17290c36
      Fariborz Jahanian authored
      gen issue fix.
      
      llvm-svn: 61901
      17290c36
  3. Jan 07, 2009
Loading