mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
IR construction was missing support for C++ 11 range-based `for` loops. The extractor generates ASTs for the compiler-generated implementation already, so I had enough information to generate IR. I've expanded on some of the predicates in `RangeBasedForStmt` to access the desugared information. One complication was that the `DeclStmt`s for the compiler-generated variables seem to have results for `getDeclaration()` but not for `getDeclarationEntry()`. This required handling these slightly differently than we do for other `DeclStmt`s. The flow for range-based `for` is actually easier than for a regular `for`, because all three components (init, condition, and update) are always present.