2020#include " swift/SIL/SILInstruction.h"
2121#include " swift/SIL/SILLocation.h"
2222#include " swift/SIL/SILWitnessTable.h"
23+ #include " swift/SIL/SILVTable.h"
2324#include < stdbool.h>
2425#include < stddef.h>
2526#include < string>
@@ -31,7 +32,6 @@ struct OptionalBridgedOperand;
3132struct OptionalBridgedSuccessor ;
3233
3334enum {
34- BridgedVTableEntrySize = 5 * sizeof (uintptr_t ),
3535 BridgedWitnessTableEntrySize = 5 * sizeof (uintptr_t )
3636};
3737
@@ -133,14 +133,6 @@ struct BridgedOperandArray {
133133 SwiftInt count;
134134};
135135
136- typedef struct {
137- const void * _Nonnull ptr;
138- } BridgedVTable;
139-
140- typedef struct {
141- const void * _Nonnull ptr;
142- } BridgedVTableEntry;
143-
144136typedef struct {
145137 const void * _Nonnull ptr;
146138} BridgedWitnessTable;
@@ -237,6 +229,34 @@ typedef struct {
237229 SwiftObject obj;
238230} BridgedMultiValueResult;
239231
232+ struct BridgedVTableEntry {
233+ const swift::SILVTableEntry * _Nonnull entry;
234+
235+ std::string getDebugDescription () const ;
236+
237+ SWIFT_IMPORT_UNSAFE
238+ BridgedFunction getImplementation () const {
239+ return {entry->getImplementation ()};
240+ }
241+ };
242+
243+ struct BridgedVTableEntryArray {
244+ BridgedVTableEntry base;
245+ SwiftInt count;
246+ };
247+
248+ struct BridgedVTable {
249+ const swift::SILVTable * _Nonnull vTable;
250+
251+ std::string getDebugDescription () const ;
252+
253+ SWIFT_IMPORT_UNSAFE
254+ BridgedVTableEntryArray getEntries () const {
255+ auto entries = vTable->getEntries ();
256+ return {{entries.data ()}, (SwiftInt)entries.size ()};
257+ }
258+ };
259+
240260typedef struct {
241261 const unsigned char * _Nullable message;
242262 SwiftInt position;
@@ -353,11 +373,6 @@ llvm::StringRef SILGlobalVariable_getName(BridgedGlobalVar global);
353373std::string SILGlobalVariable_debugDescription (BridgedGlobalVar global);
354374SwiftInt SILGlobalVariable_isLet (BridgedGlobalVar global);
355375
356- std::string SILVTable_debugDescription (BridgedVTable vTable);
357- BridgedArrayRef SILVTable_getEntries (BridgedVTable vTable);
358- std::string SILVTableEntry_debugDescription (BridgedVTableEntry entry);
359- BridgedFunction SILVTableEntry_getFunction (BridgedVTableEntry entry);
360-
361376std::string SILWitnessTable_debugDescription (BridgedWitnessTable table);
362377BridgedArrayRef SILWitnessTable_getEntries (BridgedWitnessTable table);
363378std::string SILDefaultWitnessTable_debugDescription (BridgedDefaultWitnessTable table);
0 commit comments