mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user