Debug info: don't conflate generators and loop variable bindings.

<rdar://problem/17058606> for loop range variable shares name with iteration counter - that's wrong and misleading
<rdar://problem/16786106> [Xcode 6.1] foreach generators are always named "$generator"

Swift SVN r20683
This commit is contained in:
Adrian Prantl
2014-07-29 19:34:17 +00:00
parent a0bc9274db
commit c655d083b3
2 changed files with 15 additions and 8 deletions

View File

@@ -1,8 +1,9 @@
// RUN: %swift -target x86_64-apple-macosx10.9 %s -emit-ir -g -o - | FileCheck %s
var puzzleInput = "great minds think alike"
var puzzleOutput = ""
// CHECK: [ DW_TAG_auto_variable ] [$generator] [line [[@LINE+2]]]
// CHECK: [ DW_TAG_auto_variable ] [letter] [line [[@LINE+1]]]
for letter in puzzleInput {
// CHECK: [ DW_TAG_auto_variable ] [letter] [line [[@LINE-1]]]
switch letter {
case "a", "e", "i", "o", "u", " ":
continue
@@ -11,3 +12,13 @@ for letter in puzzleInput {
}
}
println(puzzleOutput)
func count() {
// CHECK: [ DW_TAG_auto_variable ] [$generator] [line [[@LINE+2]]]
// CHECK: [ DW_TAG_auto_variable ] [i] [line [[@LINE+1]]]
for i in 0...100 {
println(i)
}
}
count()