]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/lib/Driver/Job.cpp
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / tools / clang / lib / Driver / Job.cpp
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
17 Command::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
24 JobList::JobList() : Job(JobListClass) {}
25
26 JobList::~JobList() {
27   for (iterator it = begin(), ie = end(); it != ie; ++it)
28     delete *it;
29 }
30
31 void Job::addCommand(Command *C) {
32   cast<JobList>(this)->addJob(C);
33 }
34