- May 20, 2008
-
-
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
-
- Mar 16, 2008
-
-
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
-
- Feb 06, 2008
-
-
Chris Lattner authored
eliminating a bunch of forwarding methods and generally simplifying things. llvm-svn: 46792
-
Chris Lattner authored
Sema::ActOnTranslationUnitScope. The various ObjC pieces at the top of Sema.cpp should be moved into SemaObjC or something. llvm-svn: 46787
-
Chris Lattner authored
llvm-svn: 46786
-
Chris Lattner authored
llvm-svn: 46785
-
- Dec 29, 2007
-
-
Chris Lattner authored
discussion of this change. llvm-svn: 45410
-
- Dec 19, 2007
-
-
Ted Kremenek authored
both Preprocessor and ASTContext, we no longer need to explicitly pass MainFileID around in function calls that also pass either Preprocessor or ASTContext. This resulted in some nice cleanups in the ASTConsumers and the driver. llvm-svn: 45228
-
- Nov 30, 2007
-
-
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
-
- Nov 28, 2007
-
-
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
-
- Nov 03, 2007
-
-
Chris Lattner authored
ASTConsumer to process the AST before it is destroyed. This allows elimination of HandleObjcMetaDataEmission. llvm-svn: 43659
-
- Oct 26, 2007
-
-
Fariborz Jahanian authored
Thanks to Steve N. to point out using of offsetof for this. llvm-svn: 43391
-
- Oct 14, 2007
-
-
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
-
- Oct 10, 2007
-
-
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
-
- Sep 27, 2007
-
-
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
-
- Sep 16, 2007
-
-
Chris Lattner authored
llvm-svn: 42014
-
Chris Lattner authored
Switch -parse-ast over to it. llvm-svn: 41991
-
- Aug 30, 2007
-
-
Chris Lattner authored
llvm-svn: 41611
-
- Jun 16, 2007
-
-
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
-
- May 21, 2007
-
-
Chris Lattner authored
llvm-svn: 39478
-
- Feb 28, 2007
-
-
Steve Naroff authored
Go back to having the clang driver create ASTContext explicitly, passing it to Sema/ASTStreamer (separating the lifetime of ASTContext from the lifetime of Sema). One day it might be useful to consider creating a context object implicitly if one isn't provided (using default arguments in Sema's constructor). At this point, adding this convenience isn't necessary. llvm-svn: 39346
-
Steve Naroff authored
the prerocessor will be available via ASTContext). - Removed the public data member "PP" in ASTContext. - Changed ASTContext's contructor to take TargetInfo/IdentifierTable explicitly. - Implicitly create an ASTContext in Sema's constructor. This simplifies the clients job (and makes ASTContext more private). --As a side effect, added a "PrintStats" hook to Sema. To support this level of encapsulation, ASTContext is always dynamically allocated (by Sema). Previously, ASTContext was being allocated on the stack. I don't believe this should be a performance issue (since ASTContext is fairly course grain and tied to the lifetime of Sema currently). llvm-svn: 39345
-
- Jan 26, 2007
-
-
Chris Lattner authored
*** AST Context Stats: 30594 types total. 19 builtin types 3929 pointer types 308 array types 18883 function types with proto 8 function types with no proto 2988 typename (typedef) types 4459 tagged types 1476 struct types 80 union types 0 class types 2903 enum types 83298 slow type lookups Next up, making type canonicalization not trivially silly. llvm-svn: 39305
-
- Nov 10, 2006
-
-
Chris Lattner authored
llvm-svn: 39161
-
Chris Lattner authored
interface exported by libast. llvm-svn: 39154
-
- Nov 09, 2006
-
-
Chris Lattner authored
llvm-svn: 39153
-
- Nov 04, 2006
-
-
Chris Lattner authored
and should be implemented with an ASTBuilder subclass anyway. llvm-svn: 39107
-
- Nov 03, 2006
-
-
Chris Lattner authored
llvm-svn: 39095
-
- Oct 16, 2006
-
-
Chris Lattner authored
declarations through the asm streamer. For a testcase like: int G; int H, I, *J; int func() {} 'clang -parse-print-ast' prints: Read top-level decl: G Read top-level decl: H Read top-level decl: I Read top-level decl: J Read top-level decl: func llvm-svn: 38992
-
- Oct 06, 2006
-
-
Chris Lattner authored
llvm-svn: 38960
-
- Aug 23, 2006
-
-
Chris Lattner authored
Add callbacks for same. Add "full locinfo" mode. llvm-svn: 38939
-
- Aug 18, 2006
-
-
Chris Lattner authored
llvm-svn: 38938
-
- Aug 17, 2006
-
-
Chris Lattner authored
llvm-svn: 38936
-
Chris Lattner authored
llvm-svn: 38935
-