Have tint executable use the diagnostic printer

Will now print with better formatting and colors on terminals that support it.

Bug: tint:282
Change-Id: Ibff341cb1dc2dcbda6fa0d72e24fdcb172990138
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31570
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2020-11-03 13:15:19 +00:00
committed by Commit Bot service account
parent ecea5c8aec
commit d59a5da9e5
7 changed files with 58 additions and 13 deletions

View File

@@ -19,7 +19,13 @@ namespace diag {
List::List() = default;
List::List(std::initializer_list<Diagnostic> list) : entries_(list) {}
List::List(const List&) = default;
List::List(List&&) = default;
List::~List() = default;
List& List::operator=(const List&) = default;
List& List::operator=(List&&) = default;
} // namespace diag
} // namespace tint

View File

@@ -54,12 +54,30 @@ class List {
/// Constructs the list with no elements.
List();
/// Constructs the list with a copy of the diagnostics in |list|.
/// Copy constructor. Copies the diagnostics from |list| into this list.
/// @param list the list of diagnostics to copy into this list.
List(std::initializer_list<Diagnostic> list);
/// Copy constructor. Copies the diagnostics from |list| into this list.
/// @param list the list of diagnostics to copy into this list.
List(const List& list);
/// Move constructor. Moves the diagnostics from |list| into this list.
/// @param list the list of diagnostics to move into this list.
List(List&& list);
~List();
/// Assignment operator. Copies the diagnostics from |list| into this list.
/// @param list the list to copy into this list.
/// @return this list.
List& operator=(const List& list);
/// Assignment move operator. Moves the diagnostics from |list| into this
/// list.
/// @param list the list to move into this list.
/// @return this list.
List& operator=(List&& list);
/// adds a diagnostic to the end of this list.
/// @param diag the diagnostic to append to this list.
void add(Diagnostic&& diag) {