Skip to content

Commit 972a69f

Browse files
committed
SwiftCompilerSources bridging review feedback
1 parent d7c1c50 commit 972a69f

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,20 +366,22 @@ public struct VarDecl {
366366
}
367367

368368
// See C++ VarDeclCarryingInst
369-
public protocol VarDeclInst {
369+
public protocol VarDeclInstruction {
370370
var varDecl: VarDecl? { get }
371371
}
372372

373-
public protocol DebugVariableInst : VarDeclInst {
374-
var debugVariable: OptionalBridgedSILDebugVariable { get }
373+
public protocol DebugVariableInstruction : VarDeclInstruction {
374+
typealias DebugVariable = OptionalBridgedSILDebugVariable
375+
376+
var debugVariable: DebugVariable { get }
375377
}
376378

377-
final public class DebugValueInst : Instruction, UnaryInstruction, DebugVariableInst {
379+
final public class DebugValueInst : Instruction, UnaryInstruction, DebugVariableInstruction {
378380
public var varDecl: VarDecl? {
379381
VarDecl(bridged: bridged.DebugValue_getDecl())
380382
}
381383

382-
public var debugVariable: OptionalBridgedSILDebugVariable {
384+
public var debugVariable: DebugVariable {
383385
return bridged.DebugValue_getVarInfo()
384386
}
385387
}
@@ -637,7 +639,7 @@ final public class DynamicFunctionRefInst : FunctionRefBaseInst {
637639
final public class PreviousDynamicFunctionRefInst : FunctionRefBaseInst {
638640
}
639641

640-
final public class GlobalAddrInst : GlobalAccessInst, VarDeclInst {
642+
final public class GlobalAddrInst : GlobalAccessInst, VarDeclInstruction {
641643
public var varDecl: VarDecl? {
642644
VarDecl(bridged: bridged.GlobalAddr_getDecl())
643645
}
@@ -744,7 +746,7 @@ final public class SelectEnumInst : SingleValueInstruction {
744746
public var enumOperand: Operand { operands[0] }
745747
}
746748

747-
final public class RefElementAddrInst : SingleValueInstruction, UnaryInstruction, VarDeclInst {
749+
final public class RefElementAddrInst : SingleValueInstruction, UnaryInstruction, VarDeclInstruction {
748750
public var instance: Value { operand.value }
749751
public var fieldIndex: Int { bridged.RefElementAddrInst_fieldIndex() }
750752

@@ -979,14 +981,14 @@ final public class LinearFunctionInst: SingleValueInstruction, ForwardingInstruc
979981

980982
public protocol Allocation : SingleValueInstruction { }
981983

982-
final public class AllocStackInst : SingleValueInstruction, Allocation, DebugVariableInst {
984+
final public class AllocStackInst : SingleValueInstruction, Allocation, DebugVariableInstruction {
983985
public var hasDynamicLifetime: Bool { bridged.AllocStackInst_hasDynamicLifetime() }
984986

985987
public var varDecl: VarDecl? {
986988
VarDecl(bridged: bridged.AllocStack_getDecl())
987989
}
988990

989-
public var debugVariable: OptionalBridgedSILDebugVariable {
991+
public var debugVariable: DebugVariable {
990992
return bridged.AllocStack_getVarInfo()
991993
}
992994
}
@@ -1018,13 +1020,13 @@ final public class AllocRefDynamicInst : AllocRefInstBase {
10181020
}
10191021
}
10201022

1021-
final public class AllocBoxInst : SingleValueInstruction, Allocation, DebugVariableInst {
1023+
final public class AllocBoxInst : SingleValueInstruction, Allocation, DebugVariableInstruction {
10221024

10231025
public var varDecl: VarDecl? {
10241026
VarDecl(bridged: bridged.AllocBox_getDecl())
10251027
}
10261028

1027-
public var debugVariable: OptionalBridgedSILDebugVariable {
1029+
public var debugVariable: DebugVariable {
10281030
return bridged.AllocBox_getVarInfo()
10291031
}
10301032
}
@@ -1053,9 +1055,9 @@ final public class DestructureTupleInst : MultipleValueInstruction, UnaryInstruc
10531055

10541056
final public class BeginApplyInst : MultipleValueInstruction, FullApplySite {
10551057
public var numArguments: Int { bridged.BeginApplyInst_numArguments() }
1056-
1058+
10571059
public var singleDirectResult: Value? { nil }
1058-
1060+
10591061
public var yieldedValues: Results {
10601062
Results(inst: self, numResults: resultCount - 1)
10611063
}

include/swift/SILOptimizer/OptimizerBridging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ struct BridgedPassContext {
181181
// AST
182182

183183
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE
184-
BridgedDiagnosticEngine getDiagnosticEngine() const;
184+
BridgedDiagEngine getDiagnosticEngine() const;
185185

186186
// SIL modifications
187187

include/swift/SILOptimizer/OptimizerBridgingImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ BridgedNominalTypeDecl BridgedPassContext::getSwiftArrayDecl() const {
175175
// AST
176176

177177
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE
178-
BridgedDiagnosticEngine BridgedPassContext::getDiagnosticEngine() const {
178+
BridgedDiagEngine BridgedPassContext::getDiagnosticEngine() const {
179179
swift::SILModule *mod = invocation->getPassManager()->getModule();
180180
return {&mod->getASTContext().Diags};
181181
}

0 commit comments

Comments
 (0)