Add ProgramID feed it into all ast::Nodes

This will be used to detect accidental leaks of program objects between programs.

Bug: tint:709
Change-Id: I20f784a2c673d19a04a880b3ec91dfe2eb743bdb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/47622
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton
2021-04-13 23:27:27 +00:00
committed by Commit Bot service account
parent f01ed13a25
commit e6995de232
126 changed files with 589 additions and 233 deletions

View File

@@ -367,7 +367,7 @@ inline std::ostream& operator<<(std::ostream& o, const DefInfo& di) {
class StatementBuilder : public Castable<StatementBuilder, ast::Statement> {
public:
/// Constructor
StatementBuilder() : Base(Source{}) {}
StatementBuilder() : Base(ProgramID(), Source{}) {}
/// @param builder the program builder
/// @returns the build AST node

View File

@@ -32,8 +32,8 @@ class ForStmtTest : public ParserImplTest {
EXPECT_FALSE(e_for.errored);
EXPECT_FALSE(p_for->has_error()) << p_for->error();
std::string loop = ast::BlockStatement({}, e_loop.value).str(Sem());
std::string for_ = ast::BlockStatement({}, e_for.value).str(Sem());
std::string loop = ast::BlockStatement({}, {}, e_loop.value).str(Sem());
std::string for_ = ast::BlockStatement({}, {}, e_for.value).str(Sem());
EXPECT_EQ(loop, for_);
}
};