r310775 - Revert "[Modules] Prevent #import to reenter header if not building a module."

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 11 18:38:26 PDT 2017


Author: bruno
Date: Fri Aug 11 18:38:26 2017
New Revision: 310775

URL: http://llvm.org/viewvc/llvm-project?rev=310775&view=rev
Log:
Revert "[Modules] Prevent #import to reenter header if not building a module."

This reverts commit r310605. Richard pointed out a better way to achieve
this, which I'll post a patch for soon.

Removed:
    cfe/trunk/test/Modules/Inputs/import-textual/x.h
    cfe/trunk/test/Modules/import-textual-nomodules.m
Modified:
    cfe/trunk/lib/Lex/HeaderSearch.cpp

Modified: cfe/trunk/lib/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderSearch.cpp?rev=310775&r1=310774&r2=310775&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp Fri Aug 11 18:38:26 2017
@@ -1143,7 +1143,7 @@ bool HeaderSearch::ShouldEnterIncludeFil
     // 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;

Removed: cfe/trunk/test/Modules/Inputs/import-textual/x.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/import-textual/x.h?rev=310774&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/import-textual/x.h (original)
+++ cfe/trunk/test/Modules/Inputs/import-textual/x.h (removed)
@@ -1,6 +0,0 @@
-#ifndef RANDOM_DEP
-
- at interface X
- at end
-
-#endif // RANDOM_DEP

Removed: cfe/trunk/test/Modules/import-textual-nomodules.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/import-textual-nomodules.m?rev=310774&view=auto
==============================================================================
--- cfe/trunk/test/Modules/import-textual-nomodules.m (original)
+++ cfe/trunk/test/Modules/import-textual-nomodules.m (removed)
@@ -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"
-




More information about the cfe-commits mailing list