Skip to content

Commit 6e03dd9

Browse files
committed
[modules] Simplify -cc1 interface for enabling implicit module maps.
We used to have a flag to enable module maps, and two more flags to enable implicit module maps. This is all redundant; we don't need any flag for enabling module maps in the abstract, and we don't usually have -fno- flags for -cc1. We now have just a single flag, -fimplicit-module-maps, that enables implicitly searching the file system for module map files and loading them. The driver interface is unchanged for now. We should probably rename -fmodule-maps to -fimplicit-module-maps at some point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239789 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e7fea73 commit 6e03dd9

File tree

179 files changed

+570
-572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+570
-572
lines changed

include/clang/Basic/LangOptions.def

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ COMPATIBLE_LANGOPT(ModulesDeclUse , 1, 0, "require declaration of module uses
128128
LANGOPT(ModulesSearchAll , 1, 1, "search even non-imported modules to find unresolved references")
129129
COMPATIBLE_LANGOPT(ModulesStrictDeclUse, 1, 0, "require declaration of module uses and all headers to be in modules")
130130
LANGOPT(ModulesErrorRecovery, 1, 1, "automatically import modules as needed when performing error recovery")
131-
BENIGN_LANGOPT(ModulesImplicitMaps, 1, 1, "use files called module.modulemap implicitly as module maps")
132131
BENIGN_LANGOPT(ImplicitModules, 1, 1, "build modules that are not specified via -fmodule-file")
133132
COMPATIBLE_LANGOPT(ModulesLocalVisibility, 1, 0, "local submodule visibility")
134133
COMPATIBLE_LANGOPT(Optimize , 1, 0, "__OPTIMIZE__ predefined macro")

include/clang/Driver/CC1Options.td

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
352352
HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
353353
" nodes having a certain substring in a qualified name. Use"
354354
" -ast-list to list all filterable declaration node names.">;
355-
def fmodules_implicit_maps : Flag <["-"], "fmodules-implicit-maps">;
356-
def fno_modules_implicit_maps : Flag <["-"], "fno-modules-implicit-maps">;
355+
def fimplicit_module_maps : Flag<["-"], "fimplicit-module-maps">,
356+
HelpText<"Implicitly search the file system for module map files.">;
357357
def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
358358
HelpText<"Do not automatically generate or update the global module index">;
359359
def fno_modules_error_recovery : Flag<["-"], "fno-modules-error-recovery">,

include/clang/Driver/Options.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ def fmodules : Flag <["-"], "fmodules">, Group<f_Group>,
692692
Flags<[DriverOption, CC1Option]>,
693693
HelpText<"Enable the 'modules' language feature">;
694694
def fmodule_maps : Flag <["-"], "fmodule-maps">, Group<f_Group>,
695-
Flags<[DriverOption,CC1Option]>,
695+
Flags<[DriverOption]>,
696696
HelpText<"Read module maps to understand the structure of library headers">;
697697
def fmodule_name : JoinedOrSeparate<["-"], "fmodule-name=">, Group<f_Group>,
698698
Flags<[DriverOption,CC1Option]>, MetaVarName<"<name>">,

include/clang/Lex/HeaderSearchOptions.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ class HeaderSearchOptions : public RefCountedBase<HeaderSearchOptions> {
9898
/// Note: Only used for testing!
9999
unsigned DisableModuleHash : 1;
100100

101-
/// \brief Interpret module maps. This option is implied by full modules.
102-
unsigned ModuleMaps : 1;
101+
/// \brief Implicit module maps. This option is enabld by default when
102+
/// modules is enabled.
103+
unsigned ImplicitModuleMaps : 1;
103104

104105
/// \brief Set the 'home directory' of a module map file to the current
105106
/// working directory (or the home directory of the module map file that
@@ -166,7 +167,7 @@ class HeaderSearchOptions : public RefCountedBase<HeaderSearchOptions> {
166167

167168
public:
168169
HeaderSearchOptions(StringRef _Sysroot = "/")
169-
: Sysroot(_Sysroot), DisableModuleHash(0), ModuleMaps(0),
170+
: Sysroot(_Sysroot), DisableModuleHash(0), ImplicitModuleMaps(0),
170171
ModuleMapFileHomeIsCwd(0),
171172
ModuleCachePruneInterval(7*24*60*60),
172173
ModuleCachePruneAfter(31*24*60*60),

lib/Driver/Tools.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -4135,9 +4135,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
41354135
CmdArgs.push_back("-fblocks-runtime-optional");
41364136
}
41374137

4138-
// -fmodules enables modules (off by default).
4138+
// -fmodules enables the use of precompiled modules (off by default).
41394139
// Users can pass -fno-cxx-modules to turn off modules support for
4140-
// C++/Objective-C++ programs, which is a little less mature.
4140+
// C++/Objective-C++ programs.
41414141
bool HaveModules = false;
41424142
if (Args.hasFlag(options::OPT_fmodules, options::OPT_fno_modules, false)) {
41434143
bool AllowedInCXX = Args.hasFlag(options::OPT_fcxx_modules,
@@ -4149,11 +4149,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
41494149
}
41504150
}
41514151

4152-
// -fmodule-maps enables module map processing (off by default) for header
4153-
// checking. It is implied by -fmodules.
4152+
// -fmodule-maps enables implicit reading of module map files. By default,
4153+
// this is enabled if we are using precompiled modules.
41544154
if (Args.hasFlag(options::OPT_fmodule_maps, options::OPT_fno_module_maps,
4155-
false)) {
4156-
CmdArgs.push_back("-fmodule-maps");
4155+
HaveModules)) {
4156+
CmdArgs.push_back("-fimplicit-module-maps");
41574157
}
41584158

41594159
// -fmodules-decluse checks that modules used are declared so (off by

lib/Frontend/CompilerInvocation.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
10951095
Opts.ModuleCachePath = Args.getLastArgValue(OPT_fmodules_cache_path);
10961096
Opts.ModuleUserBuildPath = Args.getLastArgValue(OPT_fmodules_user_build_path);
10971097
Opts.DisableModuleHash = Args.hasArg(OPT_fdisable_module_hash);
1098-
// -fmodules implies -fmodule-maps
1099-
Opts.ModuleMaps = Args.hasArg(OPT_fmodule_maps) || Args.hasArg(OPT_fmodules);
1098+
Opts.ImplicitModuleMaps = Args.hasArg(OPT_fimplicit_module_maps);
11001099
Opts.ModuleMapFileHomeIsCwd = Args.hasArg(OPT_fmodule_map_file_home_is_cwd);
11011100
Opts.ModuleCachePruneInterval =
11021101
getLastArgIntValue(Args, OPT_fmodules_prune_interval, 7 * 24 * 60 * 60);
@@ -1525,8 +1524,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
15251524
!Args.hasArg(OPT_fno_modules_search_all) &&
15261525
Args.hasArg(OPT_fmodules_search_all);
15271526
Opts.ModulesErrorRecovery = !Args.hasArg(OPT_fno_modules_error_recovery);
1528-
Opts.ModulesImplicitMaps = Args.hasFlag(OPT_fmodules_implicit_maps,
1529-
OPT_fno_modules_implicit_maps, true);
15301527
Opts.ImplicitModules = !Args.hasArg(OPT_fno_implicit_modules);
15311528
Opts.CharIsSigned = Opts.OpenCL || !Args.hasArg(OPT_fno_signed_char);
15321529
Opts.WChar = Opts.CPlusPlus && !Args.hasArg(OPT_fno_wchar);

lib/Lex/HeaderSearch.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ std::string HeaderSearch::getModuleFileName(StringRef ModuleName,
158158
Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch) {
159159
// Look in the module map to determine if there is a module by this name.
160160
Module *Module = ModMap.findModule(ModuleName);
161-
if (Module || !AllowSearch || !LangOpts.ModulesImplicitMaps)
161+
if (Module || !AllowSearch || !HSOpts->ImplicitModuleMaps)
162162
return Module;
163163

164164
// Look through the various header search paths to load any available module
@@ -1076,7 +1076,7 @@ StringRef HeaderSearch::getUniqueFrameworkName(StringRef Framework) {
10761076
bool HeaderSearch::hasModuleMap(StringRef FileName,
10771077
const DirectoryEntry *Root,
10781078
bool IsSystem) {
1079-
if (!HSOpts->ModuleMaps || !LangOpts.ModulesImplicitMaps)
1079+
if (!HSOpts->ImplicitModuleMaps)
10801080
return false;
10811081

10821082
SmallVector<const DirectoryEntry *, 2> FixUpDirectories;
@@ -1203,7 +1203,7 @@ HeaderSearch::loadModuleMapFileImpl(const FileEntry *File, bool IsSystem,
12031203

12041204
const FileEntry *
12051205
HeaderSearch::lookupModuleMapFile(const DirectoryEntry *Dir, bool IsFramework) {
1206-
if (!LangOpts.ModulesImplicitMaps)
1206+
if (!HSOpts->ImplicitModuleMaps)
12071207
return nullptr;
12081208
// For frameworks, the preferred spelling is Modules/module.modulemap, but
12091209
// module.map at the framework root is also accepted.
@@ -1241,7 +1241,7 @@ Module *HeaderSearch::loadFrameworkModule(StringRef Name,
12411241

12421242

12431243
// Try to infer a module map from the framework directory.
1244-
if (LangOpts.ModulesImplicitMaps)
1244+
if (HSOpts->ImplicitModuleMaps)
12451245
return ModMap.inferFrameworkModule(Name, Dir, IsSystem, /*Parent=*/nullptr);
12461246

12471247
return nullptr;
@@ -1282,7 +1282,7 @@ HeaderSearch::loadModuleMapFile(const DirectoryEntry *Dir, bool IsSystem,
12821282
void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) {
12831283
Modules.clear();
12841284

1285-
if (LangOpts.ModulesImplicitMaps) {
1285+
if (HSOpts->ImplicitModuleMaps) {
12861286
// Load module maps for each of the header search directories.
12871287
for (unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) {
12881288
bool IsSystem = SearchDirs[Idx].isSystemHeaderDirectory();
@@ -1333,7 +1333,7 @@ void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) {
13331333
}
13341334

13351335
void HeaderSearch::loadTopLevelSystemModules() {
1336-
if (!LangOpts.ModulesImplicitMaps)
1336+
if (!HSOpts->ImplicitModuleMaps)
13371337
return;
13381338

13391339
// Load module maps for each of the header search directories.
@@ -1351,7 +1351,7 @@ void HeaderSearch::loadTopLevelSystemModules() {
13511351
}
13521352

13531353
void HeaderSearch::loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir) {
1354-
assert(LangOpts.ModulesImplicitMaps &&
1354+
assert(HSOpts->ImplicitModuleMaps &&
13551355
"Should not be loading subdirectory module maps");
13561356

13571357
if (SearchDir.haveSearchedAllModuleMaps())

lib/Lex/ModuleMap.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ static bool isBuiltinHeader(StringRef FileName) {
165165
ModuleMap::HeadersMap::iterator
166166
ModuleMap::findKnownHeader(const FileEntry *File) {
167167
HeadersMap::iterator Known = Headers.find(File);
168-
if (Known == Headers.end() && File->getDir() == BuiltinIncludeDir &&
168+
if (HeaderInfo.getHeaderSearchOpts().ImplicitModuleMaps &&
169+
Known == Headers.end() && File->getDir() == BuiltinIncludeDir &&
169170
isBuiltinHeader(llvm::sys::path::filename(File->getName()))) {
170171
HeaderInfo.loadTopLevelSystemModules();
171172
return Headers.find(File);
@@ -176,6 +177,9 @@ ModuleMap::findKnownHeader(const FileEntry *File) {
176177
ModuleMap::KnownHeader
177178
ModuleMap::findHeaderInUmbrellaDirs(const FileEntry *File,
178179
SmallVectorImpl<const DirectoryEntry *> &IntermediateDirs) {
180+
if (UmbrellaDirs.empty())
181+
return KnownHeader();
182+
179183
const DirectoryEntry *Dir = File->getDir();
180184
assert(Dir && "file in no directory");
181185

lib/Lex/PPDirectives.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
16031603
FilenameLoc, LangOpts.MSVCCompat ? NormalizedPath.c_str() : Filename,
16041604
isAngled, LookupFrom, LookupFromFile, CurDir,
16051605
Callbacks ? &SearchPath : nullptr, Callbacks ? &RelativePath : nullptr,
1606-
HeaderInfo.getHeaderSearchOpts().ModuleMaps ? &SuggestedModule : nullptr);
1606+
&SuggestedModule);
16071607

16081608
if (!File) {
16091609
if (Callbacks) {
@@ -1620,9 +1620,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
16201620
FilenameLoc,
16211621
LangOpts.MSVCCompat ? NormalizedPath.c_str() : Filename, isAngled,
16221622
LookupFrom, LookupFromFile, CurDir, nullptr, nullptr,
1623-
HeaderInfo.getHeaderSearchOpts().ModuleMaps ? &SuggestedModule
1624-
: nullptr,
1625-
/*SkipCache*/ true);
1623+
&SuggestedModule, /*SkipCache*/ true);
16261624
}
16271625
}
16281626
}
@@ -1638,8 +1636,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
16381636
LookupFrom, LookupFromFile, CurDir,
16391637
Callbacks ? &SearchPath : nullptr,
16401638
Callbacks ? &RelativePath : nullptr,
1641-
HeaderInfo.getHeaderSearchOpts().ModuleMaps ? &SuggestedModule
1642-
: nullptr);
1639+
&SuggestedModule);
16431640
if (File) {
16441641
SourceRange Range(FilenameTok.getLocation(), CharEnd);
16451642
Diag(FilenameTok, diag::err_pp_file_not_found_not_fatal) <<

test/Modules/Rmodule-build.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: echo 'module B { header "B.h" }' >> %t/module.modulemap
88
// RUN: echo 'module C { header "C.h" }' >> %t/module.modulemap
99

10-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -verify \
10+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fsyntax-only %s -verify \
1111
// RUN: -I %t -Rmodule-build
1212

1313
@import A; // expected-remark{{building module 'A' as}} expected-remark {{finished building module 'A'}}
@@ -16,19 +16,19 @@
1616
@import B; // no diagnostic
1717

1818
// RUN: echo ' ' >> %t/C.h
19-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
19+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fsyntax-only %s -I %t \
2020
// RUN: -Rmodule-build 2>&1 | FileCheck %s
2121

2222
// RUN: echo ' ' >> %t/C.h
23-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
23+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fsyntax-only %s -I %t \
2424
// RUN: -Reverything 2>&1 | FileCheck %s
2525

2626
// RUN: echo ' ' >> %t/B.h
27-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
27+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fsyntax-only %s -I %t \
2828
// RUN: 2>&1 | FileCheck -allow-empty -check-prefix=NO-REMARKS %s
2929

3030
// RUN: echo ' ' >> %t/B.h
31-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \
31+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fsyntax-only %s -I %t \
3232
// RUN: -Rmodule-build -Rno-everything 2>&1 | \
3333
// RUN: FileCheck -allow-empty -check-prefix=NO-REMARKS %s
3434

test/Modules/Werror-Wsystem-headers.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// RUN: mkdir %t-saved
44

55
// Initial module build
6-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
6+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
77
// RUN: -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify
88
// RUN: cp %t/cstd.pcm %t-saved/cstd.pcm
99

1010
// Even with -Werror don't rebuild a system module
11-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
11+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
1212
// RUN: -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify -Werror
1313
// RUN: diff %t/cstd.pcm %t-saved/cstd.pcm
1414

1515
// Unless -Wsystem-headers is on
16-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
16+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
1717
// RUN: -isystem %S/Inputs/System/usr/include -fsyntax-only %s -verify \
1818
// RUN: -Werror=unused -Wsystem-headers
1919
// RUN: not diff %t/cstd.pcm %t-saved/cstd.pcm

test/Modules/Werror.m

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@
33
// RUN: mkdir -p %t-saved
44

55
// Initial module build (-Werror=header-guard)
6-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
6+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
77
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
88
// RUN: -Werror=header-guard
99
// RUN: cp %t/Module.pcm %t-saved/Module.pcm
1010

1111
// Building with looser -Werror options does not rebuild
12-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
12+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
1313
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella
1414
// RUN: diff %t/Module.pcm %t-saved/Module.pcm
1515

1616
// Make the build more restricted (-Werror)
17-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
17+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
1818
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
1919
// RUN: -Werror -Wno-incomplete-umbrella
2020
// RUN: not diff %t/Module.pcm %t-saved/Module.pcm
2121
// RUN: cp %t/Module.pcm %t-saved/Module.pcm
2222

2323
// Ensure -Werror=header-guard is less strict than -Werror
24-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
24+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
2525
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
2626
// RUN: -Werror=header-guard -Wno-incomplete-umbrella
2727
// RUN: diff %t/Module.pcm %t-saved/Module.pcm
2828

2929
// But -Werror=unused is not, because some of its diags are DefaultIgnore
30-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
30+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
3131
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
3232
// RUN: -Werror=unused
3333
// RUN: not diff %t/Module.pcm %t-saved/Module.pcm
3434
// RUN: cp %t/Module.pcm %t-saved/Module.pcm
3535

36-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
36+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
3737
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
3838
// RUN: -Werror -Wno-incomplete-umbrella
3939

@@ -42,30 +42,30 @@
4242
// RUN-DISABLED: diff %t/Module.pcm %t-saved/Module.pcm
4343

4444
// -Wno-everything, -Werror
45-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
45+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
4646
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
4747
// RUN: -Wno-everything -Wall -Werror
4848
// RUN: cp %t/Module.pcm %t-saved/Module.pcm
49-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
49+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
5050
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
5151
// RUN: -Wall -Werror
5252
// RUN: not diff %t/Module.pcm %t-saved/Module.pcm
5353

5454
// -pedantic, -Werror is not compatible with -Wall -Werror
55-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
55+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
5656
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
5757
// RUN: -Werror -pedantic
5858
// RUN: not diff %t/Module.pcm %t-saved/Module.pcm
5959
// RUN: cp %t/Module.pcm %t-saved/Module.pcm
6060

6161
// -pedantic-errors is less strict that -pedantic, -Werror
62-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
62+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
6363
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
6464
// RUN: -pedantic-errors
6565
// RUN: diff %t/Module.pcm %t-saved/Module.pcm
6666

6767
// -Wsystem-headers does not affect non-system modules
68-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \
68+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
6969
// RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \
7070
// RUN: -pedantic-errors -Wsystem-headers
7171
// RUN: diff %t/Module.pcm %t-saved/Module.pcm

test/Modules/add-remove-private.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
// RUN: cp -r %S/Inputs/AddRemovePrivate.framework %t/AddRemovePrivate.framework
55

66
// Build with module.private.modulemap
7-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP
7+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP
88
// RUN: cp %t.mcp/AddRemovePrivate.pcm %t/with.pcm
99

1010
// Build without module.private.modulemap
1111
// RUN: rm %t/AddRemovePrivate.framework/Modules/module.private.modulemap
12-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify
12+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify
1313
// RUN: not diff %t.mcp/AddRemovePrivate.pcm %t/with.pcm
1414
// RUN: cp %t.mcp/AddRemovePrivate.pcm %t/without.pcm
15-
// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -DP 2>&1 | FileCheck %s
15+
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -DP 2>&1 | FileCheck %s
1616
// CHECK: no submodule named 'Private'
1717

1818
// Build with module.private.modulemap (again)
1919
// RUN: cp %S/Inputs/AddRemovePrivate.framework/Modules/module.private.modulemap %t/AddRemovePrivate.framework/Modules/module.private.modulemap
20-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP
20+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP
2121
// RUN: not diff %t.mcp/AddRemovePrivate.pcm %t/without.pcm
2222

2323
// expected-no-diagnostics

test/Modules/anon-namespace.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: rm -rf %t
2-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/anon-namespace -verify %s
2+
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/anon-namespace -verify %s
33
// expected-no-diagnostics
44
#include "b1.h"
55
#include "c.h"

0 commit comments

Comments
 (0)