diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h index 7633ae60daa5..eac7968e7709 100644 --- a/clang/include/clang/Driver/Driver.h +++ b/clang/include/clang/Driver/Driver.h @@ -129,9 +129,6 @@ public: /// Whether the driver is just the preprocessor. bool CCCIsCPP() const { return Mode == CPPMode; } - /// Echo commands while executing (in -v style). - unsigned CCCEcho : 1; - /// Only print tool bindings, don't build any jobs. unsigned CCCPrintBindings : 1; diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 27a844a7908b..3e2fe4d50e89 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -114,8 +114,6 @@ def ccc_debug_Group : OptionGroup<"">, class CCCDriverOpt : Group, Flags<[DriverOption, HelpHidden]>; def driver_mode : Joined<["--"], "driver-mode=">, CCCDriverOpt, HelpText<"Set the driver mode to either 'gcc', 'g++' or 'cpp'">; -def ccc_echo : Flag<["-"], "ccc-echo">, CCCDriverOpt, - HelpText<"Echo commands before running them">; def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, CCCDriverOpt, HelpText<"Name for native GCC compiler">, MetaVarName<"">; diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index b1dd37d6cdf4..fdc6fc25c80f 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -266,7 +266,7 @@ int Compilation::ExecuteCommand(const Command &C, std::copy(C.getArguments().begin(), C.getArguments().end(), Argv+1); Argv[C.getArguments().size() + 1] = 0; - if ((getDriver().CCCEcho || getDriver().CCPrintOptions || + if ((getDriver().CCPrintOptions || getArgs().hasArg(options::OPT_v)) && !getDriver().CCGenDiagnostics) { raw_ostream *OS = &llvm::errs(); diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 98b87bebc0e6..91b6bc148f5e 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -55,7 +55,7 @@ Driver::Driver(StringRef ClangExecutable, DriverTitle("clang LLVM compiler"), CCPrintOptionsFilename(0), CCPrintHeadersFilename(0), CCLogDiagnosticsFilename(0), - CCCEcho(false), CCCPrintBindings(false), + CCCPrintBindings(false), CCPrintOptions(false), CCPrintHeaders(false), CCLogDiagnostics(false), CCGenDiagnostics(false), CCCGenericGCCName(""), CheckInputsExist(true), CCCUsePCH(true), SuppressMissingInputWarning(false) { @@ -300,7 +300,6 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { CCCPrintOptions = Args->hasArg(options::OPT_ccc_print_options); CCCPrintActions = Args->hasArg(options::OPT_ccc_print_phases); CCCPrintBindings = Args->hasArg(options::OPT_ccc_print_bindings); - CCCEcho = Args->hasArg(options::OPT_ccc_echo); if (const Arg *A = Args->getLastArg(options::OPT_ccc_gcc_name)) CCCGenericGCCName = A->getValue(); CCCUsePCH = Args->hasFlag(options::OPT_ccc_pch_is_pch, diff --git a/clang/test/Driver/ccc-add-args.c b/clang/test/Driver/ccc-add-args.c index d9a16cbfb460..171bfd285484 100644 --- a/clang/test/Driver/ccc-add-args.c +++ b/clang/test/Driver/ccc-add-args.c @@ -1,5 +1,4 @@ -// RUN: env CCC_ADD_ARGS="-ccc-echo,-ccc-print-options,,-v" %clang -### 2>&1 | FileCheck %s -// CHECK: Option 0 - Name: "-ccc-echo", Values: {} -// CHECK: Option 1 - Name: "-ccc-print-options", Values: {} -// CHECK: Option 2 - Name: "-v", Values: {} -// CHECK: Option 3 - Name: "-###", Values: {} +// RUN: env CCC_ADD_ARGS="-ccc-print-options,,-v" %clang -### 2>&1 | FileCheck %s +// CHECK: Option 0 - Name: "-ccc-print-options", Values: {} +// CHECK: Option 1 - Name: "-v", Values: {} +// CHECK: Option 2 - Name: "-###", Values: {}