Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
clang 20.0.0git
LoopUnrolling.h File Reference

This header contains the declarations of functions which are used to decide which loops should be completely unrolled and mark their corresponding CFGBlocks. More...

Go to the source code of this file.

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::ento
 

Functions

bool clang::ento::isUnrolledState (ProgramStateRef State)
 Returns if the given State indicates that is inside a completely unrolled loop.
 
ProgramStateRef clang::ento::updateLoopStack (const Stmt *LoopStmt, ASTContext &ASTCtx, ExplodedNode *Pred, unsigned maxVisitOnPath)
 Updates the stack of loops contained by the ProgramState.
 
ProgramStateRef clang::ento::processLoopEnd (const Stmt *LoopStmt, ProgramStateRef State)
 Updates the given ProgramState.
 

Detailed Description

This header contains the declarations of functions which are used to decide which loops should be completely unrolled and mark their corresponding CFGBlocks.

It is done by tracking a stack of loops in the ProgramState. This way specific loops can be marked as completely unrolled. For considering a loop to be completely unrolled it has to fulfill the following requirements:

  • Currently only forStmts can be considered.
  • The bound has to be known.
  • The counter variable has not escaped before/in the body of the loop and changed only in the increment statement corresponding to the loop. It also has to be initialized by a literal in the corresponding initStmt.
  • Does not contain goto, switch and returnStmt.

Definition in file LoopUnrolling.h.