User Guide
nmodl::visitor::DUChain Class Reference

Def-Use chain for an AST node. More...

Detailed Description

Def-Use chain for an AST node.

Definition at line 131 of file defuse_analyze_visitor.hpp.

#include <defuse_analyze_visitor.hpp>

Public Member Functions

 DUChain ()=default
 
 DUChain (std::string name, DUVariableType type)
 
DUState eval () const
 return "effective" usage of a variable More...
 
std::string to_string (bool compact=true) const
 return json representation More...
 

Public Attributes

std::string name
 name of the node More...
 
DUVariableType variable_type
 type of variable More...
 
std::vector< DUInstancechain
 def-use chain for a variable More...
 

Constructor & Destructor Documentation

◆ DUChain() [1/2]

nmodl::visitor::DUChain::DUChain ( )
default

◆ DUChain() [2/2]

nmodl::visitor::DUChain::DUChain ( std::string  name,
DUVariableType  type 
)
inline

Definition at line 143 of file defuse_analyze_visitor.hpp.

Member Function Documentation

◆ eval()

DUState nmodl::visitor::DUChain::eval ( ) const

return "effective" usage of a variable

first usage of a variable in a block decides whether it's definition or usage.

Note that if-else blocks already evaluated.

Definition at line 177 of file defuse_analyze_visitor.cpp.

◆ to_string()

std::string nmodl::visitor::DUChain::to_string ( bool  compact = true) const

return json representation

DUChain to JSON string.

Definition at line 70 of file defuse_analyze_visitor.cpp.

Member Data Documentation

◆ chain

std::vector<DUInstance> nmodl::visitor::DUChain::chain

def-use chain for a variable

Definition at line 140 of file defuse_analyze_visitor.hpp.

◆ name

std::string nmodl::visitor::DUChain::name

name of the node

Definition at line 134 of file defuse_analyze_visitor.hpp.

◆ variable_type

DUVariableType nmodl::visitor::DUChain::variable_type

type of variable

Definition at line 137 of file defuse_analyze_visitor.hpp.


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