Commit Graph

1174 Commits

Author SHA1 Message Date
Doug Gregor
d192bfc7e5 Merge pull request #63125 from DougGregor/debug-info-dump-macro-expansion-buffers 2023-01-21 07:43:45 -08:00
Adrian Prantl
6335f1dee5 Debug Info: Represent macro expansions as inlined functions.
This allows the debugger to choose whether to display the expanded macro
(inlined) or the original source code (parent frame).

rdar://102916513
2023-01-20 21:43:20 -08:00
Doug Gregor
456fbf84f5 [Debug info] Dump macro expansion buffers to disk for debug info to reference
When emitting debug info that references into a macro expansion, dump
the macro expansion buffer into a file on disk (in the temporary
directory) so that one can see the macro expansion buffers in the
source files themselves.

The test here validates that the generated LLVM IR looks correct, but
I'm having a problem getting LLDB to actually locate the source code
correctly.
2023-01-19 21:30:25 -08:00
John McCall
0e3a9adc32 Add Builtin.PackIndex 2023-01-19 23:57:13 -05:00
Adrian Prantl
06a54432ab Sink isFixedBuffer into DebugTypeInfo and ensure the enclosed types aren't
emitted with the size of the fixed buffer.
2022-12-14 14:18:28 -08:00
Adrian Prantl
7731ee9a83 Rename variables in assertion (NFC) 2022-12-14 12:36:26 -08:00
Adrian Prantl
1576c08137 Store size in DebugTypeInfo in Bits (NFC) 2022-12-14 12:36:26 -08:00
Adrian Prantl
e74aeed088 Add an assertion that verifies the size of cached debug info types.
Not yet enabled since it triggers when building Concurrency.

rdar://102367872
2022-12-14 12:36:26 -08:00
Adrian Prantl
8921b10417 Fix a bit versus byte confusion. 2022-12-14 12:32:27 -08:00
Adrian Prantl
9a4cb7999e Disambiguate constructors for type metadata (NFC) 2022-12-14 11:34:51 -08:00
Doug Gregor
5ab6b72604 [Macros] Turn Macro into a declaration node.
Although the declaration of macros doesn't appear in Swift source code
that uses macros, they still operate as declarations within the
language. Rework `Macro` as `MacroDecl`, a generic value declaration,
which appropriate models its place in the language.

The vast majority of this change is in extending all of the various
switches on declaration kinds to account for macros.
2022-11-13 12:21:29 -08:00
Slava Pestov
68514b10b5 AST: Introduce ElementArchetypeType 2022-10-21 21:55:35 -04:00
Alex Langford
686193b300 [DebugInfo] Respect debug-prefix-map when emitting path to PCM in Skeleton CUs 2022-10-17 11:53:28 -07:00
Holly Borla
9bb837a241 [AST] Rename SequenceArchetype to PackArchetype. 2022-10-10 16:25:26 -07:00
Anthony Latsis
2843e0c871 Gardening: Migrate compiler sources to GitHub issues 2022-09-29 23:58:55 +03:00
Slava Pestov
c1b8690401 AST: Introduce special Builtin.TheTupleType singleton 2022-09-10 00:26:42 -04:00
Mishal Shah
91b2abe996 Merge pull request #60531 from apple/pull-request-rebranch
Merge `rebranch` into  `main` to support llvm-project `stable/20220421`
2022-08-15 17:10:56 -07:00
zoecarver
39af79f491 [cxx-interop] Re-enable debug mangling. 2022-08-12 15:57:56 -07:00
swift-ci
5c8f1fcb12 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-02 17:03:37 -07:00
Michael Gottesman
8f3fe63fed [no-implicit-copy] Rename SILMoveOnlyType -> SILMoveOnlyWrappedType.
Since I am beginning to prepare for adding real move only types to the language,
I am renaming everything that has to do with copyable types "move only wrapped"
values instead of move only. The hope is this reduces/prevents any confusion in
between the two.
2022-07-01 17:26:13 -07:00
swift-ci
6efe43cbce Merge remote-tracking branch 'origin/main' into rebranch 2022-06-27 10:13:55 -07:00
Zoe Carver
4044b273d1 Merge pull request #59679 from zoecarver/fix-frt-for-debug
[lldb][cxx-interop] Tell LLDB about the extra layer of indireciton for foriegn reference types.
2022-06-27 10:09:10 -07:00
zoecarver
0563889a09 [lldb][cxx-interop] Tell LLDB about the extra layer of indireciton for foriegn reference types. 2022-06-23 14:37:56 -07:00
swift-ci
c2162eda0e Merge remote-tracking branch 'origin/main' into rebranch 2022-06-23 11:34:52 -07:00
Adrian Prantl
7c1c7b6249 Emit debug locations for hop_to_executor instructions.
The function prologue of async funclets inherits its source location
from the hop_to_executor instruction. This makes it easier to produce
logical backtraces, since the PC in logical frames will always point
to the start if the function.

rdar://89776340
2022-06-23 09:40:25 -07:00
swift-ci
7e7803a999 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-15 21:34:18 -07:00
Adrian Prantl
92d7e63306 Unique the debug info function declarations for Swift runtime failure messages.
This reduces the size of the debug info of (random benchmark)
_StringProcessing.o by 1600 bytes. Modules with more arithmetic should
benefit more.

rdar://94060085
2022-06-15 08:35:16 -07:00
swift-ci
22dd6786a8 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-03 15:58:11 -07:00
Michael Gottesman
c66061a783 [moveOnly] Add a new SIL specific AST type called SILMoveOnly.
It can only be used in SIL contexts to express that a wrapped type is
MoveOnly.
2022-06-03 11:27:16 -07:00
Ben Barham
65ed78d3e7 Merge branch 'main' into manually-merge-main 2022-06-02 10:14:57 -07:00
Alexis Laferrière
962c3aaea3 [IRGen] Import ASTDemangler.h in both debug and non-debug
This was breaking non-debug builds.

rdar://94234645
2022-06-01 11:16:32 -07:00
swift-ci
7033e33aa3 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-31 14:35:31 -07:00
Slava Pestov
b45e0d1cda IRGen: Add -enable/disable-round-trip-debug-types flag, on by default in asserts builds 2022-05-31 14:45:59 -04:00
Ben Barham
f2e14e4867 [next] Define DEBUG_TYPE after includes
Not sure which LLVM commit added an `#undef` for `DEBUG_TYPE` in a header
transitively included by these files, but it doesn't seem uncommon
for headers to define and undefine their own `DEBUG_TYPE`.

Move `#define DEBUG_TYPE` after the includes to prevent it being
undefined.
2022-05-05 16:25:10 -07:00
Josh Soref
9fa14ca215 Spelling irgen (#42470)
* spelling: abstractable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: across

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: clazz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: command

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: components

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: current

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: declared

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: discrimination

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: entities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: except

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: existential

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: generic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: initialization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: initialize

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inserted

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: instantiate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: instantiation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interfere

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interferes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: intrinsic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: metadata

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: might

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: necessary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: objective

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurrences

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: outlined

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parameters

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: payload

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: rearchitecting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: replaceable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: reverse

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: rewritable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: shareably

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: specializations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: speedup

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: template

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: that

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: transferred

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uninitialized

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: witness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-21 14:02:03 -07:00
Michael Gottesman
e1c4e1045f [move-function] Update the behavior for debug intrinsics on values in the coroutine frame.
This uses the previous simple dominance dbg info propagation implementation in
the previous commit.

I fix in the next commit the debug info for the last move/reinit in the var
test.
2022-03-21 14:20:53 -07:00
Arnold Schwaighofer
189b0ac5e5 IRGen: Emit the proper linkageName debug info of the containing function for async suspend dispatch thunks
Improvement upon #41645 to emit the async suspend dispatch thunk's debug
info with the `linkageName` of the containing function of the async
await.

rdar://88579737
2022-03-03 15:16:41 -08:00
Michael Gottesman
d03a03efea Merge pull request #41448 from gottesmm/debug-info-move-vars
[move-function] Teach debug info how to handle reinits properly of vars.
2022-02-19 12:51:55 -08:00
Michael Gottesman
65e20e7b2d [move-function] Teach debug info how to handle reinits properly of vars.
This fixes the issues I was in my earlier PR about seeing with vars not getting
appropriate debug info when moved. Now we get the right debug info and in the
dwarf can see the two live ranges of our moved value as we hoped for.

NOTE: I disabled alloc stack hoisting on move_function_debuginfo.swift since it
can result in us eliminating debug info at -Onone when we merge alloc_stack. I
am preparing a separate patch that fixes that issue but hit a lldb problem. This
unblocks this PR from that change since they are not /actually/ related.
2022-02-18 12:59:56 -08:00
Holly Borla
c2594d1338 [FrontendOptions] Remove the -enable-explicit-existential-types flag. 2022-02-17 17:54:59 -08:00
Michael Gottesman
58e2cafa57 [irgen] Add support to IRGenDebugInfo for emitting an llvm.dbg.addr instead of llvm.dbg.declare.
By default, we still use llvm.dbg.declare, so this is an NFC commit. But this
sets us up for using this in the future.
2022-02-15 12:00:31 -08:00
Slava Pestov
aa67c8bf8a Parametrized => parameterized 2022-02-03 13:27:24 -05:00
Slava Pestov
e7e536705e AST: Introduce ParametrizedProtocolType 2022-01-26 00:11:38 -05:00
Doug Gregor
452eccab83 Remove NestedArchetypeType.
Nested archetypes are represented by their base archetype kinds (primary,
opened, or opaque type) with an interface type that is a nested type,
as represented by a DependentMemberType. This provides a more uniform
representation of archetypes throughout the frontend.
2022-01-14 21:28:21 -08:00
Doug Gregor
8df65e706e Remove unnecessary uses of NestedArchetypeType.
`ArchetypeType` has all of the API we need for these cases, so use
that instead to isolate us from `NestedArchetypeType`, which we would
like to eliminate soon-ish.
2022-01-14 21:25:32 -08:00
Holly Borla
992a871a73 [Type Reconstruction] Re-construct existential types with ExistentialType
by propagating whether the decoded type is for a requirement through
TypeDecoder.
2022-01-13 19:31:37 -08:00
Holly Borla
f7a82ac174 [Type Reconstruction] For now, reconstruct existential types without
explicit ExistentialType.

The ASTDemangler needs to produce ExistentialType based on context, not
unconditionally when producing a protocol composition. This is tricky
because existential types are mangled the same way as other protocol
references, e.g. in conformance requirements. For now, drop the explicit
existentials when reconstructing types.
2022-01-13 19:30:44 -08:00
adrian-prantl
324cccd18e Merge pull request #40670 from adrian-prantl/77344315
Fix the module hash stored in -gmodules skeleton units
2021-12-22 11:43:48 -08:00
Adrian Prantl
1adb0b301a Fix the module hash stored in -gmodules skeleton units
by using the proper API. The old code produced the address of the hash.  This
fixes a warning printed by LLDB and dsymutil about module hash mismatches and
makes the build build products more deterministic.

rdar://77344315
2021-12-21 15:53:57 -08:00
Robert Widmann
e5bfda7c6e Merge pull request #40587 from CodaFi/substitute-teacher
Initial Semantics for Variadic Generics
2021-12-20 11:25:25 -08:00