Skip to content

Commit

Permalink
Make diagnostic verification work after the redesign of #488.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattmccutchen-cci committed Jun 14, 2021
1 parent cdb7805 commit 54924ac
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 122 deletions.
19 changes: 18 additions & 1 deletion clang/include/clang/3C/3C.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class _3CInterface {
const std::vector<std::string> &SourceFileList,
clang::tooling::CompilationDatabase *CompDB);

~_3CInterface();

// Call clang to provide the data
bool parseASTs();

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

// Determine the exit code that the `3c` tool should exit with after the last
// 3C stage, considering diagnostic verification. Must be called exactly once
// before the _3CInterface is destructed (unless construction failed).
int determineExitCode();

private:
_3CInterface(const struct _3COptions &CCopt,
const std::vector<std::string> &SourceFileList,
clang::tooling::CompilationDatabase *CompDB, bool &Failed);
clang::tooling::CompilationDatabase *CompDB);

bool ConstructionFailed = false;
bool DeterminedExitCode = false;

bool HadNonDiagnosticError = false;

// Determine whether 3C can continue to the next stage of processing. Checks
// HadNonDiagnosticError and error diagnostics but ignores diagnostic
// verification.
bool isSuccessfulSoFar();

// saved ASTs
std::vector< std::unique_ptr< ASTUnit >> ASTs;
Expand Down
Loading

0 comments on commit 54924ac

Please sign in to comment.