Files
swift-mirror/test/DebugInfo/LinetableArtificialFn.swift
Joe Groff 2368ce774b Remove self types from mangling by default.
And include some supplementary mangling changes:

- Give the first generic param (depth=0, index=0) a single character mangling. Even after removing the self type from method declaration types, 'Self' still shows up very frequently in protocol requirement signatures.
- Fix the mangling of generic parameter counts to elide the count when there's only one parameter at the starting depth of the mangling.

Together these carve another 154KB out of a debug standard library. There's some awkwardness in demangled strings that I'll clean up in subsequent commits; since decl types now only mangle the number of generic params at their own depth, it's context-dependent what depths those represent, which we get wrong now. Currying markers are also wrong, but since free function currying is going away, we can mangle the partial application thunks in different ways.

Swift SVN r32896
2015-10-26 22:05:20 +00:00

35 lines
913 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - -disable-sil-linking | FileCheck %s
// Verify that a helper function that is generated on-the-fly does
// not mess up the linetable of the calling function.
// CHECK: _TFSiCfT22_builtinIntegerLiteralBi2048__Si{{.*}}(i2048 -2)
// CHECK: store {{(i32|i64)}} {{.*}}getelementptr
// CHECK: store {{(i32|i64)}} {{.*}}getelementptr{{.*}}, !dbg ![[DBG:[0-9]+]]
// CHECK-NOT: ![[DBG]] = !{i32 0, i32 0,
class TurnBasedPolicy {
typealias Rules = (onWin : Int, onHint : Int, onLose : Int, onWrongGuess: Int, numAttempts : Int, numHints : Int, secretRange : (Int, Int))
init (r : Rules) {
self.rules = r
}
var rules : Rules
var secret = 0
var attempts = 0
var hints = 0
var hintedRange = (0, 0)
}
var easyPolicy : TurnBasedPolicy.Rules = (
onWin : 2,
onHint : -1,
onLose : -2,
onWrongGuess : 0,
numAttempts : 7,
numHints : 7,
secretRange : (1,10)
)