MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / VisitForStmt

Method VisitForStmt

CoroutinesCodeGenerator.cpp:198–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196 }
197
198 void VisitForStmt(ForStmt* stmt)
199 {
200 // technically because of the init the entire for loop should be put into a dedicated scope
201 Visit(stmt->getInit());
202
203 // Special case. A VarDecl in init will be added to the body of the function and the actual init is left
204 // untouched. Work some magic to put it in the right place.
205 if(mSkip) {
206 auto* oldInit = stmt->getInit();
207 auto* newInit = mBodyStmts.mStmts.back();
208 mBodyStmts.mStmts.pop_back();
209
210 ReplaceNode(stmt, oldInit, newInit);
211
212 mSkip = false;
213 }
214
215 Visit(stmt->getCond());
216
217 Visit(stmt->getInc());
218
219 CoroutineASTTransformer{mASTData, mSuspendsCount, stmt->getBody(), mVarNamePrefix, stmt};
220
221 mSkip = false;
222 }
223
224 void VisitCXXForRangeStmt(CXXForRangeStmt* stmt)
225 {

Callers

nothing calls this directly

Calls 1

ReplaceNodeFunction · 0.85

Tested by

no test coverage detected