summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/normal-module-map.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [modules] Simplify -cc1 interface for enabling implicit module maps.Richard Smith2015-06-161-1/+1
| | | | | | | | | | | | | 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
* During typo correction, check for an exact match in an unimported module. If weRichard Smith2013-08-201-2/+2
| | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-111-6/+6
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* Sanitize the names of modules determined based on the names of headersDouglas Gregor2012-10-121-0/+10
| | | | | | | or directories, to make sure that they are identifiers that are not keywords in any dialect. Fixes <rdar://problem/12489495>. llvm-svn: 165821
* Change @import to @__experimental_modules_import. We are not ready to ↵Ted Kremenek2012-03-011-3/+3
| | | | | | | | commit to a particular syntax for modules, and don't have time to push it forward in the near future. llvm-svn: 151841
* Eliminate the uglified keyword __import_module__ for importingDouglas Gregor2012-01-031-3/+3
| | | | | | | | | | | | | modules. This leaves us without an explicit syntax for importing modules in C/C++, because such a syntax needs to be discussed first. In Objective-C/Objective-C++, the @import syntax is used to import modules. Note that, under -fmodules, C/C++ programs can import modules via the #include mechanism when a module map is in place for that header. This allows us to work with modules in C/C++ without committing to a syntax. llvm-svn: 147467
* 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
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Implement umbrella directories for modules, which are similar toDouglas Gregor2011-12-081-0/+18
| | | | | | | | | | | | | | | umbrella headers in the sense that all of the headers within that directory (and eventually its subdirectories) are considered to be part of the module with that umbrella directory. However, unlike umbrella headers, which are expected to include all of the headers within their subdirectories, Clang will automatically include all of the headers it finds in the named subdirectory. The intent here is to allow a module map to trivially turn a subdirectory into a module, where the module's structure can mimic the directory structure. llvm-svn: 146165
* Teach the module import mechanism how to rebuild modules expressed viaDouglas Gregor2011-11-291-4/+0
| | | | | | | module map, rather than assuming that there is an umbrella header. This allows us to automatically build umbrella-less modules. llvm-svn: 145415
* A module with an umbrella header assumes that all of the headers inDouglas Gregor2011-11-161-2/+2
| | | | | | | | the umbrella header's directory and its subdirectories are part of the module (that's why it's an umbrella). Make sure that these headers are considered to be part of the module for lookup purposes. llvm-svn: 144859
* Implement (de-)serialization of the buffer contents for an overriddenDouglas Gregor2011-11-161-3/+5
| | | | | | | | | | file in the source manager. This allows us to properly create and use modules described by module map files without umbrella headers (or with incompletely umbrella headers). More generally, we can actually build a PCH file that makes use of file -> buffer remappings, which could be useful in libclang in the future. llvm-svn: 144830
* When building a module from a module map that isn't simply an umbrellaDouglas Gregor2011-11-161-1/+0
| | | | | | | | header, create our own in-memory buffer to parse all of the appropriate headers, and use that to build the module. This isn't end-to-end testable yet; that's coming next. llvm-svn: 144797
* Add support for building a module from a module map to the -cc1Douglas Gregor2011-11-161-2/+2
| | | | | | | interface. This is currently limited to modules with umbrella headers. llvm-svn: 144736
* When searching for a module, speculatively load module maps to see ifDouglas Gregor2011-11-121-0/+2
| | | | | | | | the module is described in one of the module maps in a search path or in a subdirectory off the search path that has the same name as the module we're looking for. llvm-svn: 144433
* Teach the search for modules to consider modules described by a moduleDouglas Gregor2011-11-111-0/+6
| | | | | | | | | | | | | | map, so long as they have an umbrella header. This makes it possible to introduce a module map + umbrella header for a given set of headers, to turn it into a module. There are two major deficiencies here: first, we don't go hunting for module map files when we just see a module import (so we won't know about the modules described therein). Second, we don't yet have a way to build modules that don't have umbrella headers, or have incomplete umbrella headers. llvm-svn: 144424
* Wire up the mapping from header files mentioned in module maps over toDouglas Gregor2011-11-111-2/+4
| | | | | | | the corresponding (top-level) modules. This isn't actually useful yet, because we don't yet have a way to build modules out of module maps. llvm-svn: 144410
* Introduce basic support for parsing module map files.Douglas Gregor2011-11-111-0/+10
Module map files provide a way to map between headers and modules, so that we can layer a module system on top of existing headers without changing those headers at all. This commit introduces the module map file parser and the module map that it generates, and wires up the module map file parser so that we'll automatically find module map files as part of header search. Note that we don't yet use the information stored in the module map. llvm-svn: 144402
OpenPOWER on IntegriCloud