mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-11 22:44:04 +00:00
Split Program into Program and ProgramBuilder
Program is now immutable*, and remains part of the public Tint interface. ProgramBuilder is the mutable builder for Programs, and is not part of the public Tint interface. ast::Builder has been folded into ProgramBuilder. Immutable Programs can be cloned into a mutable ProgramBuilder with Program::CloneAsBuilder(). Mutable ProgramBuilders can be moved into immutable Programs. * - mostly immutable. It still has a move constructor and move assignment operator - required for practical usage - and the semantic information on AST nodes is still mutable. Bug: tint:390 Change-Id: Ia856c50b1880c2f95c91467a9eef5024cbc380c6 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38240 Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "src/ast/call_expression.h"
|
||||
#include "src/ast/expression.h"
|
||||
#include "src/ast/identifier_expression.h"
|
||||
#include "src/ast/module.h"
|
||||
#include "src/ast/return_statement.h"
|
||||
#include "src/ast/statement.h"
|
||||
#include "src/ast/switch_statement.h"
|
||||
@@ -48,6 +49,9 @@ class ValidatorImpl {
|
||||
/// @returns true if the validation was successful
|
||||
bool Validate();
|
||||
|
||||
/// @returns the program being validated
|
||||
const Program* program() { return program_; }
|
||||
|
||||
/// @returns the diagnostic messages
|
||||
const diag::List& diagnostics() const { return diags_; }
|
||||
/// @returns the diagnostic messages
|
||||
|
||||
Reference in New Issue
Block a user