Home | History | Annotate | Download | only in Driver
      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 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 
     41