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);
169
169
OptionalBridgedOperand SILValue_firstUse (BridgedValue value );
170
170
BridgedType SILValue_getType (BridgedValue value );
171
171
172
+ SwiftInt SILType_isAddress (BridgedType );
173
+
172
174
BridgedBasicBlock SILArgument_getParent (BridgedArgument argument );
173
175
174
176
OptionalBridgedInstruction SILInstruction_next (BridgedInstruction inst );
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ inline SILValue castToSILValue(BridgedValue value) {
70
70
return static_cast <ValueBase *>(value.obj );
71
71
}
72
72
73
+ inline SILType castToSILType (BridgedType type) {
74
+ return SILType::getFromOpaqueValue (type.typePtr );
75
+ }
76
+
73
77
template <class I = SILInstruction> I *castToInst (BridgedInstruction inst) {
74
78
return cast<I>(static_cast <SILNode *>(inst.obj )->castToInstruction ());
75
79
}
Original file line number Diff line number Diff line change @@ -274,6 +274,14 @@ BridgedType SILValue_getType(BridgedValue value) {
274
274
return { castToSILValue (value)->getType ().getOpaqueValue () };
275
275
}
276
276
277
+ // ===----------------------------------------------------------------------===//
278
+ // SILType
279
+ // ===----------------------------------------------------------------------===//
280
+
281
+ SwiftInt SILType_isAddress (BridgedType type) {
282
+ return castToSILType (type).isAddress ();
283
+ }
284
+
277
285
// ===----------------------------------------------------------------------===//
278
286
// SILGlobalVariable
279
287
// ===----------------------------------------------------------------------===//
Original file line number Diff line number Diff line change 13
13
import SILBridging
14
14
15
15
public 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 }
17
20
}
You can’t perform that action at this time.
0 commit comments