Skip to content
  1. Apr 14, 2009
  2. Mar 29, 2009
    • Chris Lattner's avatar
      Push DeclGroup much farther throughout the compiler. Now the various · 5bbb3c8a
      Chris Lattner authored
      productions (except the already broken ObjC cases like @class X,Y;) in 
      the parser that can produce more than one Decl return a DeclGroup instead
      of a Decl, etc.
      
      This allows elimination of the Decl::NextDeclarator field, and exposes
      various clients that should look at all decls in a group, but which were
      only looking at one (such as the dumper, printer, etc).  These have been
      fixed.
      
      Still TODO:
      
      1) there are some FIXME's in the code about potentially using
      DeclGroup for better location info.
      2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
      3) I'm not sure what is going on with StmtIterator.cpp, or if it can
         be radically simplified now.
      4) I put a truly horrible hack in ParseTemplate.cpp.
      
      I plan to bring up #3/4 on the mailing list, but don't plan to tackle
      #1/2 in the short term.
      
      llvm-svn: 68002
      5bbb3c8a
  3. Mar 28, 2009
  4. Jan 28, 2009
  5. Jan 20, 2009
  6. Oct 27, 2008
  7. Oct 16, 2008
    • Daniel Dunbar's avatar
      Add --disable-free flag to clang. · 33d29b3e
      Daniel Dunbar authored
       - Disables the freeing of the ASTContext and the TranslationUnit
         after parsing & sema.
       - Primarily for timing the impact on -fsyntax-only timings.
      
      llvm-svn: 57643
      33d29b3e
  8. Aug 20, 2008
  9. Aug 11, 2008
    • Daniel Dunbar's avatar
      More #include cleaning · 56fdb6ae
      Daniel Dunbar authored
       - Kill unnecessary #includes in .cpp files. This is an automatic
         sweep so some things removed are actually used, but happen to be
         included by a previous header. I tried to get rid of the obvious
         examples and this was the easiest way to trim the #includes in one
         fell swoop.
       - We now return to regularly scheduled development.
      
      llvm-svn: 54632
      56fdb6ae
    • Daniel Dunbar's avatar
      More #include cleaning · 221fa94e
      Daniel Dunbar authored
       - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
         SourceLocation.h)
       - Move ASTContext constructor into implementation
      
      llvm-svn: 54627
      221fa94e
  10. Aug 08, 2008
  11. Aug 07, 2008
  12. Jul 02, 2008
  13. Jun 16, 2008
  14. Jun 04, 2008
  15. May 31, 2008
  16. May 27, 2008
  17. May 20, 2008
    • Ted Kremenek's avatar
      Try to plug some memory leaks... · ce20e8fe
      Ted Kremenek authored
      1) Sema::ParseAST now constructs a TranslationUnit object to own the top-level Decls, which releases the top-level Decls upon exiting ParseAST.
      
      2) Bug fix: TranslationUnit::~TranslationUnit handles the case where a Decl is added more than once as a top-level Decl.
      
      3) Decl::Destroy is now a virtual method, obviating the need for a special dispatch based on DeclKind.
      
      3) FunctionDecl::Destroy now releases its Body using its Destroy method.
      
      4) Added Stmt::Destroy and Stmt::DestroyChildren, which recursively delete the child ASTs of a Stmt and call their dstors.  We may need to special case dstor/Destroy methods for particular Stmt subclasses that own other dynamically allocated objects besides AST nodes.
      
      5) REGRESSION: We temporarily are not deallocating attributes; a FIXME is provided.
      
      llvm-svn: 51286
      ce20e8fe
  18. Mar 16, 2008
    • Chris Lattner's avatar
      Make a major restructuring of the clang tree: introduce a top-level · 7a51313d
      Chris Lattner authored
      lib dir and move all the libraries into it.  This follows the main
      llvm tree, and allows the libraries to be built in parallel.  The
      top level now enforces that all the libs are built before Driver,
      but we don't care what order the libs are built in.  This speeds
      up parallel builds, particularly incremental ones.
      
      llvm-svn: 48402
      7a51313d
  19. Feb 06, 2008
  20. Dec 29, 2007
  21. Dec 19, 2007
  22. Nov 30, 2007
    • Steve Naroff's avatar
      · 205ec3d0
      Steve Naroff authored
      Yesterday, I simplified how we stream top-level decls.
      
      After a discussion with Ted, we both came to the conclusion that adding a "HandleTopLevelDeclaration" hook to ASConsumer is far more elegant. The default implementation of HandleTopLevelDeclaration will be responsible for iterating over the ScopedDecl (which has a chain of the decls:-).
      
      TODO: Once Ted adds HandleTopLevelDeclaration, make sure TagDecls are chainged appropriately...
      llvm-svn: 44445
      205ec3d0
  23. Nov 28, 2007
    • Steve Naroff's avatar
      · 197616c3
      Steve Naroff authored
      Several fixes/simplifications surrounding how we stream top-level decl AST's.
      
      The following code...
      
      typedef struct cssm_data {} CSSM_DATA, *CSSM_DATA_PTR;
      
      struct Y { int A; };
      
      struct X { int A; } D; 
      
      struct X E, F;
      
      ...now produces the following output...
      
      > ../../Debug/bin/clang xx.c -ast-print
      Read top-level tag decl: 'cssm_data'
      typedef struct cssm_data CSSM_DATA;
      typedef struct cssm_data *CSSM_DATA_PTR;
      Read top-level tag decl: 'Y'
      Read top-level tag decl: 'X'
      Read top-level variable decl: 'D'
      Read top-level variable decl: 'E'
      Read top-level variable decl: 'F'
      
      ...which is much more accurate than the previous -ast-print output...
      
      typedef struct cssm_data CSSM_DATA;
      typedef struct cssm_data CSSM_DATA;
      Read top-level variable decl: 'D'
      Read top-level variable decl: 'E'
      Read top-level variable decl: 'E'
      
      llvm-svn: 44421
      197616c3
  24. Nov 03, 2007
  25. Oct 26, 2007
  26. Oct 14, 2007
    • Steve Naroff's avatar
      · 5811baf1
      Steve Naroff authored
      - Added Sema::AddFactoryMethodToGlobalPool and Sema::AddInstanceMethodToGlobalPool and DenseMaps. This will allow us to efficiently lookup a method from a selector given no type information (for the "id" data type).
      
      - Fixed some funky "}
                          else {" indentation in Sema::ActOnAddMethodsToObjcDecl(). I'd prefer we stay away from this style...it wastes space and isn't any easier to read (from my perspective, at least:-)
      
      - Changed Parser::ParseObjCInterfaceDeclList() to only call Action::ActOnAddMethodsToObjcDecl() when it actually has methods to add (since most interface have methods, this is a very minor cleanup).
      
      llvm-svn: 42957
      5811baf1
  27. Oct 10, 2007
    • Chris Lattner's avatar
      Make a significant change to invert the control flow handling · 1f1b0dbc
      Chris Lattner authored
      predefined macros.  Previously, these were handled by the driver,
      now they are handled by the preprocessor.
      
      Some fallout of this:
      
      1. Instead of preprocessing two buffers (the predefines, then the 
         main source file)  we now start preprocessing the main source 
         file and inject the predefines as a "psuedo #include" from the
         main source file.
      2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify
         Preprocessor::isInPrimaryFile.
      3. The driver doesn't have to know about standard #defines, the
         preprocessor knows, which is nice for people wanting to define
         their own drivers.
      4. This allows us to put normal tokens in the predefine buffer,
         for example a definition for __builtin_va_list that is 
         target-specific, and a typedef for id in objc.
      
      llvm-svn: 42818
      1f1b0dbc
  28. Sep 27, 2007
    • 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
  29. Sep 16, 2007
Loading