]> granicus.if.org Git - clang/commit
Allow string literals as module names.
authorDaniel Jasper <djasper@google.com>
Fri, 6 Dec 2013 09:25:54 +0000 (09:25 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 6 Dec 2013 09:25:54 +0000 (09:25 +0000)
commit69e46036a391a12d2eb3149569c335ce3634bf31
tree784b47391470aa0167449186490ec33b12c6277d
parent5fe64f157d3e0ff27e538b4a8f037a97387e4de1
Allow string literals as module names.

In order to make the migration to modules easier, it seems to be helpful
to allow a 1:1 mapping between target names of a current build system
and the corresponding C++ modules. As  such targets commonly contain
characters like "-". ":" and "/", allowing arbitrary quote-escaped
strings seems to be a straightforward option.

After several offline discussions, the precise mechanisms for C++
module names especially regarding submodules and import statements has
yet to be determined. Thus, this patch only enables string literals as
names inside the module map files which can be used by automatic module
import (through #include).

Also improve the error message on missing use-declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196573 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Basic/DiagnosticLexKinds.td
lib/Lex/ModuleMap.cpp
lib/Lex/PPDirectives.cpp
test/Modules/Inputs/declare-use/h.h
test/Modules/Inputs/string_names/a.h [new file with mode: 0644]
test/Modules/Inputs/string_names/b.h [new file with mode: 0644]
test/Modules/Inputs/string_names/c.h [new file with mode: 0644]
test/Modules/Inputs/string_names/module.map [new file with mode: 0644]
test/Modules/Inputs/string_names/sub.h [new file with mode: 0644]
test/Modules/declare-use1.cpp
test/Modules/declare-use2.cpp
test/Modules/string_names.cpp [new file with mode: 0644]