7 #ifndef RETDEC_LLVMIR2HLL_UTILS_LOOP_OPTIMIZER_H
8 #define RETDEC_LLVMIR2HLL_UTILS_LOOP_OPTIMIZER_H
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
ShPtr< Expression > getExitCondition(ShPtr< Statement > loopEnd)
Returns the exit condition from the given loop end.
Definition: loop_optimizer.cpp:95
ShPtr< SplittedWhileTrueLoop > splitWhileTrueLoop(ShPtr< WhileLoopStmt > stmt, ShPtr< IndVarInfo > indVarInfo=nullptr)
Splits the given "while True" loop stmt into three parts.
Definition: loop_optimizer.cpp:114
ShPtr< IndVarInfo > getIndVarInfo(ShPtr< WhileLoopStmt > stmt)
Returns information about the induction variable in the given "while true" loop.
Definition: loop_optimizer.cpp:174
bool isLoopEnd(ShPtr< Statement > stmt)
Returns true if stmt is the ending statement of a loop, false otherwise.
Definition: loop_optimizer.cpp:43
Definition: archive_wrapper.h:19
A visitor that visits everything in an ordered way.
Declarations, aliases, macros, etc. for the use of smart pointers.
Information about the induction variable of a "while true" loop.
Definition: loop_optimizer.h:59
ShPtr< Statement > updateStmt
Definition: loop_optimizer.h:85
ShPtr< Statement > initStmt
Definition: loop_optimizer.h:75
IndVarInfo(ShPtr< Statement > initStmt, ShPtr< Variable > indVar, ShPtr< Expression > exitCond, ShPtr< Statement > updateStmt, bool updateBeforeExit)
Definition: loop_optimizer.h:60
ShPtr< Expression > exitCond
Exit condition – corresponds to (2) in the class description.
Definition: loop_optimizer.h:81
ShPtr< Variable > indVar
Induction variable – corresponds to (1) in the class description.
Definition: loop_optimizer.h:78
bool updateBeforeExit
Is an update statement before exit condition?
Definition: loop_optimizer.h:88
A representation of a "while true" loop.
Definition: loop_optimizer.h:31
ShPtr< Statement > afterLoopEndStmts
Definition: loop_optimizer.h:41
ShPtr< IfStmt > loopEnd
The loop's end – corresponds to (2) in the class description.
Definition: loop_optimizer.h:37
ShPtr< Statement > beforeLoopEndStmts
Definition: loop_optimizer.h:34