Daniel Dunbar | 789e220 | 2009-03-13 23:36:33 +0000 | [diff] [blame] | 1 | //===--- Job.cpp - Command to Execute -----------------------------------*-===// |
| 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" |
| 11 | |
| 12 | #include <cassert> |
| 13 | using namespace clang::driver; |
| 14 | |
| 15 | Job::~Job() {} |
| 16 | |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame^] | 17 | Command::Command(const Action &_Source, const char *_Executable, |
Daniel Dunbar | cae087e | 2009-07-01 19:02:28 +0000 | [diff] [blame] | 18 | const ArgStringList &_Arguments) |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame^] | 19 | : Job(CommandClass), Source(_Source), Executable(_Executable), |
Daniel Dunbar | cae087e | 2009-07-01 19:02:28 +0000 | [diff] [blame] | 20 | Arguments(_Arguments) { |
Daniel Dunbar | 789e220 | 2009-03-13 23:36:33 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | PipedJob::PipedJob() : Job(PipedJobClass) {} |
| 24 | |
| 25 | JobList::JobList() : Job(JobListClass) {} |
Daniel Dunbar | 871adcf | 2009-03-18 07:06:02 +0000 | [diff] [blame] | 26 | |
| 27 | void Job::addCommand(Command *C) { |
| 28 | if (PipedJob *PJ = dyn_cast<PipedJob>(this)) |
| 29 | PJ->addCommand(C); |
| 30 | else |
| 31 | cast<JobList>(this)->addJob(C); |
| 32 | } |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame^] | 33 | |