[clang] 692f305 - [Driver] Remove unused class ForceSuccessCommand

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue May 30 13:16:26 PDT 2023


Author: Kazu Hirata
Date: 2023-05-30T13:16:15-07:00
New Revision: 692f3059fb95fe191033d2f710c51babc08b9425

URL: https://github.com/llvm/llvm-project/commit/692f3059fb95fe191033d2f710c51babc08b9425
DIFF: https://github.com/llvm/llvm-project/commit/692f3059fb95fe191033d2f710c51babc08b9425.diff

LOG: [Driver] Remove unused class ForceSuccessCommand

The last use was removed by:

  commit 6625680a581c5e29c53d9f58d864cc6cd3cd05f6
  Author: Hans Wennborg <hans at chromium.org>
  Date:   Tue Feb 2 14:10:26 2021 +0100

Differential Revision: https://reviews.llvm.org/D151609

Added: 
    

Modified: 
    clang/include/clang/Driver/Job.h
    clang/lib/Driver/Job.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Job.h b/clang/include/clang/Driver/Job.h
index e866679dc1a9..df9449463c53 100644
--- a/clang/include/clang/Driver/Job.h
+++ b/clang/include/clang/Driver/Job.h
@@ -258,23 +258,6 @@ class CC1Command : public Command {
   void setEnvironment(llvm::ArrayRef<const char *> NewEnvironment) override;
 };
 
-/// Like Command, but always pretends that the wrapped command succeeded.
-class ForceSuccessCommand : public Command {
-public:
-  ForceSuccessCommand(const Action &Source_, const Tool &Creator_,
-                      ResponseFileSupport ResponseSupport,
-                      const char *Executable_,
-                      const llvm::opt::ArgStringList &Arguments_,
-                      ArrayRef<InputInfo> Inputs,
-                      ArrayRef<InputInfo> Outputs = std::nullopt);
-
-  void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote,
-             CrashReportInfo *CrashInfo = nullptr) const override;
-
-  int Execute(ArrayRef<std::optional<StringRef>> Redirects, std::string *ErrMsg,
-              bool *ExecutionFailed) const override;
-};
-
 /// JobList - A sequence of jobs to perform.
 class JobList {
 public:

diff  --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp
index f85f55cd1ff5..573e91856d77 100644
--- a/clang/lib/Driver/Job.cpp
+++ b/clang/lib/Driver/Job.cpp
@@ -449,30 +449,6 @@ void CC1Command::setEnvironment(llvm::ArrayRef<const char *> NewEnvironment) {
       "The CC1Command doesn't support changing the environment vars!");
 }
 
-ForceSuccessCommand::ForceSuccessCommand(
-    const Action &Source_, const Tool &Creator_,
-    ResponseFileSupport ResponseSupport, const char *Executable_,
-    const llvm::opt::ArgStringList &Arguments_, ArrayRef<InputInfo> Inputs,
-    ArrayRef<InputInfo> Outputs)
-    : Command(Source_, Creator_, ResponseSupport, Executable_, Arguments_,
-              Inputs, Outputs) {}
-
-void ForceSuccessCommand::Print(raw_ostream &OS, const char *Terminator,
-                            bool Quote, CrashReportInfo *CrashInfo) const {
-  Command::Print(OS, "", Quote, CrashInfo);
-  OS << " || (exit 0)" << Terminator;
-}
-
-int ForceSuccessCommand::Execute(ArrayRef<std::optional<StringRef>> Redirects,
-                                 std::string *ErrMsg,
-                                 bool *ExecutionFailed) const {
-  int Status = Command::Execute(Redirects, ErrMsg, ExecutionFailed);
-  (void)Status;
-  if (ExecutionFailed)
-    *ExecutionFailed = false;
-  return 0;
-}
-
 void JobList::Print(raw_ostream &OS, const char *Terminator, bool Quote,
                     CrashReportInfo *CrashInfo) const {
   for (const auto &Job : *this)


        


More information about the cfe-commits mailing list