Skip to content

Commit df94b58

Browse files
Merge pull request #72251 from nate-chandler/nfc/20240311/1/alloc_stack-flag-from-swift
[NFC] SIL: Expose alloc_stack flag to Swift sources.
2 parents 552edd2 + 8ed11e1 commit df94b58

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

SwiftCompilerSources/Sources/SIL/Builder.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ public struct Builder {
8787
}
8888

8989
public func createAllocStack(_ type: Type, hasDynamicLifetime: Bool = false,
90-
isLexical: Bool = false, usesMoveableValueDebugInfo: Bool = false) -> AllocStackInst {
91-
let dr = bridged.createAllocStack(type.bridged, hasDynamicLifetime, isLexical, usesMoveableValueDebugInfo)
90+
isLexical: Bool = false, isFromVarDecl: Bool = false,
91+
usesMoveableValueDebugInfo: Bool = false) -> AllocStackInst {
92+
let dr = bridged.createAllocStack(type.bridged, hasDynamicLifetime, isLexical,
93+
isFromVarDecl, usesMoveableValueDebugInfo)
9294
return notifyNew(dr.getAs(AllocStackInst.self))
9395
}
9496

include/swift/SIL/SILBridging.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,9 @@ struct BridgedBuilder{
11281128
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createCondFail(BridgedValue condition,
11291129
BridgedStringRef message) const;
11301130
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createIntegerLiteral(BridgedType type, SwiftInt value) const;
1131-
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createAllocStack(BridgedType type,
1132-
bool hasDynamicLifetime, bool isLexical, bool wasMoved) const;
1131+
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction
1132+
createAllocStack(BridgedType type, bool hasDynamicLifetime, bool isLexical,
1133+
bool isFromVarDecl, bool wasMoved) const;
11331134
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createAllocVector(BridgedValue capacity,
11341135
BridgedType type) const;
11351136
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createDeallocStack(BridgedValue operand) const;

include/swift/SIL/SILBridgingImpl.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,13 +1460,15 @@ BridgedInstruction BridgedBuilder::createIntegerLiteral(BridgedType type, SwiftI
14601460
}
14611461

14621462
BridgedInstruction BridgedBuilder::createAllocStack(BridgedType type,
1463-
bool hasDynamicLifetime, bool isLexical, bool wasMoved) const {
1463+
bool hasDynamicLifetime,
1464+
bool isLexical,
1465+
bool isFromVarDecl,
1466+
bool wasMoved) const {
14641467
return {unbridged().createAllocStack(
14651468
regularLoc(), type.unbridged(), std::nullopt,
14661469
swift::HasDynamicLifetime_t(hasDynamicLifetime),
1467-
swift::IsLexical_t(isLexical),
1468-
// TODO: Add this as an argument.
1469-
swift::IsNotFromVarDecl, swift::UsesMoveableValueDebugInfo_t(wasMoved))};
1470+
swift::IsLexical_t(isLexical), swift::IsFromVarDecl_t(isFromVarDecl),
1471+
swift::UsesMoveableValueDebugInfo_t(wasMoved))};
14701472
}
14711473

14721474
BridgedInstruction BridgedBuilder::createAllocVector(BridgedValue capacity, BridgedType type) const {

0 commit comments

Comments
 (0)