[DebugInfo] Fix debug info round tripping of types inside functions

Types with @_originallyDefinedIn cannot be round tripped,

Types declared inside functions have their mangling affected by the
function signature. If the generic signature mentions an
@_originallyDefinedIn type, the type inside the function cannot be round
tripped either.

This commit disables round tripping for this scenario.
This commit is contained in:
Augusto Noronha
2024-12-20 11:58:05 -08:00
parent e87c1c33e1
commit d75bde3852
2 changed files with 29 additions and 10 deletions

View File

@@ -21,6 +21,19 @@ public func localTypeAliasTest(horse: Horse) {
// CHECK: DIDerivedType(tag: DW_TAG_typedef, name: "$s32local_type_originally_defined_in0A13TypeAliasTest5horsey4Barn5HorseV_tF1AL_aD"
}
public func localTypeTest(horse: Horse) {
// The local type mangling for 'A' mentions 'Horse', which must
// be mangled using it's current module name, and not the
// original module name, for consistency with the debug info
// mangling.
struct LocalStruct {}
let info = UnsafeMutablePointer<LocalStruct>.allocate(capacity: 1)
_ = info
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "$s32local_type_originally_defined_in0A8TypeTest5horsey4Barn5HorseV_tF11LocalStructL_VD"
}
public func localTypeAliasTest() -> Horse {
typealias B = Int