File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ BridgedStringRef SILNode_debugDescription(BridgedNode node);
169169OptionalBridgedOperand SILValue_firstUse (BridgedValue value );
170170BridgedType SILValue_getType (BridgedValue value );
171171
172+ SwiftInt SILType_isAddress (BridgedType );
173+
172174BridgedBasicBlock SILArgument_getParent (BridgedArgument argument );
173175
174176OptionalBridgedInstruction SILInstruction_next (BridgedInstruction inst );
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ inline SILValue castToSILValue(BridgedValue value) {
7070 return static_cast <ValueBase *>(value.obj );
7171}
7272
73+ inline SILType castToSILType (BridgedType type) {
74+ return SILType::getFromOpaqueValue (type.typePtr );
75+ }
76+
7377template <class I = SILInstruction> I *castToInst (BridgedInstruction inst) {
7478 return cast<I>(static_cast <SILNode *>(inst.obj )->castToInstruction ());
7579}
Original file line number Diff line number Diff line change @@ -274,6 +274,14 @@ BridgedType SILValue_getType(BridgedValue value) {
274274 return { castToSILValue (value)->getType ().getOpaqueValue () };
275275}
276276
277+ // ===----------------------------------------------------------------------===//
278+ // SILType
279+ // ===----------------------------------------------------------------------===//
280+
281+ SwiftInt SILType_isAddress (BridgedType type) {
282+ return castToSILType (type).isAddress ();
283+ }
284+
277285// ===----------------------------------------------------------------------===//
278286// SILGlobalVariable
279287// ===----------------------------------------------------------------------===//
Original file line number Diff line number Diff line change 1313import SILBridging
1414
1515public struct Type {
16- var silType : BridgedType
16+ var bridged : BridgedType
17+
18+ public var isAddress : Bool { SILType_isAddress ( bridged) != 0 }
19+ public var isObject : Bool { !isAddress }
1720}
You can’t perform that action at this time.
0 commit comments