Skip to content
  1. Oct 24, 2007
  2. Oct 10, 2007
  3. Oct 07, 2007
  4. Oct 05, 2007
    • Chris Lattner's avatar
      Implement DenseMapInfo for Selector, allowing use of DenseMap/DenseSet of · dadc762a
      Chris Lattner authored
      Selector's instead of requiring void* to be used.  I converted one use of
      DenseSet<void*> over to use DenseSet<Selector> but the others should change
      as well.
      
      llvm-svn: 42645
      dadc762a
    • Steve Naroff's avatar
      · e61bfa8b
      Steve Naroff authored
      Layering refinements for selectors (suggested by Chris). Specifics...
      
      - Add SelectorTable, which enables us to remove MultiKeywordSelector from the public header.
      - Remove FoldingSet from IdentifierInfo.h and Preprocessor.h.
      - Remove Parser::ObjcGetUnarySelector and Parser::ObjcGetKeywordSelector, they are subsumed by SelectorTable.
      - Add MultiKeywordSelector to IdentifierInfo.cpp.
      - Move a bunch of selector related methods from ParseObjC.cpp to IdentifierInfo.cpp.
      - Added some comments.
      
      llvm-svn: 42643
      e61bfa8b
  5. Sep 29, 2007
    • Steve Naroff's avatar
      · 92866f4f
      Steve Naroff authored
      Add some comments to MultiKeywordSelector, make all methods private, add a friend, move some methods around.
      
      llvm-svn: 42456
      92866f4f
    • Steve Naroff's avatar
      · 8017506d
      Steve Naroff authored
      Yesterday I discovered that 78% of all selectors in "Cocoa.h" take 0/1 argument.
      
      This motivated implementing a devious clattner inspired solution:-)
      
      This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema).
      
      This change was critical to make now, before we have too many clients.
      
      I still need to add some comments to the Selector class...will likely add later today/tomorrow.
      
      llvm-svn: 42452
      8017506d
  6. Sep 27, 2007
    • Steve Naroff's avatar
      · 65ca537b
      Steve Naroff authored
      Fix bug in SelectorInfo::getName() - method buffer needs to be passed by reference.
      
      llvm-svn: 42411
      65ca537b
    • Steve Naroff's avatar
      · f73590db
      Steve Naroff authored
      Add SelectorInfo (similar in spirit to IdentifierInfo). The key difference is SelectorInfo is not string-oriented, it is a unique aggregate of IdentifierInfo's (using a folding set).  SelectorInfo also has a richer API that simplifies the parser/action interface. 3 noteworthy benefits:
      
      #1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable.
      
      #2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%.
      
      #3: It results in many API simplifications. Here are some highlights:
      
      - Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages).
      - Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo).
      - Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured).
      
      I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later.
      
      Thanks to Chris for talking this through with me and suggesting this approach. 
      
      llvm-svn: 42395
      f73590db
  7. Sep 19, 2007
    • Steve Naroff's avatar
      · 2cd263ff
      Steve Naroff authored
      Remove SelectorTable/SelectorInfo, simply store all selectors in the central IdentifierTable.
      
      Rationale:
      
      We currently have a separate table to unique ObjC selectors. Since I don't need all the instance data in IdentifierInfo, I thought this would save space (and make more sense conceptually).
      
      It turns out the cost of having duplicate entries for unary selectors (i.e. names without colons) outweighs the cost difference between the IdentifierInfo & SelectorInfo structures. Here is the data:
      
      Two tables:
      
      *** Selector/Identifier Stats:
      # Selectors/Identifiers: 51635 
      Bytes allocated:         1999824
      
      One table:
      
      *** Identifier Table Stats:
      # Identifiers:   49500
      Bytes allocated: 1990316
      
      llvm-svn: 42139
      2cd263ff
  8. Sep 17, 2007
    • Steve Naroff's avatar
      · 73d534a2
      Steve Naroff authored
      Add support for ObjC keyword selectors.
      
      - Add SelectorInfo/SelectorTable classes, modeled after IdentifierInfo/IdentifierTable.
      - Add SelectorTable instance to ASTContext, created lazily through ASTContext::getSelectorInfo().
      - Add SelectorInfo slot to ObjcMethodDecl.
      - Add helper function to derive a SelectorInfo from ObjcKeywordInfo.
      
      Misc: Got the Decl stats stuff up and running again...it was missing support for ObjC AST's.
      llvm-svn: 42023
      73d534a2
  9. Aug 23, 2007
    • Steve Naroff's avatar
      · 7c348179
      Steve Naroff authored
      Add helper functions Token::isObjCAtKeyword() and Token::getObjCKeywordID().
      
      Convert all clients to the new cleaner, more robust API.
      
      llvm-svn: 41330
      7c348179
  10. Jul 19, 2007
  11. Jul 16, 2007
  12. Jun 16, 2007
    • Chris Lattner's avatar
      Finally bite the bullet and make the major change: split the clang namespace · 23b7eb67
      Chris Lattner authored
      out of the llvm namespace.  This makes the clang namespace be a sibling of
      llvm instead of being a child.
      
      The good thing about this is that it makes many things unambiguous.  The
      bad things is that many things in the llvm namespace (notably data structures
      like smallvector) now require an llvm:: qualifier.  IMO, libsystem and libsupport
      should be split out of llvm into their own namespace in the future, which will fix
      this issue.
      
      llvm-svn: 39659
      23b7eb67
  13. Jun 08, 2007
  14. Feb 11, 2007
  15. Feb 08, 2007
  16. Jan 28, 2007
    • Chris Lattner's avatar
      Add support for target-independent builtin functions (like __builtin_abs), · 9561a0b3
      Chris Lattner authored
      whose decl objects are lazily created the first time they are referenced.
      Builtin functions are described by the clang/AST/Builtins.def file, which
      makes it easy to add new ones.
      
      This is missing two important pieces:
      1. Support for the rest of the gcc builtins.
      2. Support for target-specific builtins (e.g. __builtin_ia32_emms).
      
      Just adding this builtins reduces the number of implicit function definitions
      by 6, reducing the # diagnostics from 550 to 544 when parsing carbon.h.
      
      I need to add all the i386-specific ones to eliminate several hundred more.
      ugh.
      
      llvm-svn: 39327
      9561a0b3
  17. Dec 04, 2006
  18. Nov 21, 2006
  19. Oct 30, 2006
  20. Oct 29, 2006
  21. Oct 27, 2006
  22. Oct 26, 2006
  23. Oct 25, 2006
  24. Oct 22, 2006
  25. Oct 20, 2006
Loading