tipc
A TIP to LLVM compiler
TypeVars.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "TipTypeVisitor.h"
4 #include <set>
5 
8 class TypeVars : public TipTypeVisitor {
9  std::set<std::shared_ptr<TipVar>> vars;
10 
11 public:
12  TypeVars() = default;
13 
19  static std::set<std::shared_ptr<TipVar>> collect(TipType *t);
20 
21  std::set<std::shared_ptr<TipVar>> getVars() { return vars; }
22 
23  virtual void endVisit(TipMu *element) override;
24  virtual void endVisit(TipAlpha *element) override;
25  virtual void endVisit(TipVar *element) override;
26 };
Class for free type variables.
Definition: TipAlpha.h:10
Class representing a recursive type.
Definition: TipMu.h:12
Base class for TIP type visitors.
Definition: TipTypeVisitor.h:24
Abstract base class of all types.
Definition: TipType.h:19
Class representing a type variable.
Definition: TipVar.h:13
Produces set of type variables in a type expression.
Definition: TypeVars.h:8
std::set< std::shared_ptr< TipVar > > getVars()
Definition: TypeVars.h:21
virtual void endVisit(TipMu *element) override
Definition: TypeVars.cpp:9
TypeVars()=default
static std::set< std::shared_ptr< TipVar > > collect(TipType *t)
Collect the set of type variables in a type expression.
Definition: TypeVars.cpp:3