summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/auto-module-import.m
Commit message (Collapse)AuthorAgeFilesLines
* [modules] When a #include is mapped to a module import and appears somewhereRichard Smith2015-11-171-1/+13
| | | | | | | | | | | | | | other than the top level, we issue an error. This breaks a fair amount of C++ code wrapping C libraries, where the C library is #included within a namespace / extern "C" combination, because the C library (probably) includes C++ standard library headers which may be within modules. Without modules, this setup is harmless if (and *only* if) the corresponding standard library module was already included outside the namespace, so downgrade the error to a default-error extension in that case, so that it can be selectively disabled for such misbehaving libraries. llvm-svn: 253398
* [Modules] More descriptive diagnostics for misplaced import directiveSerge Pavlov2015-09-191-3/+4
| | | | | | | | | | If an import directive was put into wrong context, the error message was obscure, complaining on misbalanced braces. To get more descriptive messages, annotation tokens related to modules are processed where they must not be seen. Differential Revision: http://reviews.llvm.org/D11844 llvm-svn: 248085
* [modules] Simplify -cc1 interface for enabling implicit module maps.Richard Smith2015-06-161-2/+2
| | | | | | | | | | | | | We used to have a flag to enable module maps, and two more flags to enable implicit module maps. This is all redundant; we don't need any flag for enabling module maps in the abstract, and we don't usually have -fno- flags for -cc1. We now have just a single flag, -fimplicit-module-maps, that enables implicitly searching the file system for module map files and loading them. The driver interface is unchanged for now. We should probably rename -fmodule-maps to -fimplicit-module-maps at some point. llvm-svn: 239789
* Generate a marker token when entering or leaving a submodule when building aRichard Smith2013-11-231-3/+3
| | | | | | | | | module. Use the marker to diagnose cases where we try to transition between submodules when not at the top level (most likely because a closing brace was missing at the end of a header file, but is also possible if submodule headers attempt to do something fundamentally non-modular, like our .def files). llvm-svn: 195543
* When we hit a #include directive that maps to a module import, emit a tokenRichard Smith2013-11-151-0/+4
| | | | | | | | | | | | representing the module import rather than making the module immediately visible. This serves two goals: * It avoids making declarations in the module visible prematurely, if we walk past the #include during a tentative parse, for instance, and * It gives a diagnostic (although, admittedly, not a very nice one) if a header with a corresponding module is included anywhere other than at the top level. llvm-svn: 194782
* During typo correction, check for an exact match in an unimported module. If weRichard Smith2013-08-201-6/+17
| | | | | | find one, then report the error as a missing import instead of as a typo. llvm-svn: 188821
* Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.Andy Gibbs2013-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VerifyDiagnosticConsumer previously would not check that the diagnostic and its matching directive referenced the same source file. Common practice was to create directives that referenced other files but only by line number, and this led to problems such as when the file containing the directive didn't have enough lines to match the location of the diagnostic in the other file, leading to bizarre file formatting and other oddities. This patch causes VerifyDiagnosticConsumer to match source files as well as line numbers. Therefore, a new syntax is made available for directives, for example: // expected-error@file:line {{diagnostic message}} This extends the @line feature where "file" is the file where the diagnostic is generated. The @line syntax is still available and uses the current file for the diagnostic. "file" can be specified either as a relative or absolute path - although the latter has less usefulness, I think! The #include search paths will be used to locate the file and if it is not found an error will be generated. The new check is not optional: if the directive is in a different file to the diagnostic, the file must be specified. Therefore, a number of test-cases have been updated with regard to this. This closes out PR15613. llvm-svn: 179677
* Rename -fmodule-cache-path <blah> to -fmodules-cache-path=<blah> for ↵Douglas Gregor2013-02-071-1/+1
| | | | | | consistency. llvm-svn: 174645
* Don't infer a submodule for a framework's private header, at least for now.Douglas Gregor2012-01-131-1/+1
| | | | llvm-svn: 148117
* Rename the command-line option for mapping #include/#import over toDouglas Gregor2012-01-031-1/+1
| | | | | | | | module imports from -fauto-module-import to -fmodules. The new name will eventually be used to enable modules, and the #include/#import mapping is a crucial part of the feature. llvm-svn: 147447
* Detect when mapping a #include/#import over to a submodule ends upDouglas Gregor2011-12-201-0/+9
| | | | | | | | | | | | | hitting a submodule that was never actually created, e.g., because that header wasn't parsed. In such cases, complain (because the module's umbrella headers don't cover everything) and fall back to including the header. Later, we'll add a warning at module-build time to catch all such cases. However, this fallback is important to eliminate assertions in the ASTWriter when this happens. llvm-svn: 146933
* When we have an umbrella directory in a module map, recursively walkDouglas Gregor2011-12-121-0/+4
| | | | | | the subdirectories to find headers in submodules. llvm-svn: 146398
* Implement the notion of umbrella directories, which implicity coverDouglas Gregor2011-12-091-0/+10
| | | | | | | | | | | | | all of the headers below that particular directory. Use umbrella directories as a clean way to deal with (1) directories/frameworks that don't have an umbrella header, but don't want to enumerate all of their headers, and (2) PrivateHeaders, which we never want to enumerate and want to keep separate from the main umbrella header. This also eliminates a little more of the "magic" for private headers, and frameworks in general. llvm-svn: 146235
* Implement inference for the "Private" submodule corresponding toDouglas Gregor2011-12-071-0/+4
| | | | | | private headers in a framework. llvm-svn: 146082
* Make sure we pick up module_private.map when loading a module.map file.Douglas Gregor2011-12-071-0/+2
| | | | llvm-svn: 146074
* Implement basic support for private headers in frameworks. In essence,Douglas Gregor2011-12-071-0/+3
| | | | | | | | | when we load a module map (module.map) from a directory, also load a private module map (module_private.map) for that directory, if present. That private module map can inject a new submodule that captures private headers. llvm-svn: 146012
* Rename Objective-C-only tests to .mDouglas Gregor2011-12-061-0/+41
llvm-svn: 145959
OpenPOWER on IntegriCloud