blob: 51055e93f55898452b4debeb82fd9bb9938023eb [file] [log] [blame]
Nick Lewycky6da90772010-12-31 17:31:54 +00001//===--- Job.cpp - Command to Execute -------------------------------------===//
Daniel Dunbar313c2912009-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
12#include <cassert>
13using namespace clang::driver;
14
15Job::~Job() {}
16
Daniel Dunbar120c77e2009-12-02 03:23:25 +000017Command::Command(const Action &_Source, const Tool &_Creator,
18 const char *_Executable, const ArgStringList &_Arguments)
19 : Job(CommandClass), Source(_Source), Creator(_Creator),
20 Executable(_Executable), Arguments(_Arguments)
21{
Daniel Dunbar313c2912009-03-13 23:36:33 +000022}
23
Daniel Dunbar313c2912009-03-13 23:36:33 +000024JobList::JobList() : Job(JobListClass) {}
Daniel Dunbar04c4c2c2009-03-18 07:06:02 +000025
Daniel Dunbar66e276892010-03-11 18:04:49 +000026JobList::~JobList() {
27 for (iterator it = begin(), ie = end(); it != ie; ++it)
28 delete *it;
29}
30
Daniel Dunbar04c4c2c2009-03-18 07:06:02 +000031void Job::addCommand(Command *C) {
Daniel Dunbarb785d742010-08-02 02:38:25 +000032 cast<JobList>(this)->addJob(C);
Daniel Dunbar04c4c2c2009-03-18 07:06:02 +000033}
Mike Stump11289f42009-09-09 15:08:12 +000034