[cfe-commits] r147449 - in /cfe/trunk: include/clang/Driver/Options.td lib/Driver/Tools.cpp

Douglas Gregor dgregor at apple.com
Tue Jan 3 13:08:16 PST 2012


On Jan 3, 2012, at 9:37 AM, David Blaikie wrote:

> Would it be possible (&useful) to add a simple test for this? (I assume
> it exhibits the usual behavior - that the last specification of modules
> or fno-modules overrides any previous ones) by enabling and then
> disabling modules on the same command line? (though I don't know what
> code relying on modules looks like or how it fails when compiled
> without modules enabled)

Sure, added in r147480.

	- Doug


> From: Douglas Gregor
> Sent: 1/3/2012 7:20 AM
> To: cfe-commits at cs.uiuc.edu
> Subject: [cfe-commits] r147449 - in /cfe/trunk:
> include/clang/Driver/Options.td lib/Driver/Tools.cpp
> Author: dgregor
> Date: Tue Jan  3 11:13:05 2012
> New Revision: 147449
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=147449&view=rev
> Log:
> Add -fno-modules to the driver, to turn off modules (although they're
> off by default anyway).
> 
> Modified:
>    cfe/trunk/include/clang/Driver/Options.td
>    cfe/trunk/lib/Driver/Tools.cpp
> 
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=147449&r1=147448&r2=147449&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Tue Jan  3 11:13:05 2012
> @@ -417,6 +417,7 @@
> def fno_limit_debug_info : Flag<"-fno-limit-debug-info">, Group<f_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<f_Group>;
> +def fno_modules : Flag <"-fno-modules">, Group<f_Group>, Flags<[NoForward]>;
> def fno_ms_extensions : Flag<"-fno-ms-extensions">, Group<f_Group>;
> def fno_ms_compatibility : Flag<"-fno-ms-compatibility">, Group<f_Group>;
> def fno_delayed_template_parsing :
> Flag<"-fno-delayed-template-parsing">, Group<f_Group>;
> 
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=147449&r1=147448&r2=147449&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Tue Jan  3 11:13:05 2012
> @@ -395,8 +395,6 @@
>     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 @@
>       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,
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list