Commit Graph

26 Commits

Author SHA1 Message Date
Adrian Prantl
e70a3443e9 [Debug Info] Remove the mostly unused FragmentType from DebugTypeInfo
This cleanup allows for more consistent debug info emission since we depend less
on IRGen magic to emit debug info for types.
2025-01-27 17:28:10 -08:00
Felipe de Azevedo Piovezan
a321b0afe0 [DebugInfo] Update tests to expect new LLVM debug format 2024-07-23 11:06:12 -07:00
Felipe de Azevedo Piovezan
1ed9df0a0c [DebugInfo] Update tests to use opaque ptrs 2023-06-16 15:05:44 -04:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
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
8e9b02839b Debug Info: Avoid type uniquing clashes for bound generic structs.
This patch changes the DWARF representation of bound generic struct to a nested
struct where the (sized) outer struct is anonymous and thus distinct and the
inner struct in uniqued and sizeless.

This is anologous the the previous commit that did the same thing for bound
generic enums.

rdar://problem/56521648
2019-11-04 13:36:49 -08:00
Adrian Prantl
ff22da20c3 Debug Info: Encode let-bindings using DW_TAG_const_type.
This allows the debugger to distinguish constant "let" values from
mutable "var" variables.

rdar://problem/16042546
2019-09-25 08:51:05 -07:00
Davide Italiano
854dffb200 [DebugInfo] Stop handling InOut types, they'll be gone soon.
<rdar://problem/46043909>
2018-12-06 13:38:34 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Adrian Prantl
bab3000069 Use depth and index to lookup type metadata artificial variables
instead of using name and decl context.

The advantages of this approach are three-fold:
- This is necessary to support inlined generic functions.
- We can retire the debugger-specific type name manfgling mode for archetypes.
- This saves 270kb of debug information in the x86_64 libSwiftCore.dylib alone.

<rdar://problem/38306256>
2018-06-12 12:48:15 -07:00
Arnold Schwaighofer
d981bb1d96 Mangling: noescape functions will be trivial and no longer compatible with escape function types.
Mangle escapeness as part of the type.

Part of:
SR-5441
rdar://36116691
2018-02-06 08:51:43 -08:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Pavel Yaskevich
600b15821d [Mangling/ABI] NFC: Fix DebugInfo tests to reflect label mangling changes 2017-12-18 15:44:24 -08:00
Adrian Prantl
dc24c29bc8 Adapt to upstream LLVM changes in pretty-printing DIExpression. 2017-08-24 08:53:22 -07:00
Adrian Prantl
84d9238315 Emit llvm.dbg.declare intrisics immediately after the described alloca.
This cleanup change doesn't change the semantics, but it makes the
resulting IR much easier to read and debug.
2017-05-24 09:13:41 -07:00
Adrian Prantl
0b2b0c036c Revert "Emit llvm.dbg.declare intrisics immediately after the described alloca."
This reverts commit 8660fd489a.
2017-05-23 11:42:13 -07:00
Adrian Prantl
8660fd489a Emit llvm.dbg.declare intrisics immediately after the described alloca.
This cleanup change doesn't change the semantics, but it makes the
resulting IR much easier to read and debug.
2017-05-23 09:23:41 -07:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07:00
Maxim Moiseev
98e6cafdc8 [stdlib] Adding a deprecated version of flatMap to warn misuses. (#7823)
Due to implicit promotion to optional it is possible to call flatMap
with a closure, that does not return an optional. This way the code
works, but is unnecessary inefficient. Such uses of flatMap can and
should be replaced with map.
2017-03-06 10:16:42 -08:00
Erik Eckstein
fcd79c044d Mangling: consider bound generic types for substitutions
This shrinks the name length if the same bound generic type is used multiple times, like: func foo(_ x: [Int], _ y: [Int])
2017-03-05 17:40:07 -08:00
Erik Eckstein
1d3724666f tests: convert about 400 tests to the new mangling by using the -new-mangling-for-tests option
When the new mangling is enabled permanently, the option can be removed from the RUN command lines again.
2017-01-24 15:27:45 -08:00
Slava Pestov
1809fc8361 AST: Map closure types out of context when mangling 2016-11-29 03:05:36 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Adrian Prantl
0fac43e11f Adapt to upstream LLVM changes.
<rdar://problem/25949511+25962000>

(cherry picked from commit df9dfac609d17cd26d6107f17024c937b1b5b1a2)
2016-05-13 22:04:00 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Adrian Prantl
3aec2c993f Debug Info: Fix the condition for detecting implicitly indirect types,
factor out the handling of implicitly indirect types
and add coverage for previouslt uncovered additional cases.

rdar://problem/23681035
2015-12-07 16:01:23 -08:00