2011-01-01 01:31:54 +08:00
|
|
|
//===--- Job.cpp - Command to Execute -------------------------------------===//
|
2009-03-14 07:36:33 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/Driver/Job.h"
|
|
|
|
|
2011-08-03 01:58:04 +08:00
|
|
|
#include "llvm/ADT/STLExtras.h"
|
|
|
|
|
2009-03-14 07:36:33 +08:00
|
|
|
#include <cassert>
|
|
|
|
using namespace clang::driver;
|
|
|
|
|
|
|
|
Job::~Job() {}
|
|
|
|
|
2011-12-20 10:48:34 +08:00
|
|
|
void Command::anchor() {}
|
|
|
|
|
2009-12-02 11:23:25 +08:00
|
|
|
Command::Command(const Action &_Source, const Tool &_Creator,
|
|
|
|
const char *_Executable, const ArgStringList &_Arguments)
|
|
|
|
: Job(CommandClass), Source(_Source), Creator(_Creator),
|
|
|
|
Executable(_Executable), Arguments(_Arguments)
|
|
|
|
{
|
2009-03-14 07:36:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
JobList::JobList() : Job(JobListClass) {}
|
2009-03-18 15:06:02 +08:00
|
|
|
|
2010-03-12 02:04:49 +08:00
|
|
|
JobList::~JobList() {
|
|
|
|
for (iterator it = begin(), ie = end(); it != ie; ++it)
|
|
|
|
delete *it;
|
|
|
|
}
|
|
|
|
|
2011-08-03 01:58:04 +08:00
|
|
|
void JobList::clear() {
|
|
|
|
DeleteContainerPointers(Jobs);
|
|
|
|
}
|
|
|
|
|
2009-03-18 15:06:02 +08:00
|
|
|
void Job::addCommand(Command *C) {
|
2010-08-02 10:38:25 +08:00
|
|
|
cast<JobList>(this)->addJob(C);
|
2009-03-18 15:06:02 +08:00
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|