Commit Graph

4 Commits

Author SHA1 Message Date
Adrian Prantl
0f4429b224 DebugTypeInfo: Prefer the size of the Storage type derived from the TypeInfo.
Previously type sizes would be inconsistently sourced from either the LLVM type
or the FixedTypeInfo, depending on the call site. This was problematic because
TypeInfo operates with a resolution of whole bytes, which means that types such
as i1 would get a reported as having a size of 8. This patch now asserts that
all occurrences of the same type have the same size as the first, cached
occurence.

To avoid triggering the cached type verification assertion, this patch avoids
caching of storage-sized containers. It also removes the unique identifier from
forward declarations, which could lead to type confusion during LTO.

rdar://102367872
2023-02-08 15:09:53 -08:00
Adrian Prantl
248ba6236a Don't emit debug line numbers for Swift type forward declarations
These line numbers are consumed by LLDB and stored in the Declaration object,
but as far as I can tell no user-facing feature relies on this.

Removing the line number can reduce the churn for incremental builds
significantly, since whitespace changes in one file may trigger a recompilation
of any file that uses a type declared below the whitespace change.

<rdar://problem/63156560>
2020-05-13 16:57:44 -07:00
Adrian Prantl
2113df4a75 Improve testcase
This patch makes BoundGenericEnum more robust by splitting it into three
separately executed FileCheck invocation. It further corrects an error in case
(1) were the wrong variable was being checked. Finally, by enabling
optimizations, it is easier to follow why the generic arguments have different
sizes.
2020-02-06 17:27:41 -08:00
Adrian Prantl
e881168d5e Debug Info: Avoid type uniquing clashes for bound generic enums.
This patch changes the DWARF representation of bound generic enums to a nested
struct where the (sized) outer struct is anonymous and thus distinct and the
inner struct in uniqued and sizeless.

BoundGenericEnums may have different sizes depending on what they are bound to,
but still share a mangled name.

rdar://problem/56521648
2019-11-04 08:22:00 -08:00