From: David Blaikie Date: Thu, 14 Jun 2012 18:55:27 +0000 (+0000) Subject: Support -f[no-]rewrite-includes from the driver. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=940152f726353e08e3bdcef6f85bc8aa73173597;p=clang Support -f[no-]rewrite-includes from the driver. Review by Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158463 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index c128d6eca8..f7de6f88a8 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -493,8 +493,6 @@ def token_cache : Separate<"-token-cache">, MetaVarName<"">, HelpText<"Use specified token cache file">; def detailed_preprocessing_record : Flag<"-detailed-preprocessing-record">, HelpText<"include a detailed record of preprocessing actions">; -def frewrite_includes : Flag<"-frewrite-includes">, - HelpText<"Expand includes without full preprocessing">; //===----------------------------------------------------------------------===// // OpenCL Options diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 73f5fbb242..ba4d20e727 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -407,6 +407,10 @@ def fno_trapping_math : Flag<"-fno-trapping-math">, Group; def ffor_scope : Flag<"-ffor-scope">, Group; def fno_for_scope : Flag<"-fno-for-scope">, Group; +def frewrite_includes : Flag<"-frewrite-includes">, Group, + Flags<[CC1Option]>; +def fno_rewrite_includes : Flag<"-fno-rewrite-includes">, Group; + def ffreestanding : Flag<"-ffreestanding">, Group, Flags<[CC1Option]>, HelpText<"Assert that the compilation takes place in a freestanding environment">; def fgnu_keywords : Flag<"-fgnu-keywords">, Group, Flags<[CC1Option]>, diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index dec9dbadca..150815096f 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2233,6 +2233,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.getLastArg(options::OPT_fapple_kext)) CmdArgs.push_back("-fapple-kext"); + if (Args.hasFlag(options::OPT_frewrite_includes, + options::OPT_fno_rewrite_includes, false)) + CmdArgs.push_back("-frewrite-includes"); + Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch); Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info); Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits);