[DebugInfo] Fix recursively generating debug info for same type

Debug Info generation already has a check to stop it from generating
debug info for a type with the same mangled name. However, most of the
code paths in debug info generation would not add the mangled name to
the cache while generation was not done. This patch fixes that so types
that are in-flight don't have their debug info generated twice.

rdar://142500619
This commit is contained in:
Augusto Noronha
2025-01-16 14:08:04 -08:00
parent 29bcd2caa0
commit aa6b5c2b63
2 changed files with 123 additions and 121 deletions

View File

@@ -0,0 +1,27 @@
// RUN: %empty-directory(%t)
// RUN: %{python} %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend %t/Main.swift -g -target %target-cpu-apple-macos14 -import-bridging-header %t/BridgingHeader.h -enable-experimental-feature Embedded -wmo -emit-ir -o - | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: OS=macosx
// REQUIRES: embedded_stdlib
// REQUIRES: swift_feature_Embedded
// BEGIN BridgingHeader.h
#pragma once
typedef struct S2 S2_t;
typedef struct S1 {
struct S2 *other;
} S1_t;
typedef struct S2 {
S1_t *producer_pool;
} S2_t;
// BEGIN Main.swift
public var v: UnsafeMutablePointer<S1_t>? = nil
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, {{.*}} identifier: "$eSpySo4S1_taGD"
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, {{.*}} identifier: "$eSpySo2S2VGD"