@@ -133,6 +133,19 @@ typedef struct {
133133 SwiftObject obj;
134134} BridgedValue;
135135
136+ // For fast SILValue -> Value briding.
137+ // This is doing the type checks in C++ rather than in Swift.
138+ // It's used for getting the value of an Operand, which is a time critical function.
139+ typedef struct {
140+ SwiftObject obj;
141+ enum class Kind {
142+ SingleValueInstruction,
143+ Argument,
144+ MultipleValueInstructionResult,
145+ Undef
146+ } kind;
147+ } BridgedClassifiedValue;
148+
136149typedef struct {
137150 OptionalSwiftObject obj;
138151} OptionalBridgedValue;
@@ -305,7 +318,7 @@ OptionalBridgedSuccessor SILSuccessor_getNext(BridgedSuccessor succ);
305318BridgedBasicBlock SILSuccessor_getTargetBlock (BridgedSuccessor succ);
306319BridgedInstruction SILSuccessor_getContainingInst (BridgedSuccessor succ);
307320
308- BridgedValue Operand_getValue (BridgedOperand);
321+ BridgedClassifiedValue Operand_getValue (BridgedOperand);
309322OptionalBridgedOperand Operand_nextUse (BridgedOperand);
310323BridgedInstruction Operand_getUser (BridgedOperand);
311324SwiftInt Operand_isTypeDependent (BridgedOperand);
@@ -332,6 +345,7 @@ BridgedType SILType_instanceTypeOfMetatype(BridgedType type, BridgedFunction fun
332345BridgedDecl SILType_getNominal (BridgedType type);
333346bool SILType_isOrContainsObjectiveCClass (BridgedType type);
334347bool SILType_isCalleeConsumedFunction (BridgedType type);
348+ bool SILType_isMarkedAsImmortal (BridgedType type);
335349SwiftInt SILType_getNumTupleElements (BridgedType type);
336350BridgedType SILType_getTupleElementType (BridgedType type, SwiftInt elementIdx);
337351SwiftInt SILType_getNumNominalFields (BridgedType type);
0 commit comments