blob: 222cf15db60f5b0bfb1ecc92af9ecd0da733a8fe [file] [log] [blame]
Daniel Dunbar789e2202009-03-13 23:36:33 +00001//===--- 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>
13using namespace clang::driver;
14
15Job::~Job() {}
16
Daniel Dunbard57ac592009-03-18 06:13:37 +000017Command::Command(const char *_Executable, const ArgStringList &_Arguments)
18 : Job(CommandClass), Executable(_Executable), Arguments(_Arguments) {
Daniel Dunbar789e2202009-03-13 23:36:33 +000019}
20
21PipedJob::PipedJob() : Job(PipedJobClass) {}
22
23JobList::JobList() : Job(JobListClass) {}
Daniel Dunbar871adcf2009-03-18 07:06:02 +000024
25void Job::addCommand(Command *C) {
26 if (PipedJob *PJ = dyn_cast<PipedJob>(this))
27 PJ->addCommand(C);
28 else
29 cast<JobList>(this)->addJob(C);
30}
31