Driver: Eliminate PipedJob, which is now unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110014 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2010-08-02 02:38:25 +00:00
Родитель 7c1e46533c
Коммит d0b77e1a47
3 изменённых файлов: 1 добавлений и 57 удалений

Просмотреть файл

@ -29,7 +29,6 @@ class Job {
public:
enum JobClass {
CommandClass,
PipedJobClass,
JobListClass
};
@ -86,39 +85,6 @@ public:
static bool classof(const Command *) { return true; }
};
/// PipedJob - A list of Commands which should be executed together
/// with their standard inputs and outputs connected.
class PipedJob : public Job {
public:
typedef llvm::SmallVector<Command*, 4> list_type;
typedef list_type::size_type size_type;
typedef list_type::iterator iterator;
typedef list_type::const_iterator const_iterator;
private:
list_type Commands;
public:
PipedJob();
virtual ~PipedJob();
/// Add a command to the piped job (taking ownership).
void addCommand(Command *C) { Commands.push_back(C); }
const list_type &getCommands() const { return Commands; }
size_type size() const { return Commands.size(); }
iterator begin() { return Commands.begin(); }
const_iterator begin() const { return Commands.begin(); }
iterator end() { return Commands.end(); }
const_iterator end() const { return Commands.end(); }
static bool classof(const Job *J) {
return J->getKind() == PipedJobClass;
}
static bool classof(const PipedJob *) { return true; }
};
/// JobList - A sequence of jobs to perform.
class JobList : public Job {
public:

Просмотреть файл

@ -83,10 +83,6 @@ void Compilation::PrintJob(llvm::raw_ostream &OS, const Job &J,
OS << '"';
}
OS << Terminator;
} else if (const PipedJob *PJ = dyn_cast<PipedJob>(&J)) {
for (PipedJob::const_iterator
it = PJ->begin(), ie = PJ->end(); it != ie; ++it)
PrintJob(OS, **it, (it + 1 != PJ->end()) ? " |\n" : "\n", Quote);
} else {
const JobList *Jobs = cast<JobList>(&J);
for (JobList::const_iterator
@ -190,14 +186,6 @@ int Compilation::ExecuteJob(const Job &J,
const Command *&FailingCommand) const {
if (const Command *C = dyn_cast<Command>(&J)) {
return ExecuteCommand(*C, FailingCommand);
} else if (const PipedJob *PJ = dyn_cast<PipedJob>(&J)) {
// Piped commands with a single job are easy.
if (PJ->size() == 1)
return ExecuteCommand(**PJ->begin(), FailingCommand);
FailingCommand = *PJ->begin();
getDriver().Diag(clang::diag::err_drv_unsupported_opt) << "-pipe";
return 1;
} else {
const JobList *Jobs = cast<JobList>(&J);
for (JobList::const_iterator

Просмотреть файл

@ -21,13 +21,6 @@ Command::Command(const Action &_Source, const Tool &_Creator,
{
}
PipedJob::PipedJob() : Job(PipedJobClass) {}
PipedJob::~PipedJob() {
for (iterator it = begin(), ie = end(); it != ie; ++it)
delete *it;
}
JobList::JobList() : Job(JobListClass) {}
JobList::~JobList() {
@ -36,9 +29,6 @@ JobList::~JobList() {
}
void Job::addCommand(Command *C) {
if (PipedJob *PJ = dyn_cast<PipedJob>(this))
PJ->addCommand(C);
else
cast<JobList>(this)->addJob(C);
cast<JobList>(this)->addJob(C);
}