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.

llvm-svn: 310775
This commit is contained in:
Bruno Cardoso Lopes 2017-08-12 01:38:26 +00:00
parent 3e78c4bddc
commit 4164dd9167
3 changed files with 1 additions and 15 deletions

View 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;

View File

@ -1,6 +0,0 @@
#ifndef RANDOM_DEP
@interface X
@end
#endif // RANDOM_DEP

View File

@ -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"