diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-28 18:44:09 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-28 18:44:09 +0000 |
| commit | 8baa50013c86c34a58d8327c5d1a043898b86398 (patch) | |
| tree | c3e17acda6afd5e69242ee9dd6d330796f1c3670 /clang/lib/CodeGen/CodeGenPGO.cpp | |
| parent | 8e90bad63d3a448ed680616b393a47d25280fd87 (diff) | |
| download | bcm5719-llvm-8baa50013c86c34a58d8327c5d1a043898b86398.tar.gz bcm5719-llvm-8baa50013c86c34a58d8327c5d1a043898b86398.zip | |
[cxx2a] P0614R1: Support init-statements in range-based for loops.
We don't yet support this for the case where a range-based for loop is
implicitly rewritten to an ObjC for..in statement.
llvm-svn: 343350
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index 0e73e44f630..48900ac3e8a 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -544,6 +544,8 @@ struct ComputeRegionCounts : public ConstStmtVisitor<ComputeRegionCounts> { void VisitCXXForRangeStmt(const CXXForRangeStmt *S) { RecordStmtCount(S); + if (S->getInit()) + Visit(S->getInit()); Visit(S->getLoopVarStmt()); Visit(S->getRangeStmt()); Visit(S->getBeginStmt()); |

