From: Douglas Gregor Date: Tue, 3 Jan 2012 17:13:05 +0000 (+0000) Subject: Add -fno-modules to the driver, to turn off modules (although they're off by default... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7025d2cc327ec75353454586df2987afce5e5789;p=clang Add -fno-modules to the driver, to turn off modules (although they're off by default anyway). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147449 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index e3b50c4582..9d3cae1e85 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -417,6 +417,7 @@ def fno_lax_vector_conversions : Flag<"-fno-lax-vector-conversions">, Group, Group, HelpText<"Do not limit debug information produced to reduce size of debug binary">; def fno_merge_all_constants : Flag<"-fno-merge-all-constants">, Group; +def fno_modules : Flag <"-fno-modules">, Group, Flags<[NoForward]>; def fno_ms_extensions : Flag<"-fno-ms-extensions">, Group; def fno_ms_compatibility : Flag<"-fno-ms-compatibility">, Group; def fno_delayed_template_parsing : Flag<"-fno-delayed-template-parsing">, Group; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index b7379e72ea..566ea1edaa 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -395,8 +395,6 @@ void Clang::AddPreprocessingOptions(Compilation &C, CmdArgs.push_back(Args.MakeArgString(DefaultModuleCache)); } - 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 // frontend into the driver. It will allow deleting 4 otherwise unused flags. @@ -2023,6 +2021,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fblocks-runtime-optional"); } + if (Args.hasFlag(options::OPT_fmodules, options::OPT_fno_modules, false)) + CmdArgs.push_back("-fmodules"); + // -faccess-control is default. if (Args.hasFlag(options::OPT_fno_access_control, options::OPT_faccess_control,