summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix linkage computation for derived types in inline functions.Rafael Espindola2013-05-252-6/+4
| | | | | | | | | | | | | | | | | John noticed that the fix for pr15930 (r181981) didn't handle indirect uses of local types. For example, a pointer to local struct, or a function that returns it. One way to implement this would be to recursively look for local types. This would look a lot like the linkage computation itself for types. To avoid code duplication and utilize the existing linkage cache, this patch just makes the computation of "type with no linkage but externally visible because it is from an inline function" part of the linkage computation itself. llvm-svn: 182711
* [modules] If we hit a failure while loading a PCH/module, abort parsing ↵Argyrios Kyrtzidis2013-05-241-1/+4
| | | | | | | | | | instead of trying to continue in an invalid state. Also don't let libclang create a PCH with such an error. Fixes rdar://13953768 llvm-svn: 182629
* Fix bitcode desynchronization when loading a PCH containing a class templateRichard Smith2013-05-231-15/+38
| | | | | | | | | | | specialization with modules enabled. Just don't merge them at all for now; we'll revisit this when support for template merging is added. In passing, make Decl::dump() a little safer to use with PCH/modules, by making it not deserialize any additional declarations. From a debugger you can call decls_begin() or similar first if you want to dump all child decls. llvm-svn: 182544
* Revert r182331, these checks should be based on the target not the host.Richard Smith2013-05-201-4/+1
| | | | llvm-svn: 182333
* Move two Darwin-specific hacks into #ifdef __APPLE__. These were stat'ingRichard Smith2013-05-201-1/+4
| | | | | | nonexistent Darwin-specific files on every module build. llvm-svn: 182331
* First pass of semantic analysis for init-captures: check the initializer, buildRichard Smith2013-05-162-9/+35
| | | | | | | | | | | | | a FieldDecl from it, and propagate both into the closure type and the LambdaExpr. You can't do much useful with them yet -- you can't use them within the body of the lambda, because we don't have a representation for "the this of the lambda, not the this of the enclosing context". We also don't have support or a representation for a nested capture of an init-capture yet, which was intended to work despite not being allowed by the current standard wording. llvm-svn: 181985
* OpenMP threadprivate with qualified names.Alexey Bataev2013-05-131-2/+2
| | | | llvm-svn: 181683
* Cleanup handling of UniqueExternalLinkage.Rafael Espindola2013-05-132-4/+4
| | | | | | | | | | | | | This patch renames getLinkage to getLinkageInternal. Only code that needs to handle UniqueExternalLinkage specially should call this. Linkage, as defined in the c++ standard, is provided by getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage. Most places in the compiler actually want isExternallyVisible, which handles UniqueExternalLinkage as internal. llvm-svn: 181677
* C++1y deduced return types: when we deduce a return type for a function whichRichard Smith2013-05-113-2/+29
| | | | | | | we loaded from PCH, if we're building another PCH, create an update record to patch the return type of the earlier declaration. llvm-svn: 181659
* [Modules] When things go horribly wrong when reading a module, point at the ↵Douglas Gregor2013-05-101-0/+8
| | | | | | | | | | module cache. Sometimes people hack on their system headers. In such cases, they'll need to delete their module cache, but may not know where it is. Add a note to show them where it is. llvm-svn: 181638
* ArrayRef'ize ShuffleVectorExpr::setExprsDmitri Gribenko2013-05-101-1/+1
| | | | | | But ShuffleVectorExpr should be tail-allocating the storage for expressions. llvm-svn: 181572
* [PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.Argyrios Kyrtzidis2013-05-081-10/+1
| | | | | | | | This made sense in pre-module era, before merging of HeaderFileInfos was introduced. Final part of rdar://13840148. llvm-svn: 181490
* [modules] When building a module, make sure we don't serialize out ↵Argyrios Kyrtzidis2013-05-081-0/+2
| | | | | | | | | | | HeaderFileInfo for headers not belonging to the module. After r180934 we may initiate module map parsing for modules not related to the module what we are building, make sure we ignore the header file info of headers from such modules. First part of rdar://13840148 llvm-svn: 181489
* Modify ASTReaderListener to allow visiting the input files of an AST file.Argyrios Kyrtzidis2013-05-061-8/+58
| | | | | | We can pass such an input-file-visiting ASTReaderListener to ASTReader::readASTFileControlBlock. llvm-svn: 181238
* In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella2013-05-042-5/+5
| | | | llvm-svn: 181113
* Implement template support for CapturedStmtWei Pan2013-05-042-3/+7
| | | | | | | | - Sema tests added and CodeGen tests are pending Differential Revision: http://llvm-reviews.chandlerc.com/D728 llvm-svn: 181101
* Rename ObjCImplementationDecl::getSuperLoc() -> getSuperClassLoc() for ↵Argyrios Kyrtzidis2013-05-031-1/+1
| | | | | | consistency with ObjCInterfaceDecl::getSuperClassLoc() llvm-svn: 181064
* Serialization for captured statementsBen Langmuir2013-05-034-9/+65
| | | | | | | | | | | Add serialization for captured statements and captured decls. Also add a const_capture_iterator to CapturedStmt. Test contributed by Wei Pan Differential Revision: http://llvm-reviews.chandlerc.com/D727 llvm-svn: 181048
* Keep track of an @implementation's super class name location, if one was ↵Argyrios Kyrtzidis2013-05-032-0/+2
| | | | | | provided. llvm-svn: 181039
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-034-33/+128
| | | | | | | | | | | | | | | | | | | | | the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. llvm-svn: 180976
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-302-1/+4
| | | | | | | | are now two distinct canonical 'AutoType's: one is the undeduced 'auto' placeholder type, and the other is a deduced-but-dependent type. All deduced-to-a-non-dependent-type cases are still non-canonical. llvm-svn: 180789
* [PCH/modules] Require the preprocessing record option to match the used PCH, ↵Argyrios Kyrtzidis2013-04-262-3/+17
| | | | | | | | | if modules are enabled. The preprocessing record becomes important when modules are enabled, since it is used to calculate the module cache hash. llvm-svn: 180635
* [Modules] Fix an issue where the reconstructed redeclaration chain was ↵Argyrios Kyrtzidis2013-04-262-7/+41
| | | | | | | | | | | | | incomplete, missing the definition from a module. -Make sure that a deserialized external decl gets added to the TU scope. -When associating an identifier with a set of decls, use the most recent local ones, if they exist, otherwise associating decls from modules (that came after a local one) will lead to an incomplete reconstructed re-declaration chain. rdar://13712705 llvm-svn: 180634
* Implement C++1y decltype(auto).Richard Smith2013-04-262-2/+6
| | | | llvm-svn: 180610
* C++1y: Allow aggregates to have default initializers.Richard Smith2013-04-202-0/+16
| | | | | | | | | | | Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in CXXCtorInitializers and in InitListExprs to represent a default initializer. There's an additional complication here: because the default initializer can refer to the initialized object via its 'this' pointer, we need to make sure that 'this' points to the right thing within the evaluation. llvm-svn: 179958
* [Modules] Use global index to improve typo correction performanceArgyrios Kyrtzidis2013-04-172-1/+35
| | | | | | | | | Typo correction for an unqualified name needs to walk through all of the identifier tables of all modules. When we have a global index, just walk its identifier table only. rdar://13425732 llvm-svn: 179730
* Enhance the ObjC global method pool to record whether there were 0, 1, or >= ↵Argyrios Kyrtzidis2013-04-173-16/+39
| | | | | | | | | 2 methods (with a particular selector) inside categories. This is done by extending ObjCMethodList (which is only used by the global method pool) to have 2 extra bits of information. We will later take advantage of this info in global method pool for the overridden methods calculation. llvm-svn: 179652
* Sema for Captured StatementsTareq A. Siraj2013-04-163-0/+15
| | | | | | | | | | | | | Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic analysis. Currently captures all variables by reference. TODO: templates Author: Ben Langmuir <ben.langmuir@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D433 llvm-svn: 179618
* Implement CapturedStmt ASTTareq A. Siraj2013-04-162-0/+15
| | | | | | | | | | | | | | | CapturedStmt can be used to implement generic function outlining as described in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html. CapturedStmt is not exposed to the C api. Serialization and template support are pending. Author: Wei Pan <wei.pan@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D370 llvm-svn: 179615
* Basic support for Microsoft property declarations andJohn McCall2013-04-166-0/+42
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-132-5/+5
| | | | | | the AST. llvm-svn: 179447
* <rdar://problem/13643854> Only emit ambiguous-expansion warnings when at ↵Douglas Gregor2013-04-121-26/+8
| | | | | | | | least one of the macro definitions comes from a non-system header. This slightly weakens the heuristic introduced in r178109. llvm-svn: 179411
* Add an option to parse all comments as documentation commentsDmitri Gribenko2013-04-102-3/+5
| | | | | | Patch by Amin Shali. llvm-svn: 179180
* Pare back r164351 somewhat. The problem that change was addressing was that weRichard Smith2013-04-033-7/+7
| | | | | | | | don't serialize a lookup map for the translation unit outside C++ mode, so we can't tell when lookup within the TU needs to look within modules. Only apply the fix outside C++ mode, and only to the translation unit. llvm-svn: 178706
* Add 178663 back.Rafael Espindola2013-04-032-9/+3
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-032-3/+9
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* [preprocessor] Allow comparing two macro definitions syntactically instead ↵Argyrios Kyrtzidis2013-04-031-1/+2
| | | | | | | | | | | | | | of only lexically. Syntactically means the function macro parameter names do not need to use the same identifiers in order for the definitions to be considered identical. Syntactic equivalence is a microsoft extension for macro redefinitions and we'll also use this kind of comparison to check for ambiguous macros coming from modules. rdar://13562254 llvm-svn: 178671
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-032-9/+3
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* [modules] If a submodule has re-definitions of the same macro, only the last ↵Argyrios Kyrtzidis2013-04-031-0/+6
| | | | | | | | definition will be used as the "exported" one. Fixes rdar://13562262 llvm-svn: 178622
* Objective-C: Provide fixit hints when warningFariborz Jahanian2013-04-022-0/+2
| | | | | | | | about 'isa' ivar being explicitely accessed when base is a user class object reference. // rdar://13503456 llvm-svn: 178562
* Objective-C: Provide fixit suggestions when class objectFariborz Jahanian2013-03-282-0/+2
| | | | | | | | is accessed via accessing 'isa' ivar to use object_getClass/object_setClass apis. // rdar://13503456 llvm-svn: 178282
* [modules] Make sure enabled diagnostic pragmas inside the module don't ↵Argyrios Kyrtzidis2013-03-271-3/+9
| | | | | | | | | | | | affect the translation unit that imports the module. Getting diagnostic sections from modules properly working is a fixme. rdar://13516663 llvm-svn: 178151
* <rdar://problem/13509689> Introduce -module-file-info option that provides ↵Douglas Gregor2013-03-272-4/+15
| | | | | | | | | | | information about a particular module file. This option can be useful for end users who want to know why they ended up with a ton of different variants of the "std" module in their module cache. This problem should go away over time, as we reduce the need for module variants, but it will never go away entirely. llvm-svn: 178148
* [modules] Before marking the module imported macros as ambiguous, check if ↵Argyrios Kyrtzidis2013-03-271-11/+57
| | | | | | | | | | | | | this is a case where the system macro uses a not identical definition compared to a macro from the clang headers. For example (these come from different modules): \#define LONG_MAX __LONG_MAX__ (clang's limits.h) \#define LONG_MAX 0x7fffffffffffffffL (system's limits.h) in which case don't mark them ambiguous to avoid the "ambiguous macro expansion" warning. llvm-svn: 178109
* [PCH/modules] Remove HiddenName::MacroUndefArgyrios Kyrtzidis2013-03-271-5/+0
| | | | llvm-svn: 178107
* [Preprocessor] Remove PPMutationListener.Argyrios Kyrtzidis2013-03-272-5/+1
| | | | | | It's not used anymore. llvm-svn: 178106
* [Preprocessor/Modules] Separate the macro directives kinds into their own ↵Argyrios Kyrtzidis2013-03-262-82/+123
| | | | | | | | | | | | | | | | MacroDirective's subclasses. For each macro directive (define, undefine, visibility) have a separate object that gets chained to the macro directive history. This has several benefits: -No need to mutate a MacroDirective when there is a undefine/visibility directive. Stuff like PPMutationListener become unnecessary. -No need to keep extra source locations for the undef/visibility locations for the define directive object (which is the majority of the directives) -Much easier to hide/unhide a section in the macro directive history. -Easier to track the effects of the directives across different submodules. llvm-svn: 178037
* [PCH/Modules] De/Serialize MacroInfos separately than MacroDirectives.Argyrios Kyrtzidis2013-03-222-279/+454
| | | | | | | | | -Serialize the macro directives history into its own section -Get rid of the macro updates section -When de/serializing an identifier from a module, associate only one macro per submodule that defined+exported it. llvm-svn: 177761
* [modules] When a MacroInfo object is deserialized, allocate and store its ↵Argyrios Kyrtzidis2013-03-221-1/+1
| | | | | | submodule ID. llvm-svn: 177760
* <rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex ↵Douglas Gregor2013-03-223-113/+55
| | | | | | | | | | | | | | interaction to eliminate a pile of extraneous stats(). The refactoring in r177367 introduced a serious performance bug where the "lazy" resolution of module file names in the global module index to actual module file entries in the module manager would perform repeated negative stats(). The new interaction requires the module manager to inform the global module index when a module file has been loaded, eliminating the extraneous stat()s and a bunch of bookkeeping on both sides. llvm-svn: 177750
OpenPOWER on IntegriCloud