clang API Documentation

Job.cpp
Go to the documentation of this file.
00001 //===--- Job.cpp - Command to Execute -------------------------------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #include "clang/Driver/Job.h"
00011 
00012 #include "llvm/ADT/STLExtras.h"
00013 
00014 #include <cassert>
00015 using namespace clang::driver;
00016 
00017 Job::~Job() {}
00018 
00019 void Command::anchor() {}
00020 
00021 Command::Command(const Action &_Source, const Tool &_Creator,
00022                  const char *_Executable, const ArgStringList &_Arguments)
00023   : Job(CommandClass), Source(_Source), Creator(_Creator),
00024     Executable(_Executable), Arguments(_Arguments)
00025 {
00026 }
00027 
00028 JobList::JobList() : Job(JobListClass) {}
00029 
00030 JobList::~JobList() {
00031   for (iterator it = begin(), ie = end(); it != ie; ++it)
00032     delete *it;
00033 }
00034 
00035 void JobList::clear() {
00036   DeleteContainerPointers(Jobs);
00037 }
00038 
00039 void Job::addCommand(Command *C) {
00040   cast<JobList>(this)->addJob(C);
00041 }
00042