summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Add PCH support for ObjCMessageExpr (needed to build Mail).Steve Naroff2009-04-252-0/+35
| | | | llvm-svn: 70044
* Fixup comment.Steve Naroff2009-04-251-1/+1
| | | | llvm-svn: 70040
* Fix a major bug in PCHReader::ReadSelectorBlock().Steve Naroff2009-04-252-7/+8
| | | | | | Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris. llvm-svn: 70039
* Make sure that the consumer sees all interested decls. This fixes PreviewDouglas Gregor2009-04-251-15/+26
| | | | llvm-svn: 70007
* Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked upTed Kremenek2009-04-252-0/+2
| | | | | | | | to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function increments the reference count of a passed object. llvm-svn: 70005
* When we de-serialize an Objective-C protocol, hand it to the AST consumer so ↵Douglas Gregor2009-04-241-0/+3
| | | | | | that we can create metadata llvm-svn: 70003
* Add new checker-specific attribute 'objc_ownership_returns'. This isn't hookedTed Kremenek2009-04-242-0/+2
| | | | | | | up to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function returns an owned an Objective-C object. llvm-svn: 70001
* Once the protocol list has been loaded from the PCH file, add it toDouglas Gregor2009-04-241-0/+1
| | | | | | the Objective-C interface. llvm-svn: 69993
* Fix two small but very nasty bugs in the PCH writer for method pools:Douglas Gregor2009-04-241-5/+10
| | | | | | | | | | | | (1) Make sure to pad on-disk hash tables with 4 bytes, not 2, since the reader assumes that bucket data is aligned on 4-byte boundaries. (2) Don't emit the number of factory methods twice. This was throwing off the data counts and therefore causing lookups to fail. I've added asserts so that this class of error cannot happen again. llvm-svn: 69991
* PCH support for the global method pool (= instance and factory methodDouglas Gregor2009-04-242-1/+307
| | | | | | | | pools, combined). The methods in the global method pool are lazily loaded from an on-disk hash table when Sema looks into its version of the hash tables. llvm-svn: 69989
* Add PCH support for #import.Steve Naroff2009-04-242-4/+33
| | | | llvm-svn: 69987
* Use cast_or_null instead of ternary operator (suggested by Doug).Steve Naroff2009-04-241-3/+1
| | | | llvm-svn: 69975
* Allow the next catoregory slot to be null.Steve Naroff2009-04-241-1/+3
| | | | llvm-svn: 69969
* Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's ↵Douglas Gregor2009-04-242-2/+2
| | | | | | | | | | | good for uniformity is good for PCH (or is it the other way around?). As part of this, make ObjCImplDecl inherit from NamedDecl (since ObjCImplementationDecls now need to have names so that they can be found). This brings ObjCImplDecl very, very close to ObjCContainerDecl; we may be able to merge them soon. llvm-svn: 69941
* Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls inDouglas Gregor2009-04-231-1/+1
| | | | | | | | | | | | their own namespace (IDNS_Protocol) and use the normal name-lookup routines to find them. Aside from the simplification this provides (one less DenseMap!), it means that protocols will be lazily deserialized from PCH files. Make the code size of the selector table block match the code size of the type and decl blocks. llvm-svn: 69939
* PCH support for categories in Objective-C interfaces.Douglas Gregor2009-04-232-3/+3
| | | | llvm-svn: 69933
* PCH support for all of the predefined Objective-C types, such as id,Douglas Gregor2009-04-232-1/+19
| | | | | | | | SEL, Class, Protocol, CFConstantString, and __objcFastEnumerationState. With this, we can now run the Objective-C methods and properties PCH tests. llvm-svn: 69932
* Fix handling of C99 "extern inline" semantics when dealing withDouglas Gregor2009-04-232-0/+2
| | | | | | | multiple declarations of the function. Should fix PR3989 and <rdar://problem/6818429>. llvm-svn: 69905
* More PushOnScopeChain() FIXME's.Steve Naroff2009-04-231-1/+0
| | | | llvm-svn: 69894
* Sema::ActOnStartClassInterface(): Use PushOnScopeChains().Steve Naroff2009-04-231-1/+1
| | | | | | This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate. llvm-svn: 69891
* Add PCH read/write support for Objective-C Selectors.Steve Naroff2009-04-232-9/+141
| | | | | Note: This support is non-lazy. Once we get "Cocoa.h" humming, we can optimize this. llvm-svn: 69884
* PCH (de-)serialization of the protocols in an ObjCInterfaceDeclDouglas Gregor2009-04-232-2/+12
| | | | llvm-svn: 69860
* Add the PCH reader stub for ObjCCompatibleAliasDeclDouglas Gregor2009-04-231-1/+1
| | | | llvm-svn: 69859
* PCH support for ObjCPropertyImplDeclDouglas Gregor2009-04-232-3/+11
| | | | llvm-svn: 69858
* The ivars in an ObjCImplementationDecl are now stored in theDouglas Gregor2009-04-232-3/+4
| | | | | | | DeclContext rather than in a separate list. This makes PCH (de-)serialization trivial, so that ivars can be loaded lazily. llvm-svn: 69857
* PCH support for ObjCCategoryImplDecl (which can't be tested now).Douglas Gregor2009-04-232-3/+3
| | | | llvm-svn: 69856
* PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.Douglas Gregor2009-04-232-2/+5
| | | | llvm-svn: 69855
* 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
OpenPOWER on IntegriCloud