|
| template<class... T> |
| | SymbolTable (T &&...args) |
| |
| const std::unordered_set< std::string > & | names () const override |
| |
| const std::unordered_map< std::string, VarDef > & | defs () const override |
| |
| const std::unordered_map< std::string, For > & | loops () const override |
| |
| bool | hasDef (const std::string &name) const override |
| |
| const VarDef & | def (const std::string &name) const override |
| |
| Ref< Buffer > | buffer (const std::string &name) const override |
| |
| bool | hasLoop (const std::string &name) const override |
| |
| const For & | loop (const std::string &name) const override |
| |
| void | pushDef (const VarDef &op) override |
| |
| void | popDef (const VarDef &op) override |
| |
| void | pushFor (const For &op) override |
| |
| void | popFor (const For &op) override |
| |
| const SymbolTableData & | symbolTableSnapshot () const |
| |
| virtual const std::unordered_set< std::string > & | names () const =0 |
| |
| virtual const std::unordered_map< std::string, VarDef > & | defs () const =0 |
| |
| virtual const std::unordered_map< std::string, For > & | loops () const =0 |
| |
| virtual bool | hasDef (const std::string &name) const =0 |
| |
| virtual const VarDef & | def (const std::string &name) const =0 |
| |
| virtual Ref< Buffer > | buffer (const std::string &name) const =0 |
| |
| virtual bool | hasLoop (const std::string &name) const =0 |
| |
| virtual const For & | loop (const std::string &name) const =0 |
| |
| virtual void | pushDef (const VarDef &op)=0 |
| |
| virtual void | popDef (const VarDef &op)=0 |
| |
| virtual void | pushFor (const For &op)=0 |
| |
| virtual void | popFor (const For &op)=0 |
| |
template<class BaseClass>
class freetensor::SymbolTable< BaseClass >
A symbol table context for Visitor or Mutator
Inherit this class to use. E.g., inherit SymbolTable<Visitor> or SymbolTable<Mutator>
This class will automatically maintains the symbol table if the sub-class calls visit(VarDef), which is the suggested usage
However, in some cases, this is impossible, e.g., when the sub-class needs to recurse into different sub-trees manually. In these cases, the sub-class should explicitly call the pushDef / popDef or pushFor / popFor methods