This revision was automatically updated to reflect the committed changes.
Closed by commit rC325175: [Debug] Annotate compiler generated range-for loop
variables. (authored by mattd, committed by ).
Repository:
rC Clang
https://reviews.llvm.org/D42813
Files:
include/clang/Sema/Scope.h
lib
mattd added a comment.
> Great - can you commit this yourself or would you like me to do it for you?
I've got it. Thanks!
https://reviews.llvm.org/D42813
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman
dblaikie added a comment.
In https://reviews.llvm.org/D42813#1007865, @mattd wrote:
> Thanks @dblaikie! I renamed the test, and cleaned up per your suggestion. I
> originally regex'd the debug-info lines so that the test would verify that
> the names were artificial; however, being that we al
mattd updated this revision to Diff 134272.
mattd added a comment.
Thanks @dblaikie! I renamed the test, and cleaned up per your suggestion. I
originally regex'd the debug-info lines so that the test would verify that the
names were artificial; however, being that we already match them as meta
dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.
Seems good, thanks :)
Comment at: test/CodeGenCXX/debug-for-range-scope-hints.cpp:1
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
+
-
mattd updated this revision to Diff 134263.
mattd added a comment.
- Added a division by 2 instead of the shift, it reads clearer.
- Updated the associated comment, reflecting that we divide by two because the
variables we are annotating are within the inner scope of the ranged-based for
loop.
mattd added inline comments.
Comment at: lib/Sema/SemaStmt.cpp:2346
+// Assume the variables are nested in the inner scope (loop body).
+const auto DepthStr = std::to_string(S->getDepth() >> 1);
VarDecl *BeginVar = BuildForRangeVarDecl(*this, ColonLoc, AutoType,
dblaikie added a comment.
Seems plausible - maybe walking the scopes to count the range-for loops would
produce a better number, but would be slower. :/ Dunno.
Comment at: lib/Sema/SemaStmt.cpp:2346
+// Assume the variables are nested in the inner scope (loop body).
+c
mattd updated this revision to Diff 132464.
mattd added a comment.
Updating the diff, missed a few deltas that should have been in the original
patch.
https://reviews.llvm.org/D42813
Files:
include/clang/Sema/Scope.h
lib/Sema/SemaStmt.cpp
test/CodeGenCXX/debug-for-range-scope-hints.cpp
mattd created this revision.
mattd added a reviewer: rsmith.
mattd edited the summary of this revision.
This change aims to simplify debugging by annotating the range-for loop
artificial variables (range, begin, end) with the scope depth.
https://reviews.llvm.org/D42813
Files:
SemaStmt.cpp
10 matches
Mail list logo