]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/tools/clang/lib/Driver/Job.cpp
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.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 #include "llvm/ADT/STLExtras.h"
12 #include <cassert>
13 using namespace clang::driver;
14
15 Job::~Job() {}
16
17 void Command::anchor() {}
18
19 Command::Command(const Action &_Source, const Tool &_Creator,
20                  const char *_Executable, const ArgStringList &_Arguments)
21   : Job(CommandClass), Source(_Source), Creator(_Creator),
22     Executable(_Executable), Arguments(_Arguments)
23 {
24 }
25
26 JobList::JobList() : Job(JobListClass) {}
27
28 JobList::~JobList() {
29   for (iterator it = begin(), ie = end(); it != ie; ++it)
30     delete *it;
31 }
32
33 void JobList::clear() {
34   DeleteContainerPointers(Jobs);
35 }
36
37 void Job::addCommand(Command *C) {
38   cast<JobList>(this)->addJob(C);
39 }
40