Commit Graph

1725 Commits

Author SHA1 Message Date
Nate Chandler
6378efee04 [IRGen] Bound all reqs of open_pack_element.
Previously, only the element archetypes that corresponded to the
relevant pack generic parameters were bound, and the wtables that were
bound for them were based on looking up what they conform to.  Here, the
requirements of the generic signature are used to find which archetypes
must be bound to metadata and which conformances must be bound to
wtables.
2023-02-16 15:29:45 -08:00
swift-ci
969a797b1d Merge remote-tracking branch 'origin/main' into rebranch 2023-02-15 12:14:18 -08:00
Erik Eckstein
748264c45f Add a unprotectedStackAlloc builtin
It's like `Builtin.stackAlloc`, but doesn't set the `[stack_protection]` flag on its containing function.
2023-02-15 08:09:38 +01:00
swift-ci
2b5b1424f4 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-11 23:54:59 -08:00
John McCall
a38478724a Add a pack_length SIL instruction for measuring the length of a pack 2023-02-10 21:50:44 -05:00
swift-ci
3b29bbe82e Merge remote-tracking branch 'origin/main' into rebranch 2023-02-09 10:14:46 -08:00
nate-chandler
3b4d03c4ed Merge pull request #63513 from nate-chandler/variadic-generics/irgen/alloc_pack
[IRGen] Lowered de/alloc_pack.
2023-02-09 09:57:54 -08:00
Nate Chandler
da5b5c1ea5 [IRGen] Lowered de/alloc_pack. 2023-02-09 07:24:01 -08:00
swift-ci
962e99f385 Merge remote-tracking branch 'origin/main' into rebranch 2023-02-09 01:13:59 -08:00
Erik Eckstein
cef6ef9a84 SIL: add a debug_step instruction
This instruction can be inserted by Onone optimizations as a replacement for deleted instructions to
ensure that it's possible to single step on its location.
2023-02-09 06:50:05 +01:00
swift-ci
4e70bf848c Merge remote-tracking branch 'origin/main' into rebranch 2023-02-08 19:53:47 -08:00
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