mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 05:57:51 +00:00
Add diag::List::add_error() helper
Refactors a common pattern in the tint codebase. Change-Id: Ia8a70d952fd8c204facd0120f24e43ccc9305622 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38840 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
a6b9a8eb2f
commit
1461cd96d6
@@ -58,11 +58,7 @@ void ValidatorImpl::add_error(const Source& src,
|
||||
}
|
||||
|
||||
void ValidatorImpl::add_error(const Source& src, const std::string& msg) {
|
||||
diag::Diagnostic diag;
|
||||
diag.severity = diag::Severity::Error;
|
||||
diag.source = src;
|
||||
diag.message = msg;
|
||||
diags_.add(std::move(diag));
|
||||
diags_.add_error(msg, src);
|
||||
}
|
||||
|
||||
bool ValidatorImpl::Validate() {
|
||||
|
||||
Reference in New Issue
Block a user