From 2f197adeeb9765fb23a2da7b38da664c4e82276a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 3 Jan 2012 15:21:29 +0000 Subject: [PATCH] Rename the command-line option for mapping #include/#import over to module imports from -fauto-module-import to -fmodules. The new name will eventually be used to enable modules, and the #include/#import mapping is a crucial part of the feature. llvm-svn: 147447 --- clang/include/clang/Driver/CC1Options.td | 5 ++--- clang/include/clang/Driver/Options.td | 3 +-- clang/lib/Driver/Tools.cpp | 2 +- clang/lib/Frontend/CompilerInvocation.cpp | 2 +- clang/test/Modules/auto-module-import.m | 2 +- clang/test/Modules/inferred-submodules.m | 2 +- clang/test/Modules/normal-module-map.cpp | 2 +- clang/test/Modules/requires.m | 2 +- clang/test/Modules/subframeworks.m | 4 ++-- clang/test/Modules/submodules-preprocess.cpp | 2 +- clang/test/Modules/submodules.cpp | 2 +- clang/test/Modules/submodules.m | 2 +- clang/test/Modules/wildcard-submodule-exports.cpp | 2 +- 13 files changed, 15 insertions(+), 17 deletions(-) diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index ec6e03bf767b..3b87dd2ab56d 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/include/clang/Driver/CC1Options.td @@ -650,9 +650,8 @@ def fmodule_name : Joined<"-fmodule-name=">, HelpText<"Specify the name of the module to build">; def fdisable_module_hash : Flag<"-fdisable-module-hash">, HelpText<"Disable the module hash">; -def fauto_module_import : Flag<"-fauto-module-import">, - HelpText<"Automatically translate #include/#import into module imports " - "when possible">; +def fmodules : Flag<"-fmodules">, + HelpText<"Enable the 'modules' language feature">; def F : JoinedOrSeparate<"-F">, MetaVarName<"">, HelpText<"Add directory to framework include search path">; diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 08b3f03eae7f..e3b50c4582e5 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -380,8 +380,7 @@ def fmsc_version : Joined<"-fmsc-version=">, Group; def fdelayed_template_parsing : Flag<"-fdelayed-template-parsing">, Group; def fmodule_cache_path : Separate<"-fmodule-cache-path">, Group, Flags<[NoForward]>; -def fauto_module_import : Flag <"-fauto-module-import">, Group, - Flags<[NoForward]>; +def fmodules : Flag <"-fmodules">, Group, Flags<[NoForward]>; def fmudflapth : Flag<"-fmudflapth">, Group; def fmudflap : Flag<"-fmudflap">, Group; diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index f678667c33cf..b7379e72ea88 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -395,7 +395,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, CmdArgs.push_back(Args.MakeArgString(DefaultModuleCache)); } - Args.AddAllArgs(CmdArgs, options::OPT_fauto_module_import); + Args.AddAllArgs(CmdArgs, options::OPT_fmodules); // Parse additional include paths from environment variables. // FIXME: We should probably sink the logic for handling these from the diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 0137774cf108..1b335c63f939 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1903,7 +1903,7 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, Opts.TokenCache = Opts.ImplicitPTHInclude; Opts.UsePredefines = !Args.hasArg(OPT_undef); Opts.DetailedRecord = Args.hasArg(OPT_detailed_preprocessing_record); - Opts.AutoModuleImport = Args.hasArg(OPT_fauto_module_import); + Opts.AutoModuleImport = Args.hasArg(OPT_fmodules); Opts.DisablePCHValidation = Args.hasArg(OPT_fno_validate_pch); Opts.DumpDeserializedPCHDecls = Args.hasArg(OPT_dump_deserialized_pch_decls); diff --git a/clang/test/Modules/auto-module-import.m b/clang/test/Modules/auto-module-import.m index d14f9e903043..429501c4bdb3 100644 --- a/clang/test/Modules/auto-module-import.m +++ b/clang/test/Modules/auto-module-import.m @@ -1,7 +1,7 @@ // other file: expected-note{{'no_umbrella_A_private' declared here}} // RUN: rm -rf %t -// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify +// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify #include // expected-warning{{treating #include as an import of module 'DependsOnModule'}} diff --git a/clang/test/Modules/inferred-submodules.m b/clang/test/Modules/inferred-submodules.m index 9c164d8c52bc..5fe83d2a584b 100644 --- a/clang/test/Modules/inferred-submodules.m +++ b/clang/test/Modules/inferred-submodules.m @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify +// RUN: %clang_cc1 -x objective-c -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify __import_module__ Module.Sub; diff --git a/clang/test/Modules/normal-module-map.cpp b/clang/test/Modules/normal-module-map.cpp index 6aab1cb98137..4d2f59a7ca82 100644 --- a/clang/test/Modules/normal-module-map.cpp +++ b/clang/test/Modules/normal-module-map.cpp @@ -1,7 +1,7 @@ // Note: inside the module. expected-note{{'nested_umbrella_a' declared here}} // RUN: rm -rf %t -// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/normal-module-map %s -verify +// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -fmodules -I %S/Inputs/normal-module-map %s -verify #include "Umbrella/umbrella_sub.h" int getUmbrella() { diff --git a/clang/test/Modules/requires.m b/clang/test/Modules/requires.m index ceb03f32d3ba..d08db647400c 100644 --- a/clang/test/Modules/requires.m +++ b/clang/test/Modules/requires.m @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify +// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify __import_module__ DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}} diff --git a/clang/test/Modules/subframeworks.m b/clang/test/Modules/subframeworks.m index 2e149cccdcc6..13c8bc07ab9a 100644 --- a/clang/test/Modules/subframeworks.m +++ b/clang/test/Modules/subframeworks.m @@ -1,6 +1,6 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify -// RUN: %clang_cc1 -x objective-c++ -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify +// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify +// RUN: %clang_cc1 -x objective-c++ -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify __import_module__ DependsOnModule; diff --git a/clang/test/Modules/submodules-preprocess.cpp b/clang/test/Modules/submodules-preprocess.cpp index ed51b4543f83..b819d40f25a1 100644 --- a/clang/test/Modules/submodules-preprocess.cpp +++ b/clang/test/Modules/submodules-preprocess.cpp @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -Eonly -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify +// RUN: %clang_cc1 -Eonly -fmodule-cache-path %t -fmodules -I %S/Inputs/submodules %s -verify __import_module__ std.vector; diff --git a/clang/test/Modules/submodules.cpp b/clang/test/Modules/submodules.cpp index ce7054f30755..b62d48719aec 100644 --- a/clang/test/Modules/submodules.cpp +++ b/clang/test/Modules/submodules.cpp @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify +// RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -I %S/Inputs/submodules %s -verify __import_module__ std.vector; diff --git a/clang/test/Modules/submodules.m b/clang/test/Modules/submodules.m index e5a050f0f425..bbcd18c64208 100644 --- a/clang/test/Modules/submodules.m +++ b/clang/test/Modules/submodules.m @@ -1,6 +1,6 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify +// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fmodules -F %S/Inputs %s -verify // Note: transitively imports Module.Sub2. __import_module__ Module.Sub; diff --git a/clang/test/Modules/wildcard-submodule-exports.cpp b/clang/test/Modules/wildcard-submodule-exports.cpp index b892acbe5984..a8da381347c3 100644 --- a/clang/test/Modules/wildcard-submodule-exports.cpp +++ b/clang/test/Modules/wildcard-submodule-exports.cpp @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/wildcard-submodule-exports %s -verify +// RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -I %S/Inputs/wildcard-submodule-exports %s -verify __import_module__ C.One;