10 #ifndef LLVM_CLANG_DRIVER_JOB_H 11 #define LLVM_CLANG_DRIVER_JOB_H 14 #include "llvm/ADT/ArrayRef.h" 15 #include "llvm/ADT/Optional.h" 16 #include "llvm/ADT/SmallVector.h" 17 #include "llvm/ADT/StringRef.h" 18 #include "llvm/ADT/iterator.h" 19 #include "llvm/Option/Option.h" 33 using llvm::opt::ArgStringList;
40 : Filename(Filename), VFSPath(VFSPath) {}
53 const char *Executable;
57 llvm::opt::ArgStringList Arguments;
60 llvm::opt::ArgStringList InputFilenames;
64 const char *ResponseFile =
nullptr;
68 llvm::opt::ArgStringList InputFileList;
72 std::string ResponseFileFlag;
75 std::vector<const char *> Environment;
87 void writeResponseFile(raw_ostream &OS)
const;
91 const llvm::opt::ArgStringList &Arguments,
98 virtual void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
102 std::string *ErrMsg,
bool *ExecutionFailed)
const;
111 void setResponseFile(
const char *FileName);
116 InputFileList = std::move(List);
127 const llvm::opt::ArgStringList &
getArguments()
const {
return Arguments; }
130 static void printArg(llvm::raw_ostream &OS, StringRef Arg,
bool Quote);
138 const char *Executable_,
const ArgStringList &Arguments_,
140 std::unique_ptr<Command> Fallback_);
142 void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
146 bool *ExecutionFailed)
const override;
149 std::unique_ptr<Command> Fallback;
156 const char *Executable_,
const ArgStringList &Arguments_,
159 void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
163 bool *ExecutionFailed)
const override;
171 using iterator = llvm::pointee_iterator<list_type::iterator>;
178 void Print(llvm::raw_ostream &OS,
const char *Terminator,
182 void addJob(std::unique_ptr<Command> J) { Jobs.push_back(std::move(J)); }
189 bool empty()
const {
return Jobs.empty(); }
200 #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
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...
llvm::pointee_iterator< list_type::iterator > iterator
CrashReportInfo(StringRef Filename, StringRef VFSPath)
const list_type & getJobs() const