Skip to content

Commit 3c86aa4

Browse files
committed
Swift SIL: add BuiltinInst.ID.stackAlloc
And make all the case identifiers lowercase.
1 parent 0592727 commit 3c86aa4

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ fileprivate struct EscapeInfoWalker<V: EscapeInfoVisitor> : ValueDefUseWalker,
396396
return walkDownUses(ofAddress: pta, path: path.with(knownType: nil))
397397
case let bi as BuiltinInst:
398398
switch bi.id {
399-
case .DestroyArray:
399+
case .destroyArray:
400400
// If it's not the array base pointer operand -> bail. Though, that shouldn't happen
401401
// because the other operands (metatype, count) shouldn't be visited anyway.
402402
if operand.index != 1 { return isEscaping }

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,16 @@ final public class LoadBorrowInst : SingleValueInstruction, UnaryInstruction {}
321321
final public class BuiltinInst : SingleValueInstruction {
322322
// TODO: find a way to directly reuse the BuiltinValueKind enum
323323
public enum ID {
324-
case None
325-
case DestroyArray
324+
case none
325+
case destroyArray
326+
case stackAlloc
326327
}
327-
public var id: ID? {
328+
329+
public var id: ID {
328330
switch BuiltinInst_getID(bridged) {
329-
case DestroyArrayBuiltin: return .DestroyArray
330-
default: return .None
331+
case DestroyArrayBuiltin: return .destroyArray
332+
case StackAllocBuiltin: return .stackAlloc
333+
default: return .none
331334
}
332335
}
333336
}

0 commit comments

Comments
 (0)