mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IRGen: support the @sensitive attribute
Call `swift_clearSensitive` after destroying or taking "sensitive" struct types. Also, support calling C-functions with "sensitive" parameters or return values. In SIL, sensitive types are address-only and so are sensitive parameters/return values. Though, (small) sensitive C-structs are passed directly to/from C-functions. We need re-abstract such parameter and return values for C-functions.
This commit is contained in:
@@ -2832,6 +2832,13 @@ FUNCTION(ClearSensitive, swift_clearSensitive, C_CC, ClearSensitiveAvailability,
|
||||
EFFECT(NoEffect),
|
||||
UNKNOWN_MEMEFFECTS)
|
||||
|
||||
FUNCTION(MemsetS, memset_s, C_CC, AlwaysAvailable,
|
||||
RETURNS(Int32Ty),
|
||||
ARGS(PtrTy, SizeTy, Int32Ty, SizeTy),
|
||||
ATTRS(NoUnwind),
|
||||
EFFECT(NoEffect),
|
||||
UNKNOWN_MEMEFFECTS)
|
||||
|
||||
#undef RETURNS
|
||||
#undef ARGS
|
||||
#undef ATTRS
|
||||
|
||||
Reference in New Issue
Block a user