<rdar://problem/10796651> Introduce configuration macros into module maps.
authorDouglas Gregor <dgregor@apple.com>
Wed, 20 Mar 2013 00:22:05 +0000 (00:22 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 20 Mar 2013 00:22:05 +0000 (00:22 +0000)
commit35b13ece231bbd70cd5cfe7a3a1b931d74cef797
tree93c842d670d3af218e85017d2b707a0aa2e39b04
parentd068943809f09a96e6bb2885e40c5651c8b3447c
<rdar://problem/10796651> Introduce configuration macros into module maps.

Configuration macros are macros that are intended to alter how a
module works, such that we need to build different module variants
for different values of these macros. A module can declare its
configuration macros, in which case we will complain if the definition
of a configation macro on the command line (or lack thereof) differs
from the current preprocessor state at the point where the module is
imported. This should eliminate some surprises when enabling modules,
because "#define CONFIG_MACRO ..." followed by "#include
<module/header.h>" would silently ignore the CONFIG_MACRO setting. At
least it will no longer be silent about it.

Configuration macros are eventually intended to help reduce the number
of module variants that need to be built. When the list of
configuration macros for a module is exhaustive, we only need to
consider the settings for those macros when building/finding the
module, which can help isolate modules for various project-specific -D
flags that should never affect how modules are build (but currently do).

llvm-svn: 177466
13 files changed:
clang/include/clang/Basic/DiagnosticFrontendKinds.td
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticLexKinds.td
clang/include/clang/Basic/Module.h
clang/include/clang/Serialization/ASTBitCodes.h
clang/lib/Basic/Module.cpp
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Lex/ModuleMap.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/Inputs/config.h [new file with mode: 0644]
clang/test/Modules/Inputs/module.map
clang/test/Modules/config_macros.m [new file with mode: 0644]