]> granicus.if.org Git - clang/commitdiff
Support -f[no-]rewrite-includes from the driver.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 14 Jun 2012 18:55:27 +0000 (18:55 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 14 Jun 2012 18:55:27 +0000 (18:55 +0000)
Review by Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158463 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Driver/Tools.cpp

index c128d6eca8fe481faa63341e34e6617eff2e360c..f7de6f88a80adb40cc41eabd6c352e3e99b0e2f7 100644 (file)
@@ -493,8 +493,6 @@ def token_cache : Separate<"-token-cache">, MetaVarName<"<path>">,
   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
index 73f5fbb2424bcfa144faf198fecce7b85dcdac09..ba4d20e72720e29b634483d9ead2ef0d40b510c9 100644 (file)
@@ -407,6 +407,10 @@ def fno_trapping_math : Flag<"-fno-trapping-math">, Group<f_Group>;
 def ffor_scope : Flag<"-ffor-scope">, Group<f_Group>;
 def fno_for_scope : Flag<"-fno-for-scope">, Group<f_Group>;
 
+def frewrite_includes : Flag<"-frewrite-includes">, Group<f_Group>,
+  Flags<[CC1Option]>;
+def fno_rewrite_includes : Flag<"-fno-rewrite-includes">, Group<f_Group>;
+
 def ffreestanding : Flag<"-ffreestanding">, Group<f_Group>, Flags<[CC1Option]>,
   HelpText<"Assert that the compilation takes place in a freestanding environment">;
 def fgnu_keywords : Flag<"-fgnu-keywords">, Group<f_Group>, Flags<[CC1Option]>,
index dec9dbadca2e3b8aef1ef9587fc8787e4185cdbb..150815096f6a178c7c5c8a24bee932cdf5f51ea5 100644 (file)
@@ -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);