aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization
AgeCommit message (Collapse)Author
2013-05-06Modify ASTReaderListener to allow visiting the input files of an AST file.Argyrios Kyrtzidis
We can pass such an input-file-visiting ASTReaderListener to ASTReader::readASTFileControlBlock. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181238 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04In VarDecl nodes, store the thread storage class specifier as written.Enea Zaffanella
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-04Implement template support for CapturedStmtWei Pan
- Sema tests added and CodeGen tests are pending Differential Revision: http://llvm-reviews.chandlerc.com/D728 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181101 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Rename ObjCImplementationDecl::getSuperLoc() -> getSuperClassLoc() for ↵Argyrios Kyrtzidis
consistency with ObjCInterfaceDecl::getSuperClassLoc() git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Serialization for captured statementsBen Langmuir
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Keep track of an @implementation's super class name location, if one was ↵Argyrios Kyrtzidis
provided. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181039 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Move parsing of identifiers in MS-style inline assembly intoJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180789 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[PCH/modules] Require the preprocessing record option to match the used PCH, ↵Argyrios Kyrtzidis
if modules are enabled. The preprocessing record becomes important when modules are enabled, since it is used to calculate the module cache hash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180635 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[Modules] Fix an issue where the reconstructed redeclaration chain was ↵Argyrios Kyrtzidis
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180634 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Implement C++1y decltype(auto).Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-20C++1y: Allow aggregates to have default initializers.Richard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17[Modules] Use global index to improve typo correction performanceArgyrios Kyrtzidis
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179730 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17Enhance the ObjC global method pool to record whether there were 0, 1, or >= ↵Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179652 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16Sema for Captured StatementsTareq A. Siraj
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179618 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16Implement CapturedStmt ASTTareq A. Siraj
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16Basic support for Microsoft property declarations andJohn McCall
references thereto. Patch by Tong Shen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith
the AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12<rdar://problem/13643854> Only emit ambiguous-expansion warnings when at ↵Douglas Gregor
least one of the macro definitions comes from a non-system header. This slightly weakens the heuristic introduced in r178109. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179411 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10Add an option to parse all comments as documentation commentsDmitri Gribenko
Patch by Amin Shali. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179180 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Pare back r164351 somewhat. The problem that change was addressing was that weRichard Smith
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178706 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Add 178663 back.Rafael Espindola
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Revert 178663.Rafael Espindola
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03[preprocessor] Allow comparing two macro definitions syntactically instead ↵Argyrios Kyrtzidis
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178671 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03Don't compute a patched/semantic storage class.Rafael Espindola
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03[modules] If a submodule has re-definitions of the same macro, only the last ↵Argyrios Kyrtzidis
definition will be used as the "exported" one. Fixes rdar://13562262 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02Objective-C: Provide fixit hints when warningFariborz Jahanian
about 'isa' ivar being explicitely accessed when base is a user class object reference. // rdar://13503456 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178562 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28Objective-C: Provide fixit suggestions when class objectFariborz Jahanian
is accessed via accessing 'isa' ivar to use object_getClass/object_setClass apis. // rdar://13503456 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27[modules] Make sure enabled diagnostic pragmas inside the module don't ↵Argyrios Kyrtzidis
affect the translation unit that imports the module. Getting diagnostic sections from modules properly working is a fixme. rdar://13516663 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27<rdar://problem/13509689> Introduce -module-file-info option that provides ↵Douglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178148 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27[modules] Before marking the module imported macros as ambiguous, check if ↵Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27[PCH/modules] Remove HiddenName::MacroUndefArgyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178107 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27[Preprocessor] Remove PPMutationListener.Argyrios Kyrtzidis
It's not used anymore. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178106 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26[Preprocessor/Modules] Separate the macro directives kinds into their own ↵Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178037 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22[PCH/Modules] De/Serialize MacroInfos separately than MacroDirectives.Argyrios Kyrtzidis
-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177761 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22[modules] When a MacroInfo object is deserialized, allocate and store its ↵Argyrios Kyrtzidis
submodule ID. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177760 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22<rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex ↵Douglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177750 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21Remove unused variable.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177657 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20<rdar://problem/12368093> Extend module maps with a 'conflict' declaration, ↵Douglas Gregor
and warn when a newly-imported module conflicts with an already-imported module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177577 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Only introduce the SDKSettings.plist dependency in modules/PCH files that ↵Douglas Gregor
don't depend on any other modules or PCH files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177542 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Make sure that Module::ConfigMacrosExhaustive gets initialized and ↵Douglas Gregor
deserialized correctly. This fixes regressions introduced in r177466 that caused several module tests to fail sporadically. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177481 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20<rdar://problem/10796651> Introduce configuration macros into module maps.Douglas Gregor
Configuration macros are macros that are intended to alter how a module works, such that we need to build different module variants for different values of these macros. A module can declare its configuration macros, in which case we will complain if the definition of a configation macro on the command line (or lack thereof) differs from the current preprocessor state at the point where the module is imported. This should eliminate some surprises when enabling modules, because "#define CONFIG_MACRO ..." followed by "#include <module/header.h>" would silently ignore the CONFIG_MACRO setting. At least it will no longer be silent about it. Configuration macros are eventually intended to help reduce the number of module variants that need to be built. When the list of configuration macros for a module is exhaustive, we only need to consider the settings for those macros when building/finding the module, which can help isolate modules for various project-specific -D flags that should never affect how modules are build (but currently do). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177466 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Minor optimization to r177367 to treat a module with missing dependencies as ↵Douglas Gregor
out-of-date rather than missing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177369 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19<rdar://problem/13363214> Eliminate race condition between module rebuild ↵Douglas Gregor
and the global module index. The global module index was querying the file manager for each of the module files it knows about at load time, to prune out any out-of-date information. The file manager would then cache the results of the stat() falls used to find that module file. Later, the same translation unit could end up trying to import one of the module files that had previously been ignored by the module cache, but after some other Clang instance rebuilt the module file to bring it up-to-date. The stale stat() results in the file manager would trigger a second rebuild of the already-up-to-date module, causing failures down the line. The global module index now lazily resolves its module file references to actual AST reader module files only after the module file has been loaded, eliminating the stat-caching race. Moreover, the AST reader can communicate to its caller that a module file is missing (rather than simply being out-of-date), allowing us to simplify the module-loading logic and allowing the compiler to recover if a dependent module file ends up getting deleted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18[PCH] Fix assertion hit related to enum decls inside templated funtions.Argyrios Kyrtzidis
Report and suggested fix by Tom Honermann! http://llvm.org/bugs/show_bug.cgi?id=13020 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177330 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15[modules] Don't record the macros from the predefines buffer.Argyrios Kyrtzidis
These will be available in the current translation unit anyway, for modules they only waste space and deserialization time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177197 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15<rdar://problem/13426257> Introduce SDKSettings.plist as an input file ↵Douglas Gregor
dependency for PCH/modules. When we're building a precompiled header or module against an SDK on Darwin, there will be a file SDKSettings.plist in the sysroot. Since stat()'ing every system header on which a module or PCH file depends is performance suicide, we instead stat() just SDKSettings.plist. This hack works well on Darwin; it's unclear how we want to handle this on other platforms. If there is a canonical file, we should use it; if not, we either have to take the performance hit of stat()'ing system headers repeatedly or roll the dice by not checking anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177194 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14[modules] Don't write the UnusedFileScopedDecls vector to the module file.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177001 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14[modules] Check for delegating constructor cycles when building a module and ↵Argyrios Kyrtzidis
don't write them out to the module file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177000 91177308-0d34-0410-b5e6-96231b3b80d8