tipc
A TIP to LLVM compiler
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
FreshAlphaCopier Class Reference

Makes a copy of a TipType with fresh alphas for the given ASTnode. More...

#include <FreshAlphaCopier.h>

Inheritance diagram for FreshAlphaCopier:
Inheritance graph
[legend]
Collaboration diagram for FreshAlphaCopier:
Collaboration graph
[legend]

Public Member Functions

 FreshAlphaCopier ()=default
 
virtual void endVisit (TipAlpha *element) override
 
- Public Member Functions inherited from Copier
 Copier ()=default
 
virtual void endVisit (TipVar *element) override
 Substitute if variable is the target. More...
 
- Public Member Functions inherited from Substituter
 Substituter (TipVar *t, std::shared_ptr< TipType > s)
 
std::shared_ptr< TipTypegetResult ()
 
virtual void endVisit (TipFunction *element) override
 
virtual void endVisit (TipInt *element) override
 
virtual void endVisit (TipMu *element) override
 
virtual void endVisit (TipRecord *element) override
 
virtual void endVisit (TipAbsentField *element) override
 
virtual void endVisit (TipRef *element) override
 
- Public Member Functions inherited from TipTypeVisitor
virtual bool visit (TipAlpha *element)
 
virtual bool visit (TipFunction *element)
 
virtual bool visit (TipInt *element)
 
virtual bool visit (TipMu *element)
 
virtual bool visit (TipRecord *element)
 
virtual bool visit (TipAbsentField *element)
 
virtual bool visit (TipRef *element)
 
virtual bool visit (TipVar *element)
 

Static Public Member Functions

static std::shared_ptr< TipTypecopy (TipType *t, ASTNode *context)
 
- Static Public Member Functions inherited from Copier
static std::shared_ptr< TipTypecopy (std::shared_ptr< TipType > s)
 
- Static Public Member Functions inherited from Substituter
static std::shared_ptr< TipTypesubstitute (TipType *t, TipVar *v, std::shared_ptr< TipType > s)
 Substitute for instances of variable in a target type. More...
 

Public Attributes

ASTNodecontext
 

Additional Inherited Members

- Protected Member Functions inherited from Substituter
 Substituter ()=default
 
- Protected Attributes inherited from Substituter
std::vector< std::shared_ptr< TipType > > visitedTypes
 

Detailed Description

Makes a copy of a TipType with fresh alphas for the given ASTnode.

This subtype of the Copier overrides the behavior for TipAlpha to just create a context-specific version of the alpha.

Constructor & Destructor Documentation

◆ FreshAlphaCopier()

FreshAlphaCopier::FreshAlphaCopier ( )
default

Member Function Documentation

◆ copy()

std::shared_ptr< TipType > FreshAlphaCopier::copy ( TipType t,
ASTNode context 
)
static

Copy the type replacing all alpha nodes with context-specific alphas

◆ endVisit()

void FreshAlphaCopier::endVisit ( TipAlpha element)
overridevirtual

Reimplemented from Copier.

Member Data Documentation

◆ context

ASTNode* FreshAlphaCopier::context

The documentation for this class was generated from the following files: