Commit Graph

16 Commits

Author SHA1 Message Date
Meghana Gupta
9ce8bb3682 Add a new abstraction FixedStorageSemanticsCall 2025-02-28 09:50:58 -08:00
Steven Wu
fba942641e [NFC] Fix new warnings in the headers
The newer version of clang will issue warnings in more cases,
specifically, -Winvalid-offsetof and -Wunused-but-set-variable.
This cleans up the new warnings issued from header, which shows up for
every TU that includes them. Fixing them should make the remaining
warnings easier to read.
2025-01-08 11:38:53 -08:00
Michael Gottesman
ae797d43e9 [region-isolation] Propagate through the whole source operand instead of just the representative of the source value when constructing assign and merge.
This will let me know the exact source operand used instead of the source value
representative. This will ensure that the name associated with the diagnostic is
not of the representative value, but the actual value that was the source of the
assign.

This is an NFCI commit that is an algebraic refactor.
2024-07-18 21:28:22 -07:00
Erik Eckstein
ac4bc89c9a SIL: add the borrowed-from instruction.
It declares from which enclosing values a guaranteed phi argument is borrowed from.
2024-04-10 13:38:10 +02:00
Andrew Trick
581010d00c SIL: Make drop_deinit a ForwardingInstruction.
drop_deinit forwards ownership while effectively stripping the deinitializer. It is similar to a type cast.

Fixes rdar://125590074 ([NonescapableTypes] Nonescapable types
cannot have deinits)
2024-04-03 18:53:18 -07:00
Andrew Trick
4437bf479b Add several instructions to ConversionOperation.
MarkUninitializedInst
    MarkUnresolvedNonCopyableValueInst
    CopyableToMoveOnlyWrapperValueInst
    MoveOnlyWrapperToCopyableValueInst
    MoveOnlyWrapperToCopyableBoxInst
2024-02-25 10:29:15 -08:00
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Nate Chandler
874c7c87d1 [SIL] Multi-op fwds may have single fwding op. 2023-12-14 13:35:26 -08:00
Andrew Trick
69a884565a Fix ownership of select_enum instruction
This instruction was given forwarding ownership in the original OSSA
implementation. That will obviously lead to memory leaks. Remove
ownership from this instruction and verify that it is never used for
non-trivial types.
2023-10-08 01:34:48 -07:00
Andrew Trick
bce9817162 SwiftCompilerSources: add ForwardingInstruction 2023-10-03 23:54:57 -07:00
Andrew Trick
fea1b973de Fix ForwardingInstruction::getSingleForwardingOperand 2023-09-26 21:52:17 -07:00
Meghana Gupta
bacfdbd0b0 Add ForwardingOperation::visitForwardedValues api 2023-09-07 01:17:16 -07:00
Meghana Gupta
79ca1eb1f7 Add ForwardingOperation::getSingleForwardingOperand api 2023-09-07 00:35:14 -07:00
Nate Chandler
7bddaf36a0 [SIL] Added tuple_pack_extract.
The new instruction is needed for opaque values mode to allow values to
be extracted from tuples containing packs which will appear for example
as function arguments.
2023-08-16 11:15:05 -07:00
Meghana Gupta
07863444d2 Introduce ForwardingOperation wrapper type
APIs on ForwardingInstruction should be written as static taking in
a SILInstruction as a parameter making it awkward.

Introduce a ForwardingOperation wrapper type and move the apis from the
old "mixin" class to the wrapper type.

Add new api getForwardedOperands()
2023-07-01 10:42:38 -07:00
Meghana Gupta
c2312a4083 Move instruction wrapper types into a new file for discoverability 2023-07-01 08:26:49 -07:00