From 607d7f6d8f21066cc48bbe2c51e6ca412a00943f Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 29 Oct 2009 01:53:44 +0000 Subject: [PATCH] Reject -I- in driver instead of clang-cc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85469 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticCommonKinds.td | 4 ---- include/clang/Basic/DiagnosticDriverKinds.td | 2 ++ lib/Driver/Tools.cpp | 4 ++++ tools/clang-cc/clang-cc.cpp | 9 --------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index cbf9cdbc15..bb251ad73b 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -52,8 +52,4 @@ def warn_integer_too_large_for_signed : Warning< def note_invalid_subexpr_in_ice : Note< "subexpression not valid in an integer constant expression">; -// clang-cc -def err_pp_I_dash_not_supported : Error< - "-I- not supported, please use -iquote instead">; - } diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index dfdf0ff2e7..e2f11041dc 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -55,6 +55,8 @@ def err_drv_command_signalled : Error< "%0 command failed due to signal %1 (use -v to see invocation)">; def err_drv_invalid_mfloat_abi : Error< "invalid float ABI '%0'">; +def err_drv_I_dash_not_supported : Error< + "'%0' not supported, please use -iquote instead">; def warn_drv_input_file_unused : Warning< "%0: '%1' input unused when '%2' is present">; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 32ce80d514..feb01cf063 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -204,6 +204,10 @@ void Clang::AddPreprocessingOptions(const Driver &D, // those options. :( Args.AddAllArgValues(CmdArgs, options::OPT_Wp_COMMA, options::OPT_Xpreprocessor); + + // -I- is a deprecated GCC feature, reject it. + if (Arg *A = Args.getLastArg(options::OPT_I_)) + D.Diag(clang::diag::err_drv_I_dash_not_supported) << A->getAsString(Args); } /// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targetting. diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp index 293c2b8cdb..0dc95a4555 100644 --- a/tools/clang-cc/clang-cc.cpp +++ b/tools/clang-cc/clang-cc.cpp @@ -2329,15 +2329,6 @@ int main(int argc, char **argv) { llvm::llvm_install_error_handler(LLVMErrorHandler, static_cast(&Diags)); - // -I- is a deprecated GCC feature, scan for it and reject it. - for (unsigned i = 0, e = I_dirs.size(); i != e; ++i) { - if (I_dirs[i] == "-") { - Diags.Report(FullSourceLoc(), diag::err_pp_I_dash_not_supported); - I_dirs.erase(I_dirs.begin()+i); - --i; - } - } - // Get information about the target being compiled for. llvm::Triple Triple = CreateTargetTriple(); llvm::OwningPtr -- 2.50.1