blob: 1bd123e220ec0f91a6d13a1cf50344d8e7a67466 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001//===--- 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
17Command::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{
22}
23
24PipedJob::PipedJob() : Job(PipedJobClass) {}
25
26JobList::JobList() : Job(JobListClass) {}
27
28void Job::addCommand(Command *C) {
29 if (PipedJob *PJ = dyn_cast<PipedJob>(this))
30 PJ->addCommand(C);
31 else
32 cast<JobList>(this)->addJob(C);
33}
34