blob: 61e7d983035ca62b61573d9b8ef0cdbe42bbfcd8 [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,
Reid Klecknerb1e25a12013-06-14 17:17:23 +000020 const char *_Executable,
21 const llvm::opt::ArgStringList &_Arguments)
22 : Job(CommandClass), Source(_Source), Creator(_Creator),
23 Executable(_Executable), Arguments(_Arguments) {}
Daniel Dunbar789e2202009-03-13 23:36:33 +000024
Daniel Dunbar789e2202009-03-13 23:36:33 +000025JobList::JobList() : Job(JobListClass) {}
Daniel Dunbar871adcf2009-03-18 07:06:02 +000026
Daniel Dunbar9d440232010-03-11 18:04:49 +000027JobList::~JobList() {
28 for (iterator it = begin(), ie = end(); it != ie; ++it)
29 delete *it;
30}
31
Chad Rosier2b819102011-08-02 17:58:04 +000032void JobList::clear() {
33 DeleteContainerPointers(Jobs);
34}
35
Daniel Dunbar871adcf2009-03-18 07:06:02 +000036void Job::addCommand(Command *C) {
Daniel Dunbard0b77e12010-08-02 02:38:25 +000037 cast<JobList>(this)->addJob(C);
Daniel Dunbar871adcf2009-03-18 07:06:02 +000038}
Mike Stump1eb44332009-09-09 15:08:12 +000039