diff options
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 6b082c8..bfc247a 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -43,8 +43,17 @@ void Clang::AddPreprocessingOptions(const Driver &D, ArgStringList &CmdArgs, const InputInfo &Output, const InputInfoList &Inputs) const { - // Handle dependency file generation. Arg *A; + + if ((A = Args.getLastArg(options::OPT_C)) || + (A = Args.getLastArg(options::OPT_CC))) { + if (!Args.hasArg(options::OPT_E)) + D.Diag(clang::diag::err_drv_argument_only_allowed_with) + << A->getAsString(Args) << "-E"; + A->render(Args, CmdArgs); + } + + // Handle dependency file generation. if ((A = Args.getLastArg(options::OPT_M)) || (A = Args.getLastArg(options::OPT_MM)) || (A = Args.getLastArg(options::OPT_MD)) || @@ -550,8 +559,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, options::OPT_fno_diagnostics_show_option)) CmdArgs.push_back("-fdiagnostics-show-option"); if (!Args.hasFlag(options::OPT_fcolor_diagnostics, - options::OPT_fno_color_diagnostics)) + options::OPT_fno_color_diagnostics)) CmdArgs.push_back("-fno-color-diagnostics"); + if (!Args.hasFlag(options::OPT_fshow_source_location, + options::OPT_fno_show_source_location)) + CmdArgs.push_back("-fno-show-source-location"); // -fdollars-in-identifiers default varies depending on platform and // language; only pass if specified. |