tipc
A TIP to LLVM compiler
AbsentFieldChecker.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ASTVisitor.h"
4 #include "Unifier.h"
5 
19  Unifier *unifier;
20 
21 public:
22  AbsentFieldChecker(Unifier *u) : unifier(u) {}
23 
31  static void check(ASTProgram *p, Unifier *u);
32 
33  void endVisit(ASTAccessExpr *element) override;
34 };
Class for a record field access.
Definition: ASTAccessExpr.h:7
Class for a program which is a name and a list of functions.
Definition: ASTProgram.h:11
Base class for AST visitors.
Definition: ASTVisitor.h:23
Visits AST and checks that all field accesses are to defined fields.
Definition: AbsentFieldChecker.h:18
AbsentFieldChecker(Unifier *u)
Definition: AbsentFieldChecker.h:22
static void check(ASTProgram *p, Unifier *u)
Generate and check absent field constraints and report any errors.
Definition: AbsentFieldChecker.cpp:8
void endVisit(ASTAccessExpr *element) override
Check that the accessed field is defined somewhere in the program.
Definition: AbsentFieldChecker.cpp:19
Class used to solve type constraints and establish typability.
Definition: Unifier.h:19