Commit Graph

1464 Commits

Author SHA1 Message Date
swift-ci
1bfb3e6e1c Merge pull request #62499 from adrian-prantl/102367872
Add an assertion that verifies the size of cached debug info types.
2023-02-08 19:47:10 -08:00
swift-ci
1a230aefa5 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-08 17:53:33 -08: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
Meghana Gupta
feceaa2ff7 Fix bug during IR generation of a signed access 2023-02-08 12:42:12 -08:00
swift-ci
e36e8b8b4f Merge remote-tracking branch 'origin/main' into rebranch 2023-02-08 08:55:09 -08:00
John McCall
dcf90ba3f3 Merge pull request #63512 from rjmccall/tuple_pack_element_addr
Add the tuple_pack_element_addr SIL instruction
2023-02-08 11:48:23 -05:00
swift-ci
42d238274b Merge remote-tracking branch 'origin/main' into rebranch 2023-02-07 21:54:26 -08:00
Meghana Gupta
5d17c846fa Merge pull request #63475 from meg-gupta/ptrauthaddchanges
Misc changes to support import of structs with ptrauth qualified field function ptrs
2023-02-07 21:37:49 -08:00
swift-ci
93690e0073 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-07 20:53:11 -08:00
Nate Chandler
58954ab405 [IRGen] Added getPackElementSize. 2023-02-07 20:51:03 -08:00
nate-chandler
ddf09369ba Merge pull request #63502 from nate-chandler/variadic-generics/irgen/open_pack_element_witnesses
[IRGen] Bind wtables at open_pack_element.
2023-02-07 20:46:36 -08:00
John McCall
159c653780 Add the tuple_pack_element_addr SIL instruction.
This allows dynamically indexing into tuples.  IRGen not yet
implemented.

I think I'm going to need a type_refine_addr instruction in
order to handle substitutions into the operand type that
eliminate the outer layer of tuple-ness.  Gonna handle that
in a follow-up commit.
2023-02-07 23:22:35 -05:00
Nate Chandler
cd7e675bce [IRGen] Bind wtables at open_pack_element.
Call out to the infrastructure for emitting witness table packs to emit
references to individual witness tables when binding opened archetypes
during open_pack_element.
2023-02-07 12:40:46 -08:00
swift-ci
078a588ac0 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-07 08:52:59 -08:00
Meghana Gupta
75a9137f89 Enclose with begin_access[signed]/end_access during SILGen of implicit value ctor 2023-02-07 00:17:32 -08:00
John McCall
27142e42f6 Add SIL instructions to get and set pack elements 2023-02-07 01:10:15 -05:00
swift-ci
a61d2ef868 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-02 20:36:01 -08:00
nate-chandler
7b317c0f1e Merge pull request #63363 from nate-chandler/variadic-generics/irgen/open_pack_element
[IRGen] Lowered open_pack_element.
2023-02-02 20:26:29 -08:00
Nate Chandler
a442245925 [IRGen] Lowered open_pack_element. 2023-02-02 12:48:40 -08:00
swift-ci
9fd0ce37f4 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-01 18:53:37 -08:00
John McCall
6bf9ac858b Add instructions to allocate and deallocate packs.
Having added these, I'm not entirely sure we couldn't just use
alloc_stack and dealloc_stack.  Well, if we find ourselves adding
a lot of redundancy with those instructions (e.g. around DI), we
can always go back and rip these out.
2023-01-31 22:39:34 -05:00
swift-ci
8ec181f456 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-27 14:14:10 -08:00
Meghana Gupta
1dac5d48d3 Support for address discriminated pointers 2023-01-27 01:56:44 -08:00
swift-ci
df75f6ee09 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-25 22:33:52 -08:00
swift-ci
281088eb73 Merge pull request #63204 from meg-gupta/ptrauthcodegenpr
Initial support for ptrauth qualified function pointers in C
2023-01-25 22:19:34 -08:00
Meghana Gupta
901c279bea Add IRGen support for reads and writes to imported __ptrauth qualified field function pointers
Access to such pointers are protected by begin_access [signed]/end_access.
Generate code to auth/sign them before access.
2023-01-25 14:03:19 -08:00
Meghana Gupta
ba052abec1 Add signed access enforcement to begin_access
This will be used for supporting imported c function pointers with custom __ptrauth qualifier.
2023-01-25 14:03:15 -08:00
swift-ci
8ec1f5847b Merge remote-tracking branch 'origin/main' into rebranch 2023-01-20 10:30:05 -08:00
John McCall
374c202b99 Add SIL instructions to generate pack indices 2023-01-19 23:57:22 -05:00
John McCall
4391d159b7 [NFC] Convenience for setting a singleton explosion 2023-01-19 23:57:13 -05:00
swift-ci
a7e782f78b Merge remote-tracking branch 'origin/main' into rebranch 2023-01-11 10:24:35 -08:00
John McCall
9aeddd0b41 Merge pull request #62955 from rjmccall/open_pack_element
Add the open_pack_element instruction
2023-01-11 13:17:46 -05:00
swift-ci
5df3e6ca80 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-11 01:56:51 -08:00
John McCall
37baf9b2dc Add a SIL instruction to open a pack as an element archetype
IRGen not yet done.
2023-01-11 03:11:30 -05:00
Konrad `ktoso` Malawski
54dec38a34 initial complete impl 2023-01-05 16:19:05 +09:00
swift-ci
f476abf4a1 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-20 17:13:36 -08:00
Pavel Yaskevich
0c5e133ab4 [IRGen] Add runtime accessible functions to a special section 2022-12-20 09:45:01 -08:00
swift-ci
c8bcfcc57f Merge remote-tracking branch 'origin/main' into rebranch 2022-12-16 18:34:15 -08:00
Adrian Prantl
a9f0b2a84f Remove StorageType from DebugTypeInfo::getErrorResult().
Error results are always indirect so passing in the llvm storage type (which is
always a pointer) is entirely pointless.

rdar://103416237
2022-12-16 13:32:48 -08:00
swift-ci
2a6e9d30eb Merge remote-tracking branch 'origin/main' into rebranch 2022-12-14 19:54:28 -08:00
swift-ci
9eb3adb69e Merge pull request #62591 from adrian-prantl/fixed-buffer
Sink isFixedBuffer into DebugTypeInfo and ensure the enclosed types
2022-12-14 19:51:26 -08: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
swift-ci
d9031ef308 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-13 19:12:55 -08:00
Slava Pestov
57eeb1894d Merge pull request #62548 from slavapestov/irgen-pack-shape
IRGen: Preliminary support for working with pack shapes
2022-12-13 22:08:54 -05:00
swift-ci
dcfb01cfb3 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-13 09:16:29 -08:00
Slava Pestov
6e31af6dda IRGen: Simplify enumerateFulfillments() 2022-12-13 11:56:33 -05:00
Adrian Prantl
2dc75858ae Merge pull request #62542 from adrian-prantl/task-alloc
Fix IRGen debug info for swift_task_alloc'ed variables.
2022-12-13 08:55:49 -08:00
Adrian Prantl
e67d8bf4e3 Fix IRGen debug info for swift_task_alloc'ed variables.
The old code attempted to load the variable despite not knowing its size. Fixed
by describing the variable's address on the task heap.
2022-12-12 17:19:49 -08:00
swift-ci
328e716489 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-12 07:33:19 -08:00
Nate Chandler
8d8577e5b0 [SIL] Removed Indirect_In_Constant convention.
It is no different from @in.

Continue parse @in_constant in textual and serialized SIL, but just as
an alias for @in.
2022-12-09 21:54:00 -08:00