]> granicus.if.org Git - clang/commitdiff
Revert "clang-cl: Add /showFilenames option (PR31957)"
authorSean Fertile <sfertile@ca.ibm.com>
Thu, 11 Oct 2018 18:40:35 +0000 (18:40 +0000)
committerSean Fertile <sfertile@ca.ibm.com>
Thu, 11 Oct 2018 18:40:35 +0000 (18:40 +0000)
This reverts https://reviews.llvm.org/rL344234 which is causing failures on
several bots due to invalid llvm.linker.options.

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

include/clang/Driver/CLCompatOptions.td
include/clang/Driver/Job.h
lib/Driver/Job.cpp
lib/Driver/ToolChains/Clang.cpp
test/Driver/cl-showfilenames.c [deleted file]

index 3c2bef74ed0a130eee8bcc2bf1bb1faeda1ce97c..62a4497ac42ec85540dd9a96a0f335dad85dc097 100644 (file)
@@ -158,10 +158,6 @@ def _SLASH_Qvec_ : CLFlag<"Qvec-">,
 def _SLASH_showIncludes : CLFlag<"showIncludes">,
   HelpText<"Print info about included files to stderr">,
   Alias<show_includes>;
-def _SLASH_showFilenames : CLFlag<"showFilenames">,
-  HelpText<"Print the name of each compiled file">;
-def _SLASH_showFilenames_ : CLFlag<"showFilenames-">,
-  HelpText<"Don't print the name of each compiled file (default)">;
 def _SLASH_source_charset : CLCompileJoined<"source-charset:">,
   HelpText<"Source encoding, supports only UTF-8">, Alias<finput_charset_EQ>;
 def _SLASH_execution_charset : CLCompileJoined<"execution-charset:">,
index 7a0b769e44d3dca552953163f737c5a77317f26f..47d9e992ba5032b80258987b7f8cfc8c8f51dd0f 100644 (file)
@@ -59,9 +59,6 @@ class Command {
   /// The list of program arguments which are inputs.
   llvm::opt::ArgStringList InputFilenames;
 
-  /// Whether to print the input filenames when executing.
-  bool PrintInputFilenames = false;
-
   /// Response file name, if this command is set to use one, or nullptr
   /// otherwise
   const char *ResponseFile = nullptr;
@@ -131,9 +128,6 @@ public:
 
   /// Print a command argument, and optionally quote it.
   static void printArg(llvm::raw_ostream &OS, StringRef Arg, bool Quote);
-
-  /// Set whether to print the input filenames when executing.
-  void setPrintInputFilenames(bool P) { PrintInputFilenames = P; }
 };
 
 /// Like Command, but with a fallback which is executed in case
index 114efe1998c27d68a5e6bbacea9cfc90ed23beb1..bd1a9bd8e3ebadee63922c69a0a0f53687099113 100644 (file)
@@ -315,12 +315,6 @@ void Command::setEnvironment(llvm::ArrayRef<const char *> NewEnvironment) {
 
 int Command::Execute(ArrayRef<llvm::Optional<StringRef>> Redirects,
                      std::string *ErrMsg, bool *ExecutionFailed) const {
-  if (PrintInputFilenames) {
-    for (const char *Arg : InputFilenames)
-      llvm::outs() << llvm::sys::path::filename(Arg) << "\n";
-    llvm::outs().flush();
-  }
-
   SmallVector<const char*, 128> Argv;
 
   Optional<ArrayRef<StringRef>> Env;
index 4d2cb14a51bb16600ead87650b95a9e89de089e1..127f80696220d22bec89d1aac783a7e22f84d818 100644 (file)
@@ -5067,13 +5067,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
   }
 
-  // Make the compile command echo its inputs for /showFilenames.
-  if (Output.getType() == types::TY_Object &&
-      Args.hasFlag(options::OPT__SLASH_showFilenames,
-                   options::OPT__SLASH_showFilenames_, false)) {
-    C.getJobs().getJobs().back()->setPrintInputFilenames(true);
-  }
-
   if (Arg *A = Args.getLastArg(options::OPT_pg))
     if (!shouldUseFramePointer(Args, Triple))
       D.Diag(diag::err_drv_argument_not_allowed_with) << "-fomit-frame-pointer"
diff --git a/test/Driver/cl-showfilenames.c b/test/Driver/cl-showfilenames.c
deleted file mode 100644 (file)
index fff7cb4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: %clang_cl /c /o %t.obj /showFilenames -- %s 2>&1 | FileCheck -check-prefix=show %s
-// RUN: %clang_cl /c /o %t.obj /showFilenames -- %s %S/Inputs/wildcard*.c 2>&1 | FileCheck -check-prefix=multiple %s
-
-// RUN: %clang_cl /c /o %t.obj -- %s 2>&1 | FileCheck -check-prefix=noshow %s
-// RUN: %clang_cl /c /o %t.obj /showFilenames /showFilenames- -- %s 2>&1 | FileCheck -check-prefix=noshow %s
-
-
-#pragma message "Hello"
-
-// show: cl-showfilenames.c
-// show-NEXT: warning: Hello
-
-// multiple: cl-showfilenames.c
-// multiple-NEXT: warning: Hello
-// multiple: wildcard1.c
-// multiple-NEXT: wildcard2.c
-
-// noshow: warning: Hello
-// noshow-NOT: cl-showfilenames.c