[PATCH] D41151: [analyzer] Adding LoopContext and improve loop modeling
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 21 15:31:51 PST 2017
NoQ added a comment.
So, essentially, `LoopContext` is per-loop, while `ScopeContext` is per-iteration?
================
Comment at: lib/StaticAnalyzer/Core/LoopUnrolling.cpp:28-46
struct LoopState {
private:
enum Kind { Normal, Unrolled } K;
- const Stmt *LoopStmt;
- const LocationContext *LCtx;
- unsigned maxStep;
- LoopState(Kind InK, const Stmt *S, const LocationContext *L, unsigned N)
- : K(InK), LoopStmt(S), LCtx(L), maxStep(N) {}
+ unsigned MaxStep;
+ LoopState(Kind InK, unsigned N) : K(InK), MaxStep(N) {}
public:
----------------
Should the whole `LoopState` be reduced to a field(s) in `LoopContext`? It seems to make sense to me, unless we're planning to modify it in the middle of the loop.
https://reviews.llvm.org/D41151
More information about the cfe-commits
mailing list