summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-01-13 17:47:44 +0000
committerBen Langmuir <blangmuir@apple.com>2015-01-13 17:47:44 +0000
commitd775eff4c77cac03406fc6146a162f1f1b076db4 (patch)
treeff482d4fb6e65782b35f81a4dcef27e6d9eab5ab /include
parent9ba68b2714e8ab9a6f3ed755096c95d5918e895d (diff)
Inherit attributes when infering a framework module
If a module map contains framework module * [extern_c] {} We will now infer [extern_c] on the inferred framework modules (we already inferred [system] as a special case). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Lex/ModuleMap.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index a628e0f869..ed885a7410 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -127,15 +127,29 @@ private:
/// header.
llvm::DenseMap<const DirectoryEntry *, Module *> UmbrellaDirs;
+ /// \brief The set of attributes that can be attached to a module.
+ struct Attributes {
+ Attributes() : IsSystem(), IsExternC(), IsExhaustive() {}
+
+ /// \brief Whether this is a system module.
+ unsigned IsSystem : 1;
+
+ /// \brief Whether this is an extern "C" module.
+ unsigned IsExternC : 1;
+
+ /// \brief Whether this is an exhaustive set of configuration macros.
+ unsigned IsExhaustive : 1;
+ };
+
/// \brief A directory for which framework modules can be inferred.
struct InferredDirectory {
- InferredDirectory() : InferModules(), InferSystemModules() { }
+ InferredDirectory() : InferModules() {}
/// \brief Whether to infer modules from this directory.
unsigned InferModules : 1;
- /// \brief Whether the modules we infer are [system] modules.
- unsigned InferSystemModules : 1;
+ /// \brief The attributes to use for inferred modules.
+ Attributes Attrs;
/// \brief If \c InferModules is non-zero, the module map file that allowed
/// inferred modules. Otherwise, nullptr.
@@ -214,6 +228,10 @@ private:
return static_cast<bool>(findHeaderInUmbrellaDirs(File, IntermediateDirs));
}
+ Module *inferFrameworkModule(StringRef ModuleName,
+ const DirectoryEntry *FrameworkDir,
+ Attributes Attrs, Module *Parent);
+
public:
/// \brief Construct a new module map.
///