Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Misc] Refactored flattend_values() to avoid potential conflicts in flattened statements #6749

Merged
merged 8 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion taichi/analysis/gen_offline_cache_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ class ASTSerializer : public IRVisitor, public ExpressionVisitor {
emit(expr.const_value);
emit(expr.atomic);
auto *e = expr.expr.get();
emit(e->stmt);
emit(e->get_flattened_stmt());
emit(e->attributes);
emit(e->ret_type);
expr.expr->accept(this);
Expand Down
8 changes: 7 additions & 1 deletion taichi/ir/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ class ExpressionVisitor;

// always a tree - used as rvalues
class Expression {
public:
protected:
Stmt *stmt;

public:
std::string tb;
std::map<std::string, std::string> attributes;
DataType ret_type;
Expand Down Expand Up @@ -53,6 +55,10 @@ class Expression {

virtual ~Expression() {
}

Stmt *get_flattened_stmt() const {
return stmt;
}
};

class ExprGroup {
Expand Down
Loading