r232168 - When building a module, all headers of submodules can be used.
Daniel Jasper
djasper at google.com
Fri Mar 13 07:29:40 PDT 2015
Author: djasper
Date: Fri Mar 13 09:29:39 2015
New Revision: 232168
URL: http://llvm.org/viewvc/llvm-project?rev=232168&view=rev
Log:
When building a module, all headers of submodules can be used.
This extends r232159.
Added:
cfe/trunk/test/Modules/declare-use5.cpp
Modified:
cfe/trunk/lib/Lex/ModuleMap.cpp
Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=232168&r1=232167&r2=232168&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Fri Mar 13 09:29:39 2015
@@ -265,7 +265,8 @@ void ModuleMap::diagnoseHeaderInclusion(
if (Known != Headers.end()) {
for (const KnownHeader &Header : Known->second) {
// If 'File' is part of 'RequestingModule' we can definitely include it.
- if (Header.getModule() == RequestingModule)
+ if (Header.getModule() &&
+ Header.getModule()->isSubModuleOf(RequestingModule))
return;
// Remember private headers for later printing of a diagnostic.
Added: cfe/trunk/test/Modules/declare-use5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/declare-use5.cpp?rev=232168&view=auto
==============================================================================
--- cfe/trunk/test/Modules/declare-use5.cpp (added)
+++ cfe/trunk/test/Modules/declare-use5.cpp Fri Mar 13 09:29:39 2015
@@ -0,0 +1,9 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodule-maps -fmodules-cache-path=%t -fmodules-decluse -fmodule-name=XN -I %S/Inputs/declare-use %s -verify
+
+
+#include "sub.h"
+
+const int a = sub;
+
+// expected-no-diagnostics
More information about the cfe-commits
mailing list