[PATCH] D42813: [Debug] Annotate compiler generated range-for loop variables.

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 10:58:11 PST 2018


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
+
----------------
maybe this test should be called debug-info-range-for-var-names? Just a thought. (debug-info seems to be the usual prefix here, and range-for is a common shortening of "range-based-for" I think (maybe I'm wrong & other tests don't use that naming?)? & 'hints' seems a bit vague as to what the test is about - when it's specifically about naming the variables)


================
Comment at: test/CodeGenCXX/debug-for-range-scope-hints.cpp:28-36
+// CHECK: ![[RANGE1]] = !DILocalVariable(name: "__range1", {{.*}}, flags: DIFlagArtificial)
+// CHECK: ![[BEGIN1]] = !DILocalVariable(name: "__begin1", {{.*}}, flags: DIFlagArtificial)
+// CHECK: ![[END1]] = !DILocalVariable(name: "__end1",  {{.*}}, flags: DIFlagArtificial)
+// CHECK: ![[RANGE2]] = !DILocalVariable(name: "__range2",  {{.*}}, flags: DIFlagArtificial)
+// CHECK: ![[BEGIN2]] = !DILocalVariable(name: "__begin2", {{.*}}, flags: DIFlagArtificial)
+// CHECK: ![[END2]] = !DILocalVariable(name: "__end2",  {{.*}}, flags: DIFlagArtificial)
+// CHECK: ![[RANGE3]] = !DILocalVariable(name: "__range3",  {{.*}}, flags: DIFlagArtificial)
----------------
I'd drop the ", {{.*}}, flags: DIFlagArtificial)" from these lines - since the name's the only bit that's really interesting to this test.


https://reviews.llvm.org/D42813





More information about the cfe-commits mailing list