- Jul 22, 2009
-
-
Mike Stump authored
llvm-svn: 76716
-
- Apr 22, 2009
-
-
Douglas Gregor authored
identifiers from a precompiled header. This patch changes the primary name lookup method for entities within a precompiled header. Previously, we would load all of the names of declarations at translation unit scope into a large DenseMap (inside the TranslationUnitDecl's DeclContext), and then perform a special "last resort" lookup into this DeclContext when we knew there was a PCH file (see Sema::LookupName). Now, when we see an identifier named for the first time, we load all of the declarations with that name that are visible from the translation unit into the IdentifierInfo's chain of declarations. Thus, the explicit "look into the translation unit's DeclContext" code is gone, and Sema effectively uses the same IdentifierInfo-based name lookup mechanism whether we are using a PCH file or not. This approach should help PCH scale with the size of the input program rather than the size of the PCH file. The "Hello, World!" application with Carbon.h as a PCH file now loads 20% of the identifiers in the PCH file rather than 85% of the identifiers. 90% of the 20% of identifiers loaded are actually loaded when we deserialize the preprocessor state. The next step is to make the preprocessor load macros lazily, which should drastically reduce the number of types, declarations, and identifiers loaded for "Hello, World". llvm-svn: 69737
-
- Apr 20, 2009
-
-
Douglas Gregor authored
also gets access to the Sema object performing semantic analysis. This will be used by the PCH writer to serialize Sema state. No functionality change. llvm-svn: 69595
-
- Apr 19, 2009
-
-
Chris Lattner authored
llvm-svn: 69511
-
- Apr 14, 2009
-
-
Douglas Gregor authored
wrap-up (e.g., turning tentative definitions into definitions). Also, very that, when we actually use the PCH file, we get the ride code generation for tentative definitions and definitions that show up in the PCH file. llvm-svn: 69043
-
Douglas Gregor authored
non-inline external definitions (and tentative definitions) that are found at the top level. The corresponding declarations are stored in a record in the PCH file, so that they can be provided to the ASTConsumer (via HandleTopLevelDecl) when the PCH file is read. llvm-svn: 69005
-
- Mar 29, 2009
-
-
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
-
- Mar 28, 2009
-
-
Chris Lattner authored
pointer. Its purpose in life is to be a glorified void*, but which does not implicitly convert to void* or other OpaquePtr's with a different UID. Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This makes the C++ compiler enforce that these aren't convertible to other opaque types. We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc, but I don't plan to do that in the short term. The one outstanding known problem with this patch is that we lose the bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to bitmangle the success bit into the low bit of DeclPtrTy. I will rectify this with a subsequent patch. llvm-svn: 67952
-
Chris Lattner authored
TranslationUnit llvm-svn: 67913
-
Chris Lattner authored
llvm-svn: 67911
-
Chris Lattner authored
llvm-svn: 67910
-
Chris Lattner authored
happy with just ASTContext, they don't need a TU. llvm-svn: 67894
-
Chris Lattner authored
clang.cpp llvm-svn: 67890
-
- Jan 28, 2009
-
-
Ted Kremenek authored
Patch by Alexei Svitkine: Refactor Sema::ParseAST API to allow clients to pass as an argument a TranslationUnit object whose contents live beyond the call to ParseAST. llvm-svn: 63175
-
Steve Naroff authored
snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m 0.179u 0.051s 0:00.23 95.6% 0+0k 0+0io 0pf+0w snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m -disable-free 0.169u 0.052s 0:00.22 95.4% 0+0k 0+0io 0pf+0w llvm-svn: 63153
-
- Jan 20, 2009
-
-
Douglas Gregor authored
Remove the TopLevelDecls from TranslationUnit, since all of those decls are owned by the ASTContext's TranslationUnitDecl. There are definitely some leaking Decls now that I'll tackle tomorrow llvm-svn: 62568
-
- Oct 27, 2008
-
-
Daniel Dunbar authored
llvm-svn: 58281
-
- Oct 16, 2008
-
-
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
-
- Aug 20, 2008
-
-
Ted Kremenek authored
llvm-svn: 55038
-
- Aug 11, 2008
-
-
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
-
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
-
- Aug 08, 2008
-
-
Ted Kremenek authored
The motivation is that clients may either: (a) query the ASTConsumer object after AST parsing to collect data/etc. (b) reuse the ASTConsumer. llvm-svn: 54502
-
- Aug 07, 2008
-
-
Ted Kremenek authored
ModuleBuilder now performs llvmgen in HandleTranslationUnit. This patch follows from the discussion on the following thread on cfe-commits: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080804/006849.html llvm-svn: 54486
-
- Jul 02, 2008
-
-
Ted Kremenek authored
Added method "HandleTranslationUnit" to ASTConsumer. This is called by ParseAST when all of the ASTs in a translation unit have been built. llvm-svn: 53042
-
- Jun 16, 2008
-
-
Ted Kremenek authored
Patch by Nikita Zhuk! llvm-svn: 52336
-
- Jun 04, 2008
-
-
Ted Kremenek authored
Moved LangOptions from TranslationUnit to ASTContext. This induced a variety of cleanups in some ASTConsumers. llvm-svn: 51943
-
- May 31, 2008
-
-
Ted Kremenek authored
TranslationUnit object instead of an ASTContext. By default it calls Initialize(ASTConstext& Context) (to match with the current interface used by most ASTConsumers). Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit to not free its Decls. This is a workaround for: <rdar://problem/5966749> llvm-svn: 51825
-
- May 27, 2008
-
-
Eli Friedman authored
llvm-svn: 51580
-
- 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
-