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

Performs control flow analyses with the help of AST and Symbol table of a program Provides helper functions to support call graph generation, Overrides several ASTVisitor's methods that visit ASTFunction, ASTFunAppExpr, and ASTAssignStmt nodes to generate constraints Generated constraints are solved by the cubic solver. More...

#include <CFAnalyzer.h>

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

Public Member Functions

bool visit (ASTFunction *element) override
 
bool visit (ASTFunAppExpr *element) override
 
bool visit (ASTAssignStmt *element) override
 
void endVisit (ASTFunction *element) override
 
std::vector< ASTFunction * > getPossibleFunctionsForExpr (ASTNode *n, ASTFunction *f)
 

Static Public Member Functions

static CFAnalyzer analyze (ASTProgram *p, SymbolTable *st)
 analyzes the AST and symbol table for a given program. Generates control flow constraints. More...
 

Detailed Description

Performs control flow analyses with the help of AST and Symbol table of a program Provides helper functions to support call graph generation, Overrides several ASTVisitor's methods that visit ASTFunction, ASTFunAppExpr, and ASTAssignStmt nodes to generate constraints Generated constraints are solved by the cubic solver.

Member Function Documentation

◆ analyze()

CFAnalyzer CFAnalyzer::analyze ( ASTProgram p,
SymbolTable st 
)
static

analyzes the AST and symbol table for a given program. Generates control flow constraints.

Parameters
TheAST of the program
stThe symbol table of a given program
Returns
the CFAnalyzer for subsequent use for the CallGraphBuilder

◆ endVisit()

void CFAnalyzer::endVisit ( ASTFunction element)
overridevirtual

Reimplemented from ASTVisitor.

◆ getPossibleFunctionsForExpr()

std::vector< ASTFunction * > CFAnalyzer::getPossibleFunctionsForExpr ( ASTNode n,
ASTFunction f 
)

◆ visit() [1/3]

bool CFAnalyzer::visit ( ASTAssignStmt element)
overridevirtual

Reimplemented from ASTVisitor.

◆ visit() [2/3]

bool CFAnalyzer::visit ( ASTFunAppExpr element)
overridevirtual

Reimplemented from ASTVisitor.

◆ visit() [3/3]

bool CFAnalyzer::visit ( ASTFunction element)
overridevirtual

Reimplemented from ASTVisitor.


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