Nick Lewycky | 3fdcc6f | 2010-12-31 17:31:54 +0000 | [diff] [blame] | 1 | //===--- Job.cpp - Command to Execute -------------------------------------===// |
Daniel Dunbar | 789e220 | 2009-03-13 23:36:33 +0000 | [diff] [blame] | 2 | // |
| 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 Rosier | 2b81910 | 2011-08-02 17:58:04 +0000 | [diff] [blame] | 11 | #include "llvm/ADT/STLExtras.h" |
Daniel Dunbar | 789e220 | 2009-03-13 23:36:33 +0000 | [diff] [blame] | 12 | #include <cassert> |
| 13 | using namespace clang::driver; |
| 14 | |
| 15 | Job::~Job() {} |
| 16 | |
David Blaikie | 99ba9e3 | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 17 | void Command::anchor() {} |
| 18 | |
Daniel Dunbar | daab7b1 | 2009-12-02 03:23:25 +0000 | [diff] [blame] | 19 | Command::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 Dunbar | 789e220 | 2009-03-13 23:36:33 +0000 | [diff] [blame] | 24 | } |
| 25 | |
Daniel Dunbar | 789e220 | 2009-03-13 23:36:33 +0000 | [diff] [blame] | 26 | JobList::JobList() : Job(JobListClass) {} |
Daniel Dunbar | 871adcf | 2009-03-18 07:06:02 +0000 | [diff] [blame] | 27 | |
Daniel Dunbar | 9d44023 | 2010-03-11 18:04:49 +0000 | [diff] [blame] | 28 | JobList::~JobList() { |
| 29 | for (iterator it = begin(), ie = end(); it != ie; ++it) |
| 30 | delete *it; |
| 31 | } |
| 32 | |
Chad Rosier | 2b81910 | 2011-08-02 17:58:04 +0000 | [diff] [blame] | 33 | void JobList::clear() { |
| 34 | DeleteContainerPointers(Jobs); |
| 35 | } |
| 36 | |
Daniel Dunbar | 871adcf | 2009-03-18 07:06:02 +0000 | [diff] [blame] | 37 | void Job::addCommand(Command *C) { |
Daniel Dunbar | d0b77e1 | 2010-08-02 02:38:25 +0000 | [diff] [blame] | 38 | cast<JobList>(this)->addJob(C); |
Daniel Dunbar | 871adcf | 2009-03-18 07:06:02 +0000 | [diff] [blame] | 39 | } |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 40 | |