summaryrefslogtreecommitdiffstats
path: root/lib/Driver/Job.cpp
blob: 1bd123e220ec0f91a6d13a1cf50344d8e7a67466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//===--- Job.cpp - Command to Execute -----------------------------------*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "clang/Driver/Job.h"

#include <cassert>
using namespace clang::driver;

Job::~Job() {}

Command::Command(const Action &_Source, const Tool &_Creator,
                 const char *_Executable, const ArgStringList &_Arguments)
  : Job(CommandClass), Source(_Source), Creator(_Creator),
    Executable(_Executable), Arguments(_Arguments)
{
}

PipedJob::PipedJob() : Job(PipedJobClass) {}

JobList::JobList() : Job(JobListClass) {}

void Job::addCommand(Command *C) {
  if (PipedJob *PJ = dyn_cast<PipedJob>(this))
    PJ->addCommand(C);
  else
    cast<JobList>(this)->addJob(C);
}

OpenPOWER on IntegriCloud