summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* PCH support for Objective-C property declarations (UNTESTED!)Douglas Gregor2009-04-222-4/+33
| | | | llvm-svn: 69843
* Add PCH statistics for the number/percent of lexical/visible declcontexts readDouglas Gregor2009-04-222-1/+18
| | | | llvm-svn: 69835
* Add PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange andTed Kremenek2009-04-221-2/+2
| | | | | | | indicate whether or not the range represents an absolute range or should be extended by lexing to the end of the token. llvm-svn: 69834
* Support locally-declared external declarations in PCH filesDouglas Gregor2009-04-222-0/+31
| | | | llvm-svn: 69833
* Support tentative definitions in precompiled headers. This isn't likelyDouglas Gregor2009-04-222-0/+28
| | | | | | to happen (ever), but at least we'll do the right thing when it does. llvm-svn: 69829
* Eliminate some FIXMEs in the PCH reader that were either already fixed or ↵Douglas Gregor2009-04-221-15/+9
| | | | | | aren't actually things to fix llvm-svn: 69827
* Minimize the number and kind of "external definitions" that the PCHDouglas Gregor2009-04-222-19/+21
| | | | | | | | | | | | | | | | | | | | | | | file needs to store. CodeGen needs to see these definitions (via HandleTopLevelDecl), otherwise it won't be able to generate code for them. This patch notifies the consumer (e.g., CodeGen) about function definitions and variable definitions when the corresponding declarations are deserialized. Hence, we don't eagerly deserialize the declarations for every variable or function that has a definition in the PCH file. This gives another 5% speedup for the Carbon-prefixed "Hello, World!", and brings our PCH statistics down to something far more reasonable: *** PCH Statistics: 13/20693 types read (0.062823%) 17/59230 declarations read (0.028702%) 54/44914 identifiers read (0.120230%) 0/32954 statements read (0.000000%) 5/6187 macros read (0.080815%) llvm-svn: 69820
* Lazy loading of builtins for precompiled headers.Douglas Gregor2009-04-222-11/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCH files now contain complete information about builtins, including any declarations that have been synthesized as part of building the PCH file. When using a PCH file, we do not initialize builtins at all; when needed, they'll be found in the PCH file. This optimization translations into a 9% speedup for "Hello, World!" with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc with its prefix header. We're also reading less of the PCH file for "Hello, World!": *** PCH Statistics: 286/20693 types read (1.382110%) 1630/59230 declarations read (2.751984%) 764/44914 identifiers read (1.701029%) 1/32954 statements read (0.003035%) 5/6187 macros read (0.080815%) down from *** PCH Statistics: 411/20693 types read (1.986179%) 2553/59230 declarations read (4.310316%) 1093/44646 identifiers read (2.448148%) 1/32954 statements read (0.003035%) 21/6187 macros read (0.339421%) llvm-svn: 69815
* Remove some debugging output from the PCH readerDouglas Gregor2009-04-221-3/+0
| | | | llvm-svn: 69803
* Add another workaround for -include.Daniel Dunbar2009-04-221-3/+9
| | | | | | | | | | | | - If we don't find a file looking relative to the current working directory, fall back to header search. This is closer to what would happen if the lookup was starting from right directory in the first place (except it will find files in the directory of the main source file, which I *think* should not be found). - PR3992. llvm-svn: 69794
* ObjCQualifiedClass is dead, remove it.Chris Lattner2009-04-222-14/+0
| | | | llvm-svn: 69783
* deserialization support for qualified interfacesChris Lattner2009-04-221-4/+9
| | | | llvm-svn: 69782
* pch support for protocol qualified id's.Chris Lattner2009-04-222-4/+9
| | | | llvm-svn: 69781
* add three new objc expression types. @selector doesn't work because we have no Chris Lattner2009-04-222-2/+65
| | | | | | way to serialize selectors yet. llvm-svn: 69780
* implement serialization support for @encode,Chris Lattner2009-04-222-4/+38
| | | | | | | fix a couple of bugs in reader support for ObjCInterfaceDecl, and add support for reading ObjCInterfaceType. llvm-svn: 69779
* Reorganize built-in initialization to separate the creation of target ↵Douglas Gregor2009-04-221-0/+3
| | | | | | builtins from marking IdentifierInfos as builtins. No functionality change llvm-svn: 69774
* Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,Chris Lattner2009-04-221-2/+6
| | | | | | | | | | | | | | | | | | | | by marking the predefines buffer as a system header. The problem with stdint is that it was getting problems like this: /Volumes/Projects/cvs/llvm/Debug/lib/clang/1.0/include/stdint.h:43:9: warning: 'long long' is an extension when C99 mode is not enabled typedef __INT64_TYPE__ int64_t; ^ <built-in>:73:29: note: instantiated from: #define __INT64_TYPE__ long long ^ We correctly silence warnings in system headers, but only if the spelling location of the token came from the system header. This is designed so that if you use a system macro in your code that you don't get punished for its definition. This is all cool except that the predefines buffer wasn't considered a system header. llvm-svn: 69770
* Lazy deserialization of macro definitions for precompiled headers.Douglas Gregor2009-04-212-53/+131
| | | | | | | | | | | | | | | This optimization improves performance on the Carbon-prefixed "Hello, World!" example by 57%. For reference, we're now about 2.25x faster than GCC PCH. We're also pulling in far less of the PCH file: *** PCH Statistics: 411/20693 types read (1.986179%) 2553/59230 declarations read (4.310316%) 1093/44646 identifiers read (2.448148%) 1/32954 statements read (0.003035%) 21/6187 macros read (0.339421%) llvm-svn: 69755
* Don't bother writing a visible-declarations record for the translationDouglas Gregor2009-04-211-3/+5
| | | | | | | unit into the PCH file, since we won't be performing name lookup into it anyway. Reduces the size of the Carbon.h PCH file by ~200k. llvm-svn: 69739
* Lazy deserialization of the declaration chains associated withDouglas Gregor2009-04-212-52/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Plist diagnostics: Remove deprecated single-point locations in control-flowTed Kremenek2009-04-211-8/+1
| | | | | | pieces. llvm-svn: 69719
* Add pch reader/writer support for most of DeclObjC.h. Very close to ↵Steve Naroff2009-04-212-5/+238
| | | | | | | | reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's). Once selector support is in place, we should be able to take this for a spin (and add test cases). llvm-svn: 69674
* this time with more workingness.Chris Lattner2009-04-211-1/+0
| | | | llvm-svn: 69669
* fix massive testsuite failures from Alexei's patch due to inverted logic.Chris Lattner2009-04-211-9/+7
| | | | llvm-svn: 69666
* Split preprocessor initialization logic out of clang-cc intoChris Lattner2009-04-212-0/+470
| | | | | | libfrontend. Patch by Alexei Svitkine! llvm-svn: 69664
* make "in included from" and "in instatiation from" messages respectChris Lattner2009-04-211-9/+15
| | | | | | -fno-show-location, patch by Alexei Svitkine (PR4024) llvm-svn: 69657
* Write the identifier table into the PCH file as an on-disk hash tableDouglas Gregor2009-04-202-20/+101
| | | | | | | | | | | that also includes the contents of the IdentifierInfo itself (the various fields and flags, along with the chain of identifiers visible at the top level that have that name). We don't make any use of the hash table yet, except that our identifier ID -> string mapping points into the hash table now. llvm-svn: 69625
* Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ↵Steve Naroff2009-04-202-0/+76
| | | | | | | | ObjCIvarDecl. Next step: Add selector support to PCHWriter::AddDeclarationName(). llvm-svn: 69619
* the __gnuc_inline__ attribute is actually named __gnu_inline__,Chris Lattner2009-04-202-2/+2
| | | | | | PR4023 llvm-svn: 69618
* Introduce the notion of a SemaConsumer, which is an ASTConsumer thatDouglas Gregor2009-04-201-1/+5
| | | | | | | | | 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
* Add pch reader/writer support for ObjCMethodDecl.Steve Naroff2009-04-202-0/+58
| | | | | | Test will be enabled with ObjCInterfaceDecl is added. llvm-svn: 69594
* don't crash on invalid ranges in -fprint-source-range-infoChris Lattner2009-04-191-0/+3
| | | | | | mode, just ignore them as usual. llvm-svn: 69558
* implement compiler support for -fno-diagnostics-fixit-info,Chris Lattner2009-04-191-3/+2
| | | | | | rdar://6805442 llvm-svn: 69525
* Add location info for indirect goto.Chris Lattner2009-04-192-0/+2
| | | | llvm-svn: 69497
* Don't emit name-lookup tables for functions or methods in the PCH filesDouglas Gregor2009-04-181-0/+5
| | | | llvm-svn: 69449
* Store the type ID for __builtin_va_list in the PCH file, so that theDouglas Gregor2009-04-182-1/+16
| | | | | | | | AST context's __builtin_va_list type will be set when the PCH file is loaded. This fixes the crash when CodeGen'ing a va_arg expression pulled in from a PCH file. llvm-svn: 69421
* Lazy deserialization of function bodies for PCH files. For the CarbonDouglas Gregor2009-04-181-1/+10
| | | | | | | | | | "Hello, World!", this takes us from deserializing 6469 statements/expressions down to deserializing 1 statement/expression. It only translated into a 1% improvement on the Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b) we expect this to matter more once we lazily deserialize identifiers. llvm-svn: 69407
* FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor2009-04-181-4/+6
| | | | | | | | lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. llvm-svn: 69406
* Keep track of the number of statements/expressions written to and readDouglas Gregor2009-04-172-2/+19
| | | | | | | from a PCH file. It turns out that "Hello, World!" is bringing in 19% of all of the statements in Carbon.h, so we need to be lazy. llvm-svn: 69393
* PCH support for inline assembly statements.Douglas Gregor2009-04-172-3/+75
| | | | | | | This completes support for all of C (+ extensions). We can (again) build a PCH file for Carbon.h. llvm-svn: 69385
* refactor htmldiags to be created up front like the other diag clients.Chris Lattner2009-04-171-15/+8
| | | | llvm-svn: 69379
* PCH tests for va_arg expressions. Verified that the blocks test does create ↵Douglas Gregor2009-04-171-2/+0
| | | | | | a BlockDeclRefExpr llvm-svn: 69376
* PCH support for blocksDouglas Gregor2009-04-172-1/+22
| | | | llvm-svn: 69373
* PCH support for GNU statement expressionsDouglas Gregor2009-04-172-0/+22
| | | | llvm-svn: 69370
* PCH support for indirect gotos and address-of-label expressions.Douglas Gregor2009-04-172-0/+70
| | | | llvm-svn: 69369
* PCH support for labels and goto.Douglas Gregor2009-04-172-1/+95
| | | | llvm-svn: 69364
* PCH support for declaration statements, and a test for PredefinedExprDouglas Gregor2009-04-172-1/+35
| | | | llvm-svn: 69356
* PCH support for return statements.Douglas Gregor2009-04-172-0/+22
| | | | | | | Optimize PCH encoding for switch-case statements slightly, by making the switch-case numbering local to a particular statement. llvm-svn: 69355
* PCH support for do-while and for loopsDouglas Gregor2009-04-172-0/+48
| | | | llvm-svn: 69334
* PCH support for while and continue statementsDouglas Gregor2009-04-172-0/+40
| | | | llvm-svn: 69332
OpenPOWER on IntegriCloud