]> granicus.if.org Git - clang/commitdiff
Revert "[Modules] Prevent #import to reenter header if not building a module."
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sat, 12 Aug 2017 01:38:26 +0000 (01:38 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Sat, 12 Aug 2017 01:38:26 +0000 (01:38 +0000)
This reverts commit r310605. Richard pointed out a better way to achieve
this, which I'll post a patch for soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310775 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/HeaderSearch.cpp
test/Modules/Inputs/import-textual/x.h [deleted file]
test/Modules/import-textual-nomodules.m [deleted file]

index 4b5df8c1cc67f595bf7d5050f61f8451a5f1ae43..1ebcc0a1c657c835e702ad67657f075ba121719f 100644 (file)
@@ -1143,7 +1143,7 @@ bool HeaderSearch::ShouldEnterIncludeFile(Preprocessor &PP,
     // headers find in the wild might rely only on #import and do not contain
     // controlling macros, be conservative and only try to enter textual headers
     // if such macro is present.
-    if (FileInfo.isCompilingModuleHeader && !FileInfo.isModuleHeader &&
+    if (!FileInfo.isModuleHeader &&
         FileInfo.getControllingMacro(ExternalLookup))
       TryEnterHdr = true;
     return TryEnterHdr;
diff --git a/test/Modules/Inputs/import-textual/x.h b/test/Modules/Inputs/import-textual/x.h
deleted file mode 100644 (file)
index 9b41ccd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef RANDOM_DEP
-
-@interface X
-@end
-
-#endif // RANDOM_DEP
diff --git a/test/Modules/import-textual-nomodules.m b/test/Modules/import-textual-nomodules.m
deleted file mode 100644 (file)
index 7cf8c1e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// RUN: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -I%S/Inputs/import-textual -fmodules-cache-path=%t %s -verify
-
-// expected-no-diagnostics
-
-#import "x.h"
-#import "x.h"
-