blob: 825c86a826165e3e0c0ff62bc33f443d8a55be33 [file] [log] [blame]
Nick Lewycky3fdcc6f2010-12-31 17:31:54 +00001//===--- Job.cpp - Command to Execute -------------------------------------===//
Daniel Dunbar789e2202009-03-13 23:36:33 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "clang/Driver/Job.h"
11
Chad Rosier2b819102011-08-02 17:58:04 +000012#include "llvm/ADT/STLExtras.h"
13
Daniel Dunbar789e2202009-03-13 23:36:33 +000014#include <cassert>
15using namespace clang::driver;
16
17Job::~Job() {}
18
David Blaikie99ba9e32011-12-20 02:48:34 +000019void Command::anchor() {}
20
Daniel Dunbardaab7b12009-12-02 03:23:25 +000021Command::Command(const Action &_Source, const Tool &_Creator,
22 const char *_Executable, const ArgStringList &_Arguments)
23 : Job(CommandClass), Source(_Source), Creator(_Creator),
24 Executable(_Executable), Arguments(_Arguments)
25{
Daniel Dunbar789e2202009-03-13 23:36:33 +000026}
27
Daniel Dunbar789e2202009-03-13 23:36:33 +000028JobList::JobList() : Job(JobListClass) {}
Daniel Dunbar871adcf2009-03-18 07:06:02 +000029
Daniel Dunbar9d440232010-03-11 18:04:49 +000030JobList::~JobList() {
31 for (iterator it = begin(), ie = end(); it != ie; ++it)
32 delete *it;
33}
34
Chad Rosier2b819102011-08-02 17:58:04 +000035void JobList::clear() {
36 DeleteContainerPointers(Jobs);
37}
38
Daniel Dunbar871adcf2009-03-18 07:06:02 +000039void Job::addCommand(Command *C) {
Daniel Dunbard0b77e12010-08-02 02:38:25 +000040 cast<JobList>(this)->addJob(C);
Daniel Dunbar871adcf2009-03-18 07:06:02 +000041}
Mike Stump1eb44332009-09-09 15:08:12 +000042