Add Symbol to Variable.

This CL adds a Symbol to the Variable AST node along side the name. The
name will be removed in a future CL.

Change-Id: I1c05e5595392b1c4a0afa82387d97b2b4472bade
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35881
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair
2020-12-16 21:42:30 +00:00
committed by Commit Bot service account
parent b5839939e1
commit a57f842be9
19 changed files with 242 additions and 242 deletions

View File

@@ -14,13 +14,14 @@
#include "src/scope_stack.h"
#include "gtest/gtest.h"
#include "src/ast/builder.h"
#include "src/ast/type/f32_type.h"
#include "src/ast/variable.h"
namespace tint {
namespace {
using ScopeStackTest = testing::Test;
class ScopeStackTest : public ast::BuilderWithModule, public testing::Test {};
TEST_F(ScopeStackTest, Global) {
ScopeStack<uint32_t> s;
@@ -32,12 +33,9 @@ TEST_F(ScopeStackTest, Global) {
}
TEST_F(ScopeStackTest, Global_SetWithPointer) {
ast::type::F32 f32;
ast::Variable v(Source{}, "my_var", ast::StorageClass::kNone, &f32, false,
nullptr, ast::VariableDecorationList{});
auto* v = Var("my_var", ast::StorageClass::kNone, ty.f32);
ScopeStack<ast::Variable*> s;
s.set_global("var", &v);
s.set_global("var", v);
ast::Variable* v2 = nullptr;
EXPECT_TRUE(s.get("var", &v2));