1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

[Tolk] Refactor: get rid of split_vars, construct valid LET ops

In FunC (and in Tolk before), tensor vars (actually occupying
several stack slots) were represented as a single var in terms
or IR vars (Ops):
> var a = (1, 2);
> LET (_i) = (_1, _2)

Now, every tensor of N stack slots is represented as N IR vars.
> LET (_i, _j) = (_1, _2)

This will give an ability to control access to parts of a tensor
when implementing `tensorVar.0` syntax.
This commit is contained in:
tolk-vm 2024-12-18 19:26:26 +03:00
parent 989629a832
commit 565bc59735
No known key found for this signature in database
GPG key ID: 7905DD7FE0324B12
17 changed files with 100 additions and 217 deletions

View file

@ -97,10 +97,6 @@ public:
virtual int calc_width_on_stack() const {
return 1;
}
virtual void extract_components(std::vector<TypePtr>& comp_types) const {
comp_types.push_back(this);
}
};
/*
@ -291,7 +287,6 @@ public:
bool can_rhs_be_assigned(TypePtr rhs) const override;
bool can_be_casted_with_as_operator(TypePtr cast_to) const override;
int calc_width_on_stack() const override;
void extract_components(std::vector<TypePtr>& comp_types) const override;
};
/*
@ -318,7 +313,6 @@ public:
void traverse(const TraverserCallbackT& callback) const override;
TypePtr replace_children_custom(const ReplacerCallbackT& callback) const override;
int calc_width_on_stack() const override;
void extract_components(std::vector<TypePtr>& comp_types) const override;
};
/*
@ -387,7 +381,6 @@ public:
bool can_rhs_be_assigned(TypePtr rhs) const override;
bool can_be_casted_with_as_operator(TypePtr cast_to) const override;
int calc_width_on_stack() const override;
void extract_components(std::vector<TypePtr>& comp_types) const override;
};
/*
@ -408,7 +401,6 @@ public:
bool can_rhs_be_assigned(TypePtr rhs) const override;
bool can_be_casted_with_as_operator(TypePtr cast_to) const override;
int calc_width_on_stack() const override;
void extract_components(std::vector<TypePtr>& comp_types) const override;
};