mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
reader/wgsl: Abort after raising too many errors
Change-Id: I641ee8c2e34e059a02742d06c24f96acecb39cd3 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33720 Commit-Queue: David Neto <dneto@google.com> Reviewed-by: David Neto <dneto@google.com> Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
c489875ff0
commit
1e87fe5517
@@ -83,13 +83,15 @@ class List {
|
||||
void add(Diagnostic&& diag) {
|
||||
entries_.emplace_back(std::move(diag));
|
||||
if (diag.severity >= Severity::Error) {
|
||||
contains_errors_ = true;
|
||||
error_count_++;
|
||||
}
|
||||
}
|
||||
|
||||
/// @returns true iff the diagnostic list contains errors diagnostics (or of
|
||||
/// higher severity).
|
||||
bool contains_errors() const { return contains_errors_; }
|
||||
bool contains_errors() const { return error_count_ > 0; }
|
||||
/// @returns the number of error diagnostics (or of higher severity).
|
||||
size_t error_count() const { return error_count_; }
|
||||
/// @returns the number of entries in the list.
|
||||
size_t count() const { return entries_.size(); }
|
||||
/// @returns the first diagnostic in the list.
|
||||
@@ -99,7 +101,7 @@ class List {
|
||||
|
||||
private:
|
||||
std::vector<Diagnostic> entries_;
|
||||
bool contains_errors_ = false;
|
||||
size_t error_count_ = 0;
|
||||
};
|
||||
|
||||
} // namespace diag
|
||||
|
||||
Reference in New Issue
Block a user