20
20
21
21
#include " swift/Basic/LLVM.h"
22
22
#include " swift/Basic/TaskQueue.h"
23
- #include " swift/Driver/Job.h"
24
- #include " swift/Frontend/Frontend.h"
23
+ #include " swift/Basic/FileTypes.h"
25
24
26
25
namespace swift {
27
26
@@ -36,35 +35,42 @@ namespace parseable_output {
36
35
// / into the stream of real PIDs (say, due to a TaskQueue bug).
37
36
const int QUASI_PID_START = -1000 ;
38
37
39
- // / Emits a "began" message to the given stream, corresponding to a Driver Job.
40
- void emitBeganMessage (raw_ostream &os, const driver::Job &Cmd, int64_t Pid,
41
- sys::TaskProcessInformation ProcInfo);
38
+ struct CommandInput {
39
+ std::string Path;
40
+ CommandInput () {}
41
+ CommandInput (StringRef Path) : Path(Path) {}
42
+ };
42
43
43
- // / Emits a "began" message to the given stream, corresponding to a given
44
- // / Frontend Compiler Invocation.
45
- void emitBeganMessage (raw_ostream &os, const CompilerInvocation &Invocation,
46
- ArrayRef<const char *> Args, int64_t OSPid);
44
+ using OutputPair = std::pair<file_types::ID, std::string>;
47
45
48
- // / Emits a "finished" message to the given stream.
49
- void emitFinishedMessage (raw_ostream &os, const driver::Job &Cmd, int64_t Pid,
50
- int ExitStatus, StringRef Output,
51
- sys::TaskProcessInformation ProcInfo);
46
+ // / A client-agnostic (e.g. either the compiler driver or `swift-frontend`)
47
+ // / description of a task that is the subject of a parseable-output message.
48
+ struct DetailedTaskDescription {
49
+ std::string Executable;
50
+ SmallVector<std::string, 16 > Arguments;
51
+ std::string CommandLine;
52
+ SmallVector<CommandInput, 4 > Inputs;
53
+ SmallVector<OutputPair, 8 > Outputs;
54
+ };
55
+
56
+ // / Emits a "began" message to the given stream.
57
+ void emitBeganMessage (raw_ostream &os, StringRef Name,
58
+ DetailedTaskDescription TascDesc,
59
+ int64_t Pid, sys::TaskProcessInformation ProcInfo);
52
60
53
- // / Emits a "finished" message to the given stream corresponding to a given
54
- // / Frontend Compiler Invocation.
55
- void emitFinishedMessage (
56
- raw_ostream &os, const CompilerInvocation &Invocation, int ExitStatus,
57
- const llvm::StringMap<std::vector<std::string>> &FileSpecificDiagnostics,
58
- int64_t OSPid);
61
+ // / Emits a "finished" message to the given stream.
62
+ void emitFinishedMessage (raw_ostream &os, StringRef Name,
63
+ std::string Output, int ExitStatus,
64
+ int64_t Pid, sys::TaskProcessInformation ProcInfo);
59
65
60
66
// / Emits a "signalled" message to the given stream.
61
- void emitSignalledMessage (raw_ostream &os, const driver::Job &Cmd, int64_t Pid,
62
- StringRef ErrorMsg, StringRef Output,
63
- Optional<int > Signal,
64
- sys::TaskProcessInformation ProcInfo);
67
+ void emitSignalledMessage (raw_ostream &os, StringRef Name, StringRef ErrorMsg,
68
+ StringRef Output, Optional<int > Signal,
69
+ int64_t Pid, sys::TaskProcessInformation ProcInfo);
65
70
66
71
// / Emits a "skipped" message to the given stream.
67
- void emitSkippedMessage (raw_ostream &os, const driver::Job &Cmd);
72
+ void emitSkippedMessage (raw_ostream &os, StringRef Name,
73
+ DetailedTaskDescription TascDesc);
68
74
69
75
} // end namespace parseable_output
70
76
} // end namespace swift
0 commit comments