summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* [CrashReproducer] Setup a module collector callback for HeaderIncludeBruno Cardoso Lopes2016-12-111-0/+7
| | | | | | | | | Collect missing include that cannot be fetched otherwise (e.g. when using headermaps). rdar://problem/27913709 llvm-svn: 289361
* [CrashReproducer] Collect headermap filesBruno Cardoso Lopes2016-12-111-0/+48
| | | | | | | | | | Include headermaps (.hmap files) in the .cache directory and add VFS entries. All headermaps are known after HeaderSearch setup, collect them right after. rdar://problem/27913709 llvm-svn: 289360
* [CrashReproducer] Provide a clean dir path for -fmodules-cache-pathBruno Cardoso Lopes2016-12-097-9/+7
| | | | | | | | | | | | The most common workflow with module reproducers involves deleting the module cache before running the script. This happens because leftovers from the crash are present in the cache and could trigger unrelated and confusing errors, misleading from the initial reproduction intent. Change this to point to a clean path but leave the leftovers untouched. rdar://problem/28655070 llvm-svn: 289176
* [CrashReproducer] Rewrite relative include pathsBruno Cardoso Lopes2016-12-091-0/+58
| | | | | | | | | | | | | | | | | When -fmodules is on, the reproducer invocation currently leave paths for include-like flags as is. If the path is relative, the reproducer doesn't know how to access that file during reproduction time because the VFS cannot reason about relative paths. Expand relative paths to absolute ones when creating the reproducer command line. This allows, for example, the reproducer to work for crashes while building clang with modules; this wasn't possible before because building clang requires using relative inc dir from within the build directory. rdar://problem/28655070 llvm-svn: 289174
* Revert r288626, which reverts r288449. Original commit message:Richard Smith2016-12-061-0/+13
| | | | | | Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually. llvm-svn: 288741
* Additional test file missed from r288737.Richard Smith2016-12-061-0/+12
| | | | llvm-svn: 288738
* [modules] Use the "redundant #include" diagnostic rather than the "moduleRichard Smith2016-12-061-1/+4
| | | | | | | | import can't appear here" diagnostic if an already-visible module is textually entered (because we have the module map but not the AST file) within a function/namespace scope. llvm-svn: 288737
* Revert "Recover better from an incompatible .pcm file being provided by ↵Daniel Jasper2016-12-041-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually." This reverts commit r288449. I believe that this is currently faulty wrt. modules being imported inside namespaces. Adding these lines to the new test: namespace n { #include "foo.h" } Makes it break with fatal error: import of module 'M' appears within namespace 'n' However, I believe it should fail with error: redundant #include of module 'M' appears within namespace 'n' I have tracked this down to us now inserting a tok::annot_module_begin instead of a tok::annot_module_include in Preprocessor::HandleIncludeDirective() and then later in Parser::parseMisplacedModuleImport(), we hit the code path for tok::annot_module_begin, which doesn't set FromInclude of checkModuleImportContext to true (thus leading to the "wrong" diagnostic). llvm-svn: 288626
* Recover better from an incompatible .pcm file being provided by -fmodule-file=.Richard Smith2016-12-021-0/+10
| | | | | | | | | | | We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually. llvm-svn: 288449
* ObjC Module: try to make objc module deterministic.Manman Ren2016-11-171-0/+22
| | | | | | | Make sure that comparing selectors in DeclarationName does its job. rdar://problem/28988750 llvm-svn: 287244
* [modules] Mark deleted functions as implicitly inline to allow mergingEric Fiselier2016-10-311-0/+1
| | | | | | | | | | | | Summary: When merging definitions with ModulesLocalVisibility enabled it's important to make deleted definitions implicitly inline, otherwise they'll be diagnosed as a redefinition. Reviewers: silvas, manmanren, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26143 llvm-svn: 285655
* [Modules] Add a command line option for loading the clang builtins modulemap.Elad Cohen2016-10-312-0/+2
| | | | | | | | | -fbuiltin-module-map loads the clang builtins modulemap file. (This is equivalent to -fmodule-map-file=<resource dir>/include/module.modulemap) Differential Revision: https://reviews.llvm.org/D25767 llvm-svn: 285548
* [Modules] Make test from r285377 darwin specificBruno Cardoso Lopes2016-10-281-0/+2
| | | | | | | Appease buildbots: http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55876 llvm-svn: 285378
* [Modules] Add testcase for builtins used in umbrella headersBruno Cardoso Lopes2016-10-286-0/+46
| | | | | | | | | | | | | | This used to work before r284797 + r285152, which exposed something interesting; some users include builtins from umbrella headers. Clang should emit a warning to warn users this is not a good practice and umbrella headers shouldn't get the implicitly-add-the-builtin-version behavior for builtin header names. While we're not there, add the testcase to represent the way it currently works. llvm-svn: 285377
* [modules] PR28812: Modules can return duplicate field decls.Vassil Vassilev2016-10-265-0/+41
| | | | | | | | | | | | | If two modules contain duplicate class definitions the lookup result can contain more than 2 elements. Sift the lookup results until we find a field decl. It is not necessary to do ODR checks in place as they done elsewhere. This should fix issues when compiling with libstdc++ 5.2 and 6.2. Patch developed in collaboration with Richard Smith! llvm-svn: 285184
* [modules] Fix assert if multiple update records provide a definition for aRichard Smith2016-10-264-1/+15
| | | | | | class template specialization and that specialization has attributes. llvm-svn: 285160
* Treat module headers wrapped by our builtin headers as implicitly being textualRichard Smith2016-10-263-3/+2
| | | | | | | | | | headers. We previously got this check backwards and treated the wrapper header as being textual. This is important because our wrapper headers sometimes inject macros into the system headers that they #include_next, and sometimes replace them entirely. llvm-svn: 285152
* Module: correctly set the module file kind when emitting file_modified.Manman Ren2016-10-211-0/+11
| | | | | | | | rdar://28503343 Differential Revision: http://reviews.llvm.org/D25806 llvm-svn: 284899
* Module: improve the diagnostic message for include of non-modular header.Manman Ren2016-10-211-1/+1
| | | | | | | | Emit the actual path to the non-modular include. rdar://28897010 llvm-svn: 284897
* Remove non-existing file from modulemap.Benjamin Kramer2016-10-211-1/+0
| | | | | | This picked up a builtin header if it happened to be available. llvm-svn: 284815
* [Modules] Add 'no_undeclared_includes' module map attributeBruno Cardoso Lopes2016-10-2121-1/+107
| | | | | | | | | | | | | The 'no_undeclared_includes' attribute should be used in a module to tell that only non-modular headers and headers from used modules are accepted. The main motivation behind this is to prevent dep cycles between system libraries (such as darwin) and libc++. Patch by Richard Smith! llvm-svn: 284797
* Remove 24 instances of 'REQUIRES: shell'Reid Kleckner2016-10-207-17/+5
| | | | | | | | | | | | | | | | | Tests fall into one of the following categories: - The requirement was unnecessary - Additional quoting was required for backslashes in paths (see "sed -e 's/\\/\\\\/g'") in the sanitizer tests. - OpenMP used 'REQUIRES: shell' as a proxy for the test failing on Windows. Those tests fail there reliably, so use XFAIL instead. I tried not to remove shell requirements that were added to suppress flaky test failures, but if I screwed up, we can add it back as needed. llvm-svn: 284793
* [modules] Do not report missing definitions of demoted constexpr variable ↵Vassil Vassilev2016-10-195-0/+38
| | | | | | | | | | | | | | templates. This is a followup to regression introduced in r284284. This should fix our libstdc++ modules builds. https://reviews.llvm.org/D25678 Reviewed by Richard Smith! llvm-svn: 284577
* Revert "Reinstate r281429, reverted in r281452, with a fix for its ↵Benjamin Kramer2016-10-1710-53/+1
| | | | | | | | | mishandling of" This reverts commit r284176. It still marks some modules as invisible that should be visible. Will follow up with the author with a test case. llvm-svn: 284382
* Reinstate r284008 reverted in r284081, with two fixes:Richard Smith2016-10-147-0/+63
| | | | | | | | | | | | | | | | | | | 1) Merge and demote variable definitions when we find a redefinition in MergeVarDecls, not only when we find one in AddInitializerToDecl (we only reach the second case if it's the addition of the initializer itself that converts an existing declaration into a definition). 2) When rebuilding a redeclaration chain for a variable, if we merge two definitions together, mark the definitions as merged so the retained definition is made visible whenever the demoted definition would have been. Original commit message (from r283882): [modules] PR28752: Do not instantiate variable declarations which are not visible. Original patch by Vassil Vassilev! Changes listed above are mine. llvm-svn: 284284
* Module: emit initializers in submodules when importing the parent module.Manman Ren2016-10-142-1/+10
| | | | | | | | | When importing the parent module, module initializers in submodules should be emitted. rdar://28740482 llvm-svn: 284263
* Reinstate r281429, reverted in r281452, with a fix for its mishandling ofRichard Smith2016-10-1310-1/+53
| | | | | | | | | compiles without -fmodules-local-submodule-visibility. Original commit message: [modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition. llvm-svn: 284176
* Module: emit initializers for C/ObjC after r276159.Manman Ren2016-10-133-0/+16
| | | | | | | | | In r276159, we started to defer emitting initializers for VarDecls, but forgot to add the initializers for non-C++ language. rdar://28740482 llvm-svn: 284142
* Revert r284008. This is us to fail to instantiate static data members in someRichard Smith2016-10-127-55/+0
| | | | | | cases. I'm working on reducing a testcase. llvm-svn: 284081
* Reinstate r283887 and r283882.Vassil Vassilev2016-10-127-0/+55
| | | | | | | | | | | Original message: "[modules] PR28752: Do not instantiate variable declarations which are not visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith!" llvm-svn: 284008
* Module: for ObjectiveC, be consistent when checking hidden decls.Manman Ren2016-10-115-0/+32
| | | | | | | | | In MatchAllMethodDeclarations, when checking a hidden decl, be sure to allow hidden when searching for methods. rdar://28699972 llvm-svn: 283943
* Revert r283887 and r283882, until the issue is understood and fixed.Vassil Vassilev2016-10-117-55/+0
| | | | llvm-svn: 283890
* [modules] PR28752: Do not instantiate variable declarations which are not ↵Vassil Vassilev2016-10-117-0/+55
| | | | | | | | | | visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith! llvm-svn: 283882
* [modules] Be sure to emit local specializations of imported templates, even ifRichard Smith2016-10-066-4/+18
| | | | | | | | | | | the resulting specialization is not referenced by the rest of the AST. This both avoids performing unnecessary reinstantiations in downstream users of the AST file and fixes a bug (breaking modules self-host right now) where we would sometimes fail to emit a definition of a class template specialization if we imported just a declaration of it from elsewhere (see new testcase for reduced example). llvm-svn: 283489
* ObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.Manman Ren2016-10-032-0/+12
| | | | | | | | | | | | | | | The deserialization of redeclartion can cause seg fault since getCanonicalDecl of the redeclaration returns the lookup result on the ObjCContainerDecl, which can be null if FindExternalVisibleDeclsByName is not done updating the lookup results. The fix is to return the redeclaration itself as the canonical decl. Note that the handling for redeclaration of ObjCMethodDecl is not in line with other redeclarables. rdar://28488466 llvm-svn: 283145
* Revert "[modules] When merging one definition into another, propagate the ↵Eric Liu2016-09-144-11/+0
| | | | | | | | list of re-exporting modules from the discarded definition to the retained definition." This reverts commit r281429. llvm-svn: 281452
* [modules] When merging one definition into another, propagate the list ofRichard Smith2016-09-144-0/+11
| | | | | | re-exporting modules from the discarded definition to the retained definition. llvm-svn: 281429
* Fix interaction between serialization and c++1z feature.Richard Trieu2016-09-133-0/+12
| | | | | | | | In c++1z, static_assert is not required to have a StringLiteral message, where previously it was required. Update the AST Reader to be able to handle a null StringLiteral. llvm-svn: 281286
* Update Clang for D20147 ("DebugInfo: New metadata representation for global ↵Peter Collingbourne2016-09-132-20/+19
| | | | | | | | variables.") Differential Revision: http://reviews.llvm.org/D20415 llvm-svn: 281285
* Add a couple of test files missed in r281258.Richard Smith2016-09-122-0/+10
| | | | llvm-svn: 281259
* [modules] When we merge two definitions of a function, mark the retainedRichard Smith2016-09-123-0/+27
| | | | | | | definition as visible in the discarded definition's module, as we do for other kinds of definition. llvm-svn: 281258
* Modules: for ObjectiveC try to keep the definition invariant.Manman Ren2016-09-0921-0/+98
| | | | | | | | | | | | When deserializing ObjCInterfaceDecl with definition data, if we already have a definition, try to keep the definition invariant; also pull in the categories even if it is not what getDefinition returns (this effectively combines categories). rdar://27926200 rdar://26708823 llvm-svn: 281119
* Modules: revert r280728.Manman Ren2016-09-095-22/+0
| | | | | | | In post-commit review, Richard suggested a better way to fix this. rdar://27926200 llvm-svn: 281078
* [modules] Apply ODR merging for function scoped tags only in C++ mode.Vassil Vassilev2016-09-085-0/+20
| | | | | | | | | | | In C mode, if we have a visible declaration but not a visible definition, a tag defined in the declaration should be have a visible definition. In C++ we rely on the ODR merging, whereas in C we cannot because each declaration of a function gets its own set of declarations in its prototype scope. Patch developed in collaboration with Richard Smith! llvm-svn: 280984
* Modules: Fix an assertion in DeclContext::buildLookup.Manman Ren2016-09-065-0/+22
| | | | | | | | | | When calling getMostRecentDecl, we can pull in more definitions from a module. We call getPrimaryContext afterwards to make sure that we buildLookup on a primary context. rdar://27926200 llvm-svn: 280728
* clang/test/Modules/compiler_builtins_x86.c: Fix r280658.NAKAMURA Takumi2016-09-051-1/+1
| | | | llvm-svn: 280659
* Attempt to fix buildbots not targetting x86James Molloy2016-09-051-1/+1
| | | | | | r280613 introduced failures for all builds that don't target x86 by default. Add an explicit target to avoid a missing feature diagnostic. llvm-svn: 280658
* [Modules] Add 'freestanding' to the 'requires-declaration' feature-list.Elad Cohen2016-09-041-0/+6
| | | | | | | | | This adds support for modules that require (non-)freestanding environment, such as the compiler builtin mm_malloc submodule. Differential Revision: https://reviews.llvm.org/D23871 llvm-svn: 280613
* When we reach the end of a #include of a header of a local submodule that weRichard Smith2016-09-011-0/+19
| | | | | | | | | | textually included, create an ImportDecl just as we would if we reached a #include of any other modular header. This is necessary in order to correctly determine the set of variables to initialize for an imported module. This should hopefully make the modules selfhost buildbot green again. llvm-svn: 280409
* [Modules] Add 'gnuinlineasm' to the 'requires-declaration' feature-list.Bruno Cardoso Lopes2016-08-304-0/+26
| | | | | | | | | | | | | This adds support for modules that require (no-)gnu-inline-asm environment, such as the compiler builtin cpuid submodule. This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871 Differential Revision: https://reviews.llvm.org/D23905 rdar://problem/26931199 llvm-svn: 280159
OpenPOWER on IntegriCloud