blob: 8c467050d563cbf132906721eb1099acc40cb695 [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"
Chad Rosier2b819102011-08-02 17:58:04 +000011#include "llvm/ADT/STLExtras.h"
Daniel Dunbar789e2202009-03-13 23:36:33 +000012#include <cassert>
13using namespace clang::driver;
14
15Job::~Job() {}
16
David Blaikie99ba9e32011-12-20 02:48:34 +000017void Command::anchor() {}
18
Daniel Dunbardaab7b12009-12-02 03:23:25 +000019Command::Command(const Action &_Source, const Tool &_Creator,
20 const char *_Executable, const ArgStringList &_Arguments)
21 : Job(CommandClass), Source(_Source), Creator(_Creator),
22 Executable(_Executable), Arguments(_Arguments)
23{
Daniel Dunbar789e2202009-03-13 23:36:33 +000024}
25
Daniel Dunbar789e2202009-03-13 23:36:33 +000026JobList::JobList() : Job(JobListClass) {}
Daniel Dunbar871adcf2009-03-18 07:06:02 +000027
Daniel Dunbar9d440232010-03-11 18:04:49 +000028JobList::~JobList() {
29 for (iterator it = begin(), ie = end(); it != ie; ++it)
30 delete *it;
31}
32
Chad Rosier2b819102011-08-02 17:58:04 +000033void JobList::clear() {
34 DeleteContainerPointers(Jobs);
35}
36
Daniel Dunbar871adcf2009-03-18 07:06:02 +000037void Job::addCommand(Command *C) {
Daniel Dunbard0b77e12010-08-02 02:38:25 +000038 cast<JobList>(this)->addJob(C);
Daniel Dunbar871adcf2009-03-18 07:06:02 +000039}
Mike Stump1eb44332009-09-09 15:08:12 +000040