Files
swift-mirror/test/DebugInfo/nested_functions.swift
David Farler fab3d491d9 Serialize local types and provide a lookup API
rdar://problem/18295292

Locally scoped type declarations were previously not serialized into the
module, which meant that the debugger couldn't reason about the
structure of instances of those types.

Introduce a new mangling for local types:
[file basename MD5][counter][identifier]
This allows the demangle node's data to be used directly for lookup
without having to backtrack in the debugger.

Local decls are now serialized into a LOCAL_TYPE_DECLS table in the
module, which acts as the backing hash table for looking up
[file basename MD5][counter][identifier] -> DeclID mappings.

New tests:
* swift-ide-test mode for testing the demangle/lookup/mangle lifecycle
of a module that contains local decls
* mangling
* module merging with local decls

Swift SVN r24426
2015-01-14 22:08:47 +00:00

13 lines
662 B
Swift

// RUN: %swift -target x86_64-apple-macosx10.9 -primary-file %s -emit-ir -g -o - | FileCheck %s
func outer(a: Int) -> Int {
// Inner functions have a linkage name of "closure[0-9]+", but
// their DW_AT_name is preserved.
// CHECK: \00_TFF16nested_functions5outerFSiSiL33_C327CA4691633C3CAC5D0746F943AABD_5innerfSiSi\00[[@LINE+1]]\000\001\000\000\000\000\00[[@LINE+1]]", !1, !24, !31, null, i64 (i64, i64)* @_TFF16nested_functions5outerFSiSiL33_C327CA4691633C3CAC5D0746F943AABD_5innerfSiSi, null, null, !2} ; [ DW_TAG_subprogram ] [line [[@LINE+1]]] [def] [inner]
func inner(b: Int) -> Int {
return a+b
}
return inner(42)
}