9 #ifndef LLVM_CLANG_DRIVER_JOB_H 10 #define LLVM_CLANG_DRIVER_JOB_H 13 #include "llvm/ADT/ArrayRef.h" 14 #include "llvm/ADT/Optional.h" 15 #include "llvm/ADT/SmallVector.h" 16 #include "llvm/ADT/StringRef.h" 17 #include "llvm/ADT/iterator.h" 18 #include "llvm/Option/Option.h" 36 : Filename(Filename), VFSPath(VFSPath) {}
49 const char *Executable;
53 llvm::opt::ArgStringList Arguments;
56 llvm::opt::ArgStringList InputFilenames;
60 const char *ResponseFile =
nullptr;
64 llvm::opt::ArgStringList InputFileList;
68 std::string ResponseFileFlag;
71 std::vector<const char *> Environment;
83 void writeResponseFile(raw_ostream &OS)
const;
87 bool PrintInputFilenames =
false;
90 bool InProcess =
false;
93 const llvm::opt::ArgStringList &Arguments,
100 virtual void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
104 std::string *ErrMsg,
bool *ExecutionFailed)
const;
113 void setResponseFile(
const char *FileName);
118 InputFileList = std::move(List);
129 const llvm::opt::ArgStringList &
getArguments()
const {
return Arguments; }
132 static void printArg(llvm::raw_ostream &OS, StringRef Arg,
bool Quote);
136 void PrintFileNames()
const;
143 const llvm::opt::ArgStringList &Arguments,
146 void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
150 bool *ExecutionFailed)
const override;
160 const char *Executable_,
161 const llvm::opt::ArgStringList &Arguments_,
163 std::unique_ptr<Command> Fallback_);
165 void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
169 bool *ExecutionFailed)
const override;
172 std::unique_ptr<Command> Fallback;
179 const char *Executable_,
180 const llvm::opt::ArgStringList &Arguments_,
183 void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
187 bool *ExecutionFailed)
const override;
195 using iterator = llvm::pointee_iterator<list_type::iterator>;
202 void Print(llvm::raw_ostream &OS,
const char *Terminator,
206 void addJob(std::unique_ptr<Command> J) { Jobs.push_back(std::move(J)); }
213 bool empty()
const {
return Jobs.empty(); }
224 #endif // LLVM_CLANG_DRIVER_JOB_H
Like Command, but with a fallback which is executed in case the primary command crashes.
llvm::pointee_iterator< list_type::const_iterator > const_iterator
const_iterator begin() const
Action - Represent an abstract compilation step to perform.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
list_type::size_type size_type
Use the CC1 tool callback when available, to avoid creating a new process.
const Tool & getCreator() const
getCreator - Return the Tool which caused the creation of this job.
JobList - A sequence of jobs to perform.
void addJob(std::unique_ptr< Command > J)
Add a job to the list (taking ownership).
const_iterator end() const
Command - An executable path/name and argument vector to execute.
const Action & getSource() const
getSource - Return the Action which caused the creation of this job.
Dataflow Directional Tag Classes.
const char * getExecutable() const
const llvm::opt::ArgStringList & getArguments() const
Like Command, but always pretends that the wrapped command succeeded.
void setInputFileList(llvm::opt::ArgStringList List)
Set an input file list, necessary if we need to use a response file but the tool being called only su...
CrashReportInfo(StringRef Filename, StringRef VFSPath)
const list_type & getJobs() const