mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-11 22:44:04 +00:00
[validation] impl v-0015: runtime array may only appear last
This CL adds checks to verify that runtime arrays only appear as the last element of a struct Bug: tint:345 Change-Id: Ic2930aaf1e24e5c1d116add3a4a6dbdb9eaa02a7 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33261 Reviewed-by: dan sinclair <dsinclair@chromium.org> Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
3ea3c997b5
commit
d8ea65bb2c
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "src/ast/assignment_statement.h"
|
||||
#include "src/ast/call_expression.h"
|
||||
@@ -118,6 +119,12 @@ class ValidatorImpl {
|
||||
/// @returns true if the valdiation was successful
|
||||
bool ValidateEntryPoint(const ast::FunctionList& funcs);
|
||||
|
||||
/// Validates constructed types
|
||||
/// @param constructed_types the types to check
|
||||
/// @returns true if the valdiation was successful
|
||||
bool ValidateConstructedTypes(
|
||||
const std::vector<ast::type::Type*>& constructed_types);
|
||||
|
||||
private:
|
||||
std::string error_;
|
||||
ScopeStack<ast::Variable*> variable_stack_;
|
||||
|
||||
Reference in New Issue
Block a user