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, 21 const llvm::opt::ArgStringList &_Arguments) 22 : Job(CommandClass), Source(_Source), Creator(_Creator), 23 Executable(_Executable), Arguments(_Arguments) {} 24 25 JobList::JobList() : Job(JobListClass) {} 26 27 JobList::~JobList() { 28 for (iterator it = begin(), ie = end(); it != ie; ++it) 29 delete *it; 30 } 31 32 void JobList::clear() { 33 DeleteContainerPointers(Jobs); 34 } 35 36 void Job::addCommand(Command *C) { 37 cast<JobList>(this)->addJob(C); 38 } 39 40