summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When module umbrellas change, rebuild themBen Langmuir2014-04-101-59/+63
| | | | | | | With the VFS, it is easy to hit modified umbrellas by overriding the umbrella header, and what we want is to rebuild, not to fail. llvm-svn: 205975
* [Preprocessor/CodeComplete] Don't add include guard macros to ↵Argyrios Kyrtzidis2014-04-091-0/+1
| | | | | | code-completion results. llvm-svn: 205917
* Have validate-system-headers override validate-once-per-build-sessionBen Langmuir2014-04-081-1/+1
| | | | llvm-svn: 205773
* Reapply "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner2014-03-281-55/+77
| | | | | | | | | | | | | Committed this by accident before it was done last time. Original message: Rather than rolling our own functions to read little endian data from a buffer, we can use the support in llvm's Endian.h. No functional change. llvm-svn: 205062
* Revert "OnDiskHashTable: Use Endian.h to read little endian ostreams"Justin Bogner2014-03-281-77/+55
| | | | | | This reverts commit r205045. llvm-svn: 205048
* OnDiskHashTable: Use Endian.h to read little endian ostreamsJustin Bogner2014-03-281-55/+77
| | | | | | | | | Rather than rolling our own functions to read little endian data from a buffer, we can use the support in llvm's Endian.h. No functional change. llvm-svn: 205045
* Fix a FIXME, use std::move.Richard Smith2014-03-281-3/+3
| | | | llvm-svn: 205021
* Comment parsing: when comment ranges are deserialized from multiple modules,Dmitri Gribenko2014-03-271-3/+4
| | | | | | | | | correctly order comments in SourceManager::isBeforeInTranslationUnit() order Unfortunately, this is not as simple as it was implemented previously, and actually requires doing a merge sort. llvm-svn: 204936
* If an update record makes a declaration interesting, pass it to the consumer.Richard Smith2014-03-231-14/+14
| | | | llvm-svn: 204550
* Fixing code that doesn't compile in MSVC 2012 (but does in MSVC 2013) from ↵Aaron Ballman2014-03-211-1/+1
| | | | | | r204417 and related commits. llvm-svn: 204471
* PR19215: When writing/reading a PCH that imported a module, store the locationRichard Smith2014-03-211-7/+12
| | | | | | | at which that PCH imported each visible submodule of the module. Such locations are needed when synthesizing macro directives resulting from the import. llvm-svn: 204417
* When the exception specification for a function in an imported PCH or module isRichard Smith2014-03-201-17/+25
| | | | | | resolved, emit an update record. llvm-svn: 204403
* Rearrange serialization block order to put decl update emission into the sameRichard Smith2014-03-201-11/+10
| | | | | | | | block as decl and type emission. This allows decl updates include statements and expressions. No functionality change (but the generated PCM files are incompatible with earlier versions of Clang). llvm-svn: 204385
* Fix PR18806: Canonicalize the replacement type when deserializing a ↵Stephan Tolksdorf2014-03-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | SubstTemplateTypeParmType What's going on in the test case (without the patch applied) is this: When the header is parsed, decltype(B()) is canonicalized to decltype(Y()), because that was the first parsed equivalent decltype expression. Hence, the TemplateSpecializationType for Id<decltype(B())> ends up with SubstTemplateTypeParmType(T, decltype(Y())) as the AliasedType member. When the PCH file is included and the AST reader reads Id<decltype(B())>, it sees decltype(B()) before decltype(Y()). So, this time decltype(B()) ends up being the canonical type for both decltypes, which leads to an assert violation when the reader calls getSubstTemplateTypeParmType with the non-canonical decltype(Y()) as the replacement type. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits, aemerson Differential Revision: http://llvm-reviews.chandlerc.com/D3073 llvm-svn: 204005
* Fix VS2012 build after r203881Hans Wennborg2014-03-141-1/+2
| | | | llvm-svn: 203951
* [Modules] Emit the module file paths as dependencies of the PCH when we are ↵Argyrios Kyrtzidis2014-03-141-0/+7
| | | | | | | | | | | building one. This is because the PCH is tied to the module files, if one of the module files changes or gets removed the build system should re-build the PCH file. rdar://16321245 llvm-svn: 203885
* [Modules] Make sure that the synthesized file "__inferred_module.map" ↵Argyrios Kyrtzidis2014-03-141-6/+11
| | | | | | | | doesn't show up as dependency of a module file. Follow-up for rdar://15459210 llvm-svn: 203882
* Refactor ASTReader::readInputFileInfo to return a struct containing the ↵Argyrios Kyrtzidis2014-03-141-14/+15
| | | | | | | | related information. No functionality change. llvm-svn: 203881
* [C++11] Replacing ObjCContainerDecl iterators meth_begin() and meth_end() ↵Aaron Ballman2014-03-131-3/+2
| | | | | | with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203832
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-131-8/+8
| | | | | | class. llvm-svn: 203746
* Revert C++11ification in r203534 and r203536. Apparently our toolchains aren'tRichard Smith2014-03-111-16/+11
| | | | | | ready for this yet. llvm-svn: 203548
* Speculative workaround for apparent libstdc++ bug exposed by r203534.Richard Smith2014-03-111-0/+3
| | | | llvm-svn: 203536
* If a visibility update record is found for a DeclContext after that Decl hasRichard Smith2014-03-111-8/+16
| | | | | | | already been loaded, apply that update record to the Decl immediately, rather than adding it to a pending list and never applying it. llvm-svn: 203534
* Module [extern_c] attribute: inherit to submodules, don't write 'extern "C"'Richard Smith2014-03-081-9/+12
| | | | | | blocks when building in C mode, and serialize and deserialize the attribute. llvm-svn: 203317
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-2/+2
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Add a bunch of missing changes from r203208Ben Langmuir2014-03-071-106/+123
| | | | | | Somehow lost these in a git operation. llvm-svn: 203210
* Add dependencies from imported modules with -MDBen Langmuir2014-03-071-11/+94
| | | | | | | | Add module dependencies to the dependency files created by -MD/-MMD/etc. by attaching an ASTReaderListener that will call into the dependency file generator when a module input file is seen in the serialized AST. llvm-svn: 203208
* [C++11] Replacing iterators redecls_begin() and redecls_end() with ↵Aaron Ballman2014-03-061-24/+13
| | | | | | iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely. llvm-svn: 203179
* Fix crash if a submodule overrides one of its own macros, and add support forRichard Smith2014-03-061-1/+2
| | | | | | | | submodule macro overriding within the same top-level module (necessary for the testcase to be remotely reasonable). Incidentally reduces the number of libc++ testsuite regressions with modules enabled from 7 to 6. llvm-svn: 203063
* Switch to an idiomatic C++ erase/remove for this loop, and fix a bug in theRichard Smith2014-03-061-3/+5
| | | | | | | process (I don't believe it's possible to write a testcase for the bug with a non-checking STL implementation). llvm-svn: 203042
* Introduce '-fmodules-user-build-path' which accepts the "canonical" path to ↵Argyrios Kyrtzidis2014-03-031-0/+1
| | | | | | | | | | a user workspace build. This is used to avoid conflicts with user modules with the same name from different workspaces. rdar://16042513 llvm-svn: 202683
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-1/+1
| | | | llvm-svn: 202639
* If a module A exports a macro M, and a module B imports that macro and #undef'sRichard Smith2014-03-011-83/+250
| | | | | | | | | | | | | | it, importers of B should not see the macro. This is complicated by the fact that A's macro could also be visible through a different path. The rules (as hashed out on cfe-commits) are included as a documentation update in this change. With this, the number of regressions in libc++'s testsuite when modules are enabled drops from 47 to 7. Those remaining 7 are also macro-related, and are due to remaining bugs in this change (in particular, the handling of submodules is imperfect). llvm-svn: 202560
* Update for llvm api change.Rafael Espindola2014-02-241-1/+1
| | | | llvm-svn: 202053
* Don't assume that F_None is the default. It is about to change.Rafael Espindola2014-02-241-1/+2
| | | | llvm-svn: 202040
* Add an option to allow Clang verify source files for a module only once duringDmitri Gribenko2014-02-121-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the build When Clang loads the module, it verifies the user source files that the module was built from. If any file was changed, the module is rebuilt. There are two problems with this: 1. correctness: we don't verify system files (there are too many of them, and stat'ing all of them would take a lot of time); 2. performance: the same module file is verified again and again during a single build. This change allows the build system to optimize source file verification. The idea is based on the fact that while the project is being built, the source files don't change. This allows us to verify the module only once during a single build session. The build system passes a flag, -fbuild-session-timestamp=, to inform Clang of the time when the build started. The build system also requests to enable this feature by passing -fmodules-validate-once-per-build-session. If these flags are not passed, the behavior is not changed. When Clang verifies the module the first time, it writes out a timestamp file. Then, when Clang loads the module the second time, it finds a timestamp file, so it can compare the verification timestamp of the module with the time when the build started. If the verification timestamp is too old, the module is verified again, and the timestamp file is updated. llvm-svn: 201224
* Rename some PCH-related errors to have 'err_' as their prefixDmitri Gribenko2014-02-111-4/+4
| | | | llvm-svn: 201157
* Stat system dependencies when using -verify-pchBen Langmuir2014-02-071-2/+8
| | | | | | | | We don't stat the system headers to check for stalenes during regular PCH loading for performance reasons. When explicitly saying -verify-pch, we want to check all the dependencies - user or system. llvm-svn: 200979
* Add a CC1 option -verify-pchBen Langmuir2014-02-051-7/+10
| | | | | | | | | This option will: - load the given pch file - verify it is not out of date by stat'ing dependencies, and - return 0 on success and non-zero on error llvm-svn: 200884
* Fix autolinking when modules are imported in pch filesBen Langmuir2014-01-311-5/+5
| | | | | | | | | | | | Add the ImportDecl to the set of interesting delcarations that are deserialized eagerly when an AST file is loaded (rather than lazily like most decls). This is required to get auto linking to work when there is no explicit import in the main file. Also resolve a FIXME to rename 'ExternalDefinitions', since that is only one of the things that need eager deserialization. The new name is 'EagerlyDeserializedDecls'. The corresponding AST bitcode is also renamed. llvm-svn: 200505
* Update FunctionTypeLoc and related names to match r199686Alp Toker2014-01-211-2/+2
| | | | llvm-svn: 199699
* Improve the error message when a PCH dependency is modifiedBen Langmuir2014-01-171-4/+19
| | | | | | | | | | Show the top-level pch file as the culprit, rather than the immediate dependency when a pch file imports a pcm from a module. To clarify the relationship, the pch import stack is printed as notes. The old behaviour was misleading when a pch imported a pcm (from a module), since removing the pcm would not fix the problem, whereas rebuilding the pch would. llvm-svn: 199446
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-2/+0
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* [Serialization] In ASTReader::getInputFile record it when we didn't find the ↵Argyrios Kyrtzidis2014-01-081-0/+5
| | | | | | | | file to avoid looking it up again. Hopefully addresses rdar://14514222. llvm-svn: 198781
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-051-0/+13
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 llvm-svn: 196451
* Include non-explicit submodules in exported module listDmitri Gribenko2013-11-041-10/+1
| | | | | | | | | | | | | | | | This change fixes Richard's testcase for r193815. Now we include non-explicit submodules into the list of exports. The test failed previously because: - recursive_visibility_a1.inner is not imported (only recursive_visibility_a1 is), - thus the 'inner' submodule is not showing up in any of the import lists, - and because of this getExportedModules() is not returning the correct module set -- it only considers modules that are imported. The fix is to make Module::getExportedModules() include non-explicit submodules into the list of exports. llvm-svn: 194018
* Allow a new syntax in a module requires-declaration:Richard Smith2013-10-281-1/+1
| | | | | | | | | | | | requires ! feature The purpose of this is to allow (for instance) the module map for /usr/include to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are instead provided by the C++ standard library in this case, and the glibc C <tgmath.h> header would otherwise try to include <complex.h>, resulting in a module cycle). llvm-svn: 193549
* Simplify some implementations of get*Decl.Rafael Espindola2013-10-191-1/+1
| | | | | | | | | | * NamedDecl and CXXMethodDecl were missing getMostRecentDecl. * The const version can just forward to the non const. * getMostRecentDecl can use cast instead of cast_or_null. This then removes some casts from the callers. llvm-svn: 193039
* C++ modules: don't lose track of a 'namespace std' that is imported from a ↵Richard Smith2013-10-181-13/+28
| | | | | | module. llvm-svn: 192951
* Basic ODR checking for C++ modules:Richard Smith2013-10-181-1/+60
| | | | | | | | | | | | | | | If we have multiple definitions of the same entity from different modules, we nominate the first definition which we see as being the canonical definition. If we load a declaration from a different definition and we can't find a corresponding declaration in the canonical definition, issue a diagnostic. This is insufficient to prevent things from going horribly wrong in all cases -- we might be in the middle of emitting IR for a function when we trigger some deserialization and discover that it refers to an incoherent piece of the AST, by which point it's probably too late to bail out -- but we'll at least produce a diagnostic. llvm-svn: 192950
OpenPOWER on IntegriCloud