retdec
Public Member Functions | Public Attributes | List of all members
retdec::llvmir2hll::IndVarInfo Struct Reference

Information about the induction variable of a "while true" loop. More...

#include <loop_optimizer.h>

Public Member Functions

 IndVarInfo (ShPtr< Statement > initStmt, ShPtr< Variable > indVar, ShPtr< Expression > exitCond, ShPtr< Statement > updateStmt, bool updateBeforeExit)
 

Public Attributes

ShPtr< StatementinitStmt
 
ShPtr< VariableindVar
 Induction variable – corresponds to (1) in the class description. More...
 
ShPtr< ExpressionexitCond
 Exit condition – corresponds to (2) in the class description. More...
 
ShPtr< StatementupdateStmt
 
bool updateBeforeExit
 Is an update statement before exit condition? More...
 

Detailed Description

Information about the induction variable of a "while true" loop.

Consider a "while true" loop that can be optimized into a for loop:

...
i = 0 // (1)
...
while True:
...
if cond: // (2)
break or return
i = i + 1 // (3)

Constructor & Destructor Documentation

◆ IndVarInfo()

retdec::llvmir2hll::IndVarInfo::IndVarInfo ( ShPtr< Statement initStmt,
ShPtr< Variable indVar,
ShPtr< Expression exitCond,
ShPtr< Statement updateStmt,
bool  updateBeforeExit 
)
inline

Member Data Documentation

◆ exitCond

ShPtr<Expression> retdec::llvmir2hll::IndVarInfo::exitCond

Exit condition – corresponds to (2) in the class description.

◆ indVar

ShPtr<Variable> retdec::llvmir2hll::IndVarInfo::indVar

Induction variable – corresponds to (1) in the class description.

◆ initStmt

ShPtr<Statement> retdec::llvmir2hll::IndVarInfo::initStmt

Initialization of the induction variable (either a definition or an assignment) – corresponds to (1) in the class description.

◆ updateBeforeExit

bool retdec::llvmir2hll::IndVarInfo::updateBeforeExit

Is an update statement before exit condition?

◆ updateStmt

ShPtr<Statement> retdec::llvmir2hll::IndVarInfo::updateStmt

Update of the induction variable – corresponds to (3) in the class description.


The documentation for this struct was generated from the following file: