Skip to content

Commit 54924ac

Browse files
Make diagnostic verification work after the redesign of #488.
Re-enable diagnostic verification in regression tests where it still succeeds. It remains disabled in some tests in which failures were introduced while it was disabled; #609 is for that. Fixes #503.
1 parent cdb7805 commit 54924ac

13 files changed

+222
-122
lines changed

clang/include/clang/3C/3C.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class _3CInterface {
9999
const std::vector<std::string> &SourceFileList,
100100
clang::tooling::CompilationDatabase *CompDB);
101101

102+
~_3CInterface();
103+
102104
// Call clang to provide the data
103105
bool parseASTs();
104106

@@ -136,10 +138,25 @@ class _3CInterface {
136138
// Dump all stats related to performance.
137139
bool dumpStats();
138140

141+
// Determine the exit code that the `3c` tool should exit with after the last
142+
// 3C stage, considering diagnostic verification. Must be called exactly once
143+
// before the _3CInterface is destructed (unless construction failed).
144+
int determineExitCode();
145+
139146
private:
140147
_3CInterface(const struct _3COptions &CCopt,
141148
const std::vector<std::string> &SourceFileList,
142-
clang::tooling::CompilationDatabase *CompDB, bool &Failed);
149+
clang::tooling::CompilationDatabase *CompDB);
150+
151+
bool ConstructionFailed = false;
152+
bool DeterminedExitCode = false;
153+
154+
bool HadNonDiagnosticError = false;
155+
156+
// Determine whether 3C can continue to the next stage of processing. Checks
157+
// HadNonDiagnosticError and error diagnostics but ignores diagnostic
158+
// verification.
159+
bool isSuccessfulSoFar();
143160

144161
// saved ASTs
145162
std::vector< std::unique_ptr< ASTUnit >> ASTs;

0 commit comments

Comments
 (0)