Skip to content

Commit

Permalink
[Driver] Remove unused class ForceSuccessCommand
Browse files Browse the repository at this point in the history
The last use was removed by:

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

Differential Revision: https://reviews.llvm.org/D151609
  • Loading branch information
kazutakahirata committed May 30, 2023
1 parent 8e0001e commit 692f305
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
17 changes: 0 additions & 17 deletions clang/include/clang/Driver/Job.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 0 additions & 24 deletions clang/lib/Driver/Job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 692f305

Please sign in to comment.