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 "llvm/ADT/STLExtras.h"
13 
14 #include <cassert>
15 using namespace clang::driver;
16 
17 Job::~Job() {}
18 
19 void Command::anchor() {}
20 
21 Command::Command(const Action &_Source, const Tool &_Creator,
22                  const char *_Executable, const ArgStringList &_Arguments)
23   : Job(CommandClass), Source(_Source), Creator(_Creator),
24     Executable(_Executable), Arguments(_Arguments)
25 {
26 }
27 
28 JobList::JobList() : Job(JobListClass) {}
29 
30 JobList::~JobList() {
31   for (iterator it = begin(), ie = end(); it != ie; ++it)
32     delete *it;
33 }
34 
35 void JobList::clear() {
36   DeleteContainerPointers(Jobs);
37 }
38 
39 void Job::addCommand(Command *C) {
40   cast<JobList>(this)->addJob(C);
41 }
42 
43