mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
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:
parent
b3aab09652
commit
e55877d017
@ -45,7 +45,7 @@ const IfStatement* IfStatement::Clone(CloneContext* ctx) const {
|
|||||||
auto src = ctx->Clone(source);
|
auto src = ctx->Clone(source);
|
||||||
auto* cond = ctx->Clone(condition);
|
auto* cond = ctx->Clone(condition);
|
||||||
auto* b = ctx->Clone(body);
|
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);
|
return ctx->dst->create<IfStatement>(src, cond, b, el);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ using LineCommentTerminatorTest = testing::TestWithParam<const char*>;
|
|||||||
TEST_P(LineCommentTerminatorTest, Terminators) {
|
TEST_P(LineCommentTerminatorTest, Terminators) {
|
||||||
// Test that line comments are ended by blankspace characters other than
|
// Test that line comments are ended by blankspace characters other than
|
||||||
// space, horizontal tab, left-to-right mark, and right-to-left mark.
|
// 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";
|
std::string src = "let// This is a comment";
|
||||||
src += c;
|
src += c;
|
||||||
src += "ident";
|
src += "ident";
|
||||||
|
@ -31,7 +31,7 @@ TEST_F(EnableDirectiveTest, Valid) {
|
|||||||
EXPECT_EQ(ast.Extensions(),
|
EXPECT_EQ(ast.Extensions(),
|
||||||
ast::ExtensionSet{ast::Enable::ExtensionKind::kInternalExtensionForTesting});
|
ast::ExtensionSet{ast::Enable::ExtensionKind::kInternalExtensionForTesting});
|
||||||
EXPECT_EQ(ast.GlobalDeclarations().size(), 1u);
|
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_TRUE(node != nullptr);
|
||||||
EXPECT_EQ(node->name, "InternalExtensionForTesting");
|
EXPECT_EQ(node->name, "InternalExtensionForTesting");
|
||||||
EXPECT_EQ(node->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);
|
EXPECT_EQ(node->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);
|
||||||
@ -50,11 +50,11 @@ enable InternalExtensionForTesting;
|
|||||||
EXPECT_EQ(ast.Extensions(),
|
EXPECT_EQ(ast.Extensions(),
|
||||||
ast::ExtensionSet{ast::Enable::ExtensionKind::kInternalExtensionForTesting});
|
ast::ExtensionSet{ast::Enable::ExtensionKind::kInternalExtensionForTesting});
|
||||||
EXPECT_EQ(ast.GlobalDeclarations().size(), 2u);
|
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_TRUE(node1 != nullptr);
|
||||||
EXPECT_EQ(node1->name, "InternalExtensionForTesting");
|
EXPECT_EQ(node1->name, "InternalExtensionForTesting");
|
||||||
EXPECT_EQ(node1->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);
|
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_TRUE(node2 != nullptr);
|
||||||
EXPECT_EQ(node2->name, "InternalExtensionForTesting");
|
EXPECT_EQ(node2->name, "InternalExtensionForTesting");
|
||||||
EXPECT_EQ(node2->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);
|
EXPECT_EQ(node2->kind, ast::Enable::ExtensionKind::kInternalExtensionForTesting);
|
||||||
|
@ -4143,4 +4143,8 @@ Builder::Backedge::Backedge(const Builder::Backedge& other) = default;
|
|||||||
Builder::Backedge& Builder::Backedge::operator=(const Builder::Backedge& other) = default;
|
Builder::Backedge& Builder::Backedge::operator=(const Builder::Backedge& other) = default;
|
||||||
Builder::Backedge::~Backedge() = default;
|
Builder::Backedge::~Backedge() = default;
|
||||||
|
|
||||||
|
Builder::Scope::Scope() = default;
|
||||||
|
Builder::Scope::Scope(const Scope&) = default;
|
||||||
|
Builder::Scope::~Scope() = default;
|
||||||
|
|
||||||
} // namespace tint::writer::spirv
|
} // namespace tint::writer::spirv
|
||||||
|
@ -602,6 +602,9 @@ class Builder {
|
|||||||
|
|
||||||
// Scope holds per-block information
|
// Scope holds per-block information
|
||||||
struct Scope {
|
struct Scope {
|
||||||
|
Scope();
|
||||||
|
Scope(const Scope&);
|
||||||
|
~Scope();
|
||||||
std::unordered_map<OperandListKey, uint32_t> type_ctor_to_id_;
|
std::unordered_map<OperandListKey, uint32_t> type_ctor_to_id_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user