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" 37 : Filename(Filename), VFSPath(VFSPath) {}
50 const char *Executable;
54 llvm::opt::ArgStringList Arguments;
57 llvm::opt::ArgStringList InputFilenames;
60 bool PrintInputFilenames =
false;
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);
141 const char *Executable_,
142 const llvm::opt::ArgStringList &Arguments_,
144 std::unique_ptr<Command> Fallback_);
146 void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
150 bool *ExecutionFailed)
const override;
153 std::unique_ptr<Command> Fallback;
160 const char *Executable_,
161 const llvm::opt::ArgStringList &Arguments_,
164 void Print(llvm::raw_ostream &OS,
const char *Terminator,
bool Quote,
168 bool *ExecutionFailed)
const override;
176 using iterator = llvm::pointee_iterator<list_type::iterator>;
183 void Print(llvm::raw_ostream &OS,
const char *Terminator,
187 void addJob(std::unique_ptr<Command> J) { Jobs.push_back(std::move(J)); }
194 bool empty()
const {
return Jobs.empty(); }
205 #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
void setPrintInputFilenames(bool P)
Set whether to print the input filenames when executing.
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