tint: Chromium-style fixes

Required to roll Dawn -> Tint

Bug: dawn:1405
Change-Id: If60fe0bffe0052916ecb5e5b241f97aaaa43af46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88840
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2022-05-04 13:58:49 +00:00 committed by Dawn LUCI CQ
parent b3aab09652
commit e55877d017
5 changed files with 12 additions and 5 deletions

View File

@ -45,7 +45,7 @@ const IfStatement* IfStatement::Clone(CloneContext* ctx) const {
auto src = ctx->Clone(source);
auto* cond = ctx->Clone(condition);
auto* b = ctx->Clone(body);
auto el = ctx->Clone(else_statement);
auto* el = ctx->Clone(else_statement);
return ctx->dst->create<IfStatement>(src, cond, b, el);
}

View File

@ -140,7 +140,7 @@ using LineCommentTerminatorTest = testing::TestWithParam<const char*>;
TEST_P(LineCommentTerminatorTest, Terminators) {
// Test that line comments are ended by blankspace characters other than
// space, horizontal tab, left-to-right mark, and right-to-left mark.
auto c = GetParam();
auto* c = GetParam();
std::string src = "let// This is a comment";
src += c;
src += "ident";

View File

@ -31,7 +31,7 @@ TEST_F(EnableDirectiveTest, Valid) {
EXPECT_EQ(ast.Extensions(),
ast::ExtensionSet{ast::Enable::ExtensionKind::kInternalExtensionForTesting});
EXPECT_EQ(ast.GlobalDeclarations().size(), 1u);
auto node = ast.GlobalDeclarations()[0]->As<ast::Enable>();
auto* node = ast.GlobalDeclarations()[0]->As<ast::Enable>();
EXPECT_TRUE(node != nullptr);
EXPECT_EQ(node->name, "InternalExtensionForTesting");
EXPECT_EQ(node->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);
@ -50,11 +50,11 @@ enable InternalExtensionForTesting;
EXPECT_EQ(ast.Extensions(),
ast::ExtensionSet{ast::Enable::ExtensionKind::kInternalExtensionForTesting});
EXPECT_EQ(ast.GlobalDeclarations().size(), 2u);
auto node1 = ast.GlobalDeclarations()[0]->As<ast::Enable>();
auto* node1 = ast.GlobalDeclarations()[0]->As<ast::Enable>();
EXPECT_TRUE(node1 != nullptr);
EXPECT_EQ(node1->name, "InternalExtensionForTesting");
EXPECT_EQ(node1->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);
auto node2 = ast.GlobalDeclarations()[1]->As<ast::Enable>();
auto* node2 = ast.GlobalDeclarations()[1]->As<ast::Enable>();
EXPECT_TRUE(node2 != nullptr);
EXPECT_EQ(node2->name, "InternalExtensionForTesting");
EXPECT_EQ(node2->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);

View File

@ -4143,4 +4143,8 @@ Builder::Backedge::Backedge(const Builder::Backedge& other) = default;
Builder::Backedge& Builder::Backedge::operator=(const Builder::Backedge& other) = default;
Builder::Backedge::~Backedge() = default;
Builder::Scope::Scope() = default;
Builder::Scope::Scope(const Scope&) = default;
Builder::Scope::~Scope() = default;
} // namespace tint::writer::spirv

View File

@ -602,6 +602,9 @@ class Builder {
// Scope holds per-block information
struct Scope {
Scope();
Scope(const Scope&);
~Scope();
std::unordered_map<OperandListKey, uint32_t> type_ctor_to_id_;
};