@@ -105,7 +105,8 @@ struct ResponseFileSupport {
105
105
// / execute.
106
106
class Command {
107
107
public:
108
- using ErrorCodeDiagMapTy = llvm::DenseMap<int , std::pair<std::string, bool >>;
108
+ using ErrorCodeDiagMapTy = llvm::DenseMap<int , std::string>;
109
+ using ErrorCodeExitMapTy = llvm::DenseMap<int , bool >;
109
110
110
111
private:
111
112
// / Source - The action which caused the creation of this job.
@@ -122,8 +123,6 @@ class Command {
122
123
123
124
// / The container for custom driver-set diagnostic messages that are
124
125
// / produced upon particular error codes returned by the command.
125
- // / Given a custom diagnostic, also allow for logic to determine if the
126
- // / compilation should continue, even with a non-zero return code.
127
126
// / In order to add such a diagnostic for an external tool, consider the
128
127
// / following criteria:
129
128
// / 1) Does the command's executable return different codes upon different
@@ -134,6 +133,11 @@ class Command {
134
133
// / "invalid input" error can be ruled out
135
134
ErrorCodeDiagMapTy ErrorCodeDiagMap;
136
135
136
+ // / Similar to the container for the diagnostic messages, this container
137
+ // / is used to signify if the toolchain should error and exit right away
138
+ // / or if we should continue compilation.
139
+ ErrorCodeExitMapTy ErrorCodeExitMap;
140
+
137
141
// / The list of program arguments (not including the implicit first
138
142
// / argument, which will be the executable).
139
143
llvm::opt::ArgStringList Arguments;
@@ -198,17 +202,20 @@ class Command {
198
202
199
203
// / Store a custom driver diagnostic message and if the compilation should
200
204
// / exit upon a particular error code returned by the command
201
- void addDiagForErrorCode (int ErrorCode, StringRef CustomDiag,
202
- bool NoExit = false );
205
+ void addDiagForErrorCode (int ErrorCode, StringRef CustomDiag);
206
+
207
+ // / Store if the compilation should exit upon a particular error code
208
+ // / returned by the command
209
+ void addExitForErrorCode (int ErrorCode, bool Exit);
203
210
204
211
// / Get the custom driver diagnostic message for a particular error code
205
212
// / if such was stored. Returns an empty string if no diagnostic message
206
213
// / was found for the given error code.
207
214
StringRef getDiagForErrorCode (int ErrorCode) const ;
208
215
209
216
// / Will the tool exit when a particular error code is encountered. Returns
210
- // / false if not set (always exit)
211
- bool getWillNotExitForErrorCode (int ErrorCode) const ;
217
+ // / true if not set (always exit)
218
+ bool getWillExitForErrorCode (int ErrorCode) const ;
212
219
213
220
// / getSource - Return the Action which caused the creation of this job.
214
221
const Action &getSource () const { return Source; }
0 commit comments