blob: 5443d70e825c124815b71873ebb5ec8ad0e3bbaf [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
Chad Rosierbe10f982011-08-02 17:58:04 +000012#include "llvm/ADT/STLExtras.h"
13
Daniel Dunbar313c2912009-03-13 23:36:33 +000014#include <cassert>
15using namespace clang::driver;
16
17Job::~Job() {}
18
Daniel Dunbar120c77e2009-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 Dunbar313c2912009-03-13 23:36:33 +000024}
25
Daniel Dunbar313c2912009-03-13 23:36:33 +000026JobList::JobList() : Job(JobListClass) {}
Daniel Dunbar04c4c2c2009-03-18 07:06:02 +000027
Daniel Dunbar66e276892010-03-11 18:04:49 +000028JobList::~JobList() {
29 for (iterator it = begin(), ie = end(); it != ie; ++it)
30 delete *it;
31}
32
Chad Rosierbe10f982011-08-02 17:58:04 +000033void JobList::clear() {
34 DeleteContainerPointers(Jobs);
35}
36
Daniel Dunbar04c4c2c2009-03-18 07:06:02 +000037void Job::addCommand(Command *C) {
Daniel Dunbarb785d742010-08-02 02:38:25 +000038 cast<JobList>(this)->addJob(C);
Daniel Dunbar04c4c2c2009-03-18 07:06:02 +000039}
Mike Stump11289f42009-09-09 15:08:12 +000040