@@ -63,44 +63,44 @@ static inline swift_typeref_interop_t
63
63
swift_reflection_interop_typeRefForInstance (SwiftReflectionInteropContextRef ContextRef,
64
64
uintptr_t Object);
65
65
66
- swift_typeref_interop_t
66
+ static inline swift_typeref_interop_t
67
67
swift_reflection_interop_typeRefForMangledTypeName (
68
68
SwiftReflectionInteropContextRef ContextRef,
69
69
const char *MangledName,
70
70
uint64_t Length);
71
71
72
- swift_typeinfo_t
72
+ static inline swift_typeinfo_t
73
73
swift_reflection_interop_infoForTypeRef (SwiftReflectionInteropContextRef ContextRef,
74
74
swift_typeref_interop_t OpaqueTypeRef);
75
75
76
- swift_childinfo_t
76
+ static inline swift_childinfo_t
77
77
swift_reflection_interop_childOfTypeRef (SwiftReflectionInteropContextRef ContextRef,
78
78
swift_typeref_interop_t OpaqueTypeRef,
79
79
unsigned Index);
80
80
81
- swift_typeinfo_t
81
+ static inline swift_typeinfo_t
82
82
swift_reflection_interop_infoForMetadata (SwiftReflectionInteropContextRef ContextRef,
83
83
swift_metadata_interop_t Metadata);
84
84
85
- swift_childinfo_t
85
+ static inline swift_childinfo_t
86
86
swift_reflection_interop_childOfMetadata (SwiftReflectionInteropContextRef ContextRef,
87
87
swift_metadata_interop_t Metadata,
88
88
unsigned Index);
89
89
90
- swift_typeinfo_t
90
+ static inline swift_typeinfo_t
91
91
swift_reflection_interop_infoForInstance (SwiftReflectionInteropContextRef ContextRef,
92
92
uintptr_t Object);
93
93
94
- swift_childinfo_t
94
+ static inline swift_childinfo_t
95
95
swift_reflection_interop_childOfInstance (SwiftReflectionInteropContextRef ContextRef,
96
96
uintptr_t Object,
97
97
unsigned Index);
98
98
99
- unsigned
99
+ static inline unsigned
100
100
swift_reflection_interop_genericArgumentCountOfTypeRef (
101
101
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef);
102
102
103
- swift_typeref_interop_t
103
+ static inline swift_typeref_interop_t
104
104
swift_reflection_interop_genericArgumentOfTypeRef (
105
105
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef,
106
106
unsigned Index);
@@ -116,20 +116,24 @@ static inline void
116
116
swift_reflection_interop_dumpTypeRef (SwiftReflectionInteropContextRef ContextRef,
117
117
swift_typeref_interop_t OpaqueTypeRef);
118
118
119
- void swift_reflection_interop_dumpInfoForTypeRef (
120
- SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef);
119
+ static inline void
120
+ swift_reflection_interop_dumpInfoForTypeRef (SwiftReflectionInteropContextRef ContextRef,
121
+ swift_typeref_interop_t OpaqueTypeRef);
121
122
122
- void swift_reflection_interop_dumpInfoForMetadata (SwiftReflectionInteropContextRef ContextRef,
123
- swift_metadata_interop_t Metadata);
123
+ static inline void
124
+ swift_reflection_interop_dumpInfoForMetadata (SwiftReflectionInteropContextRef ContextRef,
125
+ swift_metadata_interop_t Metadata);
124
126
125
- void swift_reflection_interop_dumpInfoForInstance (SwiftReflectionInteropContextRef ContextRef,
126
- uintptr_t Object);
127
+ static inline void
128
+ swift_reflection_interop_dumpInfoForInstance (SwiftReflectionInteropContextRef ContextRef,
129
+ uintptr_t Object);
127
130
128
- size_t swift_reflection_interop_demangle (SwiftReflectionInteropContextRef ContextRef,
129
- const char *MangledName,
130
- size_t Length,
131
- char *OutDemangledName,
132
- size_t MaxLength);
131
+ static inline size_t
132
+ swift_reflection_interop_demangle (SwiftReflectionInteropContextRef ContextRef,
133
+ const char *MangledName,
134
+ size_t Length,
135
+ char *OutDemangledName,
136
+ size_t MaxLength);
133
137
134
138
135
139
@@ -292,7 +296,8 @@ struct SwiftReflectionInteropContext {
292
296
#define DECLARE_LIBRARY (index ) \
293
297
struct SwiftReflectionInteropContextLibrary *Library = &ContextRef->Libraries[index]
294
298
295
- static inline int swift_reflection_interop_libraryOwnsObject (
299
+ static inline int
300
+ swift_reflection_interop_libraryOwnsObject (
296
301
struct SwiftReflectionInteropContext *ContextRef,
297
302
struct SwiftReflectionInteropContextLibrary *Library,
298
303
uintptr_t Object) {
@@ -325,8 +330,10 @@ static inline int swift_reflection_interop_libraryOwnsObject(
325
330
return 0 ;
326
331
}
327
332
328
- static inline void swift_reflection_interop_loadFunctions (
329
- struct SwiftReflectionInteropContext *Context, void *Handle, int IsLegacy) {
333
+ static inline void
334
+ swift_reflection_interop_loadFunctions (struct SwiftReflectionInteropContext *Context,
335
+ void *Handle,
336
+ int IsLegacy) {
330
337
if (Handle == NULL )
331
338
return ;
332
339
@@ -388,10 +395,11 @@ static inline void swift_reflection_interop_loadFunctions(
388
395
#endif
389
396
}
390
397
391
- static int swift_reflection_interop_readBytesAdapter (void *reader_context,
392
- swift_addr_t address,
393
- void *dest,
394
- uint64_t size) {
398
+ static inline int
399
+ swift_reflection_interop_readBytesAdapter (void *reader_context,
400
+ swift_addr_t address,
401
+ void *dest,
402
+ uint64_t size) {
395
403
SwiftReflectionInteropContextRef Context =
396
404
(SwiftReflectionInteropContextRef)reader_context;
397
405
@@ -407,19 +415,22 @@ static int swift_reflection_interop_readBytesAdapter(void *reader_context,
407
415
return 1 ;
408
416
}
409
417
410
- static uint8_t swift_reflection_interop_getSizeAdapter (void *reader_context) {
418
+ static inline uint8_t
419
+ swift_reflection_interop_getSizeAdapter (void *reader_context) {
411
420
// Legacy library doesn't pay attention to these anyway.
412
421
return sizeof (void *);
413
422
}
414
423
415
- static uint64_t swift_reflection_interop_GetStringLengthAdapter (
424
+ static inline uint64_t
425
+ swift_reflection_interop_GetStringLengthAdapter (
416
426
void *reader_context, swift_addr_t address) {
417
427
SwiftReflectionInteropContextRef Context =
418
428
(SwiftReflectionInteropContextRef)reader_context;
419
429
return Context->GetStringLength (Context->ReaderContext , address);
420
430
}
421
431
422
- static swift_addr_t swift_reflection_interop_GetSymbolAddressAdapter (
432
+ static inline swift_addr_t
433
+ swift_reflection_interop_GetSymbolAddressAdapter (
423
434
void *reader_context, const char *name, uint64_t name_length) {
424
435
SwiftReflectionInteropContextRef Context =
425
436
(SwiftReflectionInteropContextRef)reader_context;
@@ -692,7 +703,7 @@ swift_reflection_interop_typeRefForInstance(SwiftReflectionInteropContextRef Con
692
703
return Result;
693
704
}
694
705
695
- swift_typeref_interop_t
706
+ static inline swift_typeref_interop_t
696
707
swift_reflection_interop_typeRefForMangledTypeName (
697
708
SwiftReflectionInteropContextRef ContextRef,
698
709
const char *MangledName,
@@ -714,14 +725,14 @@ swift_reflection_interop_typeRefForMangledTypeName(
714
725
return Result;
715
726
}
716
727
717
- swift_typeinfo_t
728
+ static inline swift_typeinfo_t
718
729
swift_reflection_interop_infoForTypeRef (SwiftReflectionInteropContextRef ContextRef,
719
730
swift_typeref_interop_t OpaqueTypeRef) {
720
731
DECLARE_LIBRARY (OpaqueTypeRef.Library );
721
732
return Library->Functions .infoForTypeRef (Library->Context , OpaqueTypeRef.Typeref );
722
733
}
723
734
724
- swift_childinfo_t
735
+ static inline swift_childinfo_t
725
736
swift_reflection_interop_childOfTypeRef (SwiftReflectionInteropContextRef ContextRef,
726
737
swift_typeref_interop_t OpaqueTypeRef,
727
738
unsigned Index) {
@@ -731,22 +742,22 @@ swift_reflection_interop_childOfTypeRef(SwiftReflectionInteropContextRef Context
731
742
Index);
732
743
}
733
744
734
- swift_typeinfo_t
745
+ static inline swift_typeinfo_t
735
746
swift_reflection_interop_infoForMetadata (SwiftReflectionInteropContextRef ContextRef,
736
747
swift_metadata_interop_t Metadata) {
737
748
DECLARE_LIBRARY (Metadata.Library );
738
749
return Library->Functions .infoForMetadata (Library->Context , Metadata.Metadata );
739
750
}
740
751
741
- swift_childinfo_t
752
+ static inline swift_childinfo_t
742
753
swift_reflection_interop_childOfMetadata (SwiftReflectionInteropContextRef ContextRef,
743
754
swift_metadata_interop_t Metadata,
744
755
unsigned Index) {
745
756
DECLARE_LIBRARY (Metadata.Library );
746
757
return Library->Functions .childOfMetadata (Library->Context , Metadata.Metadata , Index);
747
758
}
748
759
749
- swift_typeinfo_t
760
+ static inline swift_typeinfo_t
750
761
swift_reflection_interop_infoForInstance (SwiftReflectionInteropContextRef ContextRef,
751
762
uintptr_t Object) {
752
763
swift_typeinfo_t Result = {};
@@ -765,7 +776,7 @@ swift_reflection_interop_infoForInstance(SwiftReflectionInteropContextRef Contex
765
776
return Result;
766
777
}
767
778
768
- swift_childinfo_t
779
+ static inline swift_childinfo_t
769
780
swift_reflection_interop_childOfInstance (SwiftReflectionInteropContextRef ContextRef,
770
781
uintptr_t Object,
771
782
unsigned Index) {
@@ -781,14 +792,14 @@ swift_reflection_interop_childOfInstance(SwiftReflectionInteropContextRef Contex
781
792
return Result;
782
793
}
783
794
784
- unsigned
795
+ static inline unsigned
785
796
swift_reflection_interop_genericArgumentCountOfTypeRef (
786
797
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef) {
787
798
DECLARE_LIBRARY (OpaqueTypeRef.Library );
788
799
return Library->Functions .genericArgumentCountOfTypeRef (OpaqueTypeRef.Typeref );
789
800
}
790
801
791
- swift_typeref_interop_t
802
+ static inline swift_typeref_interop_t
792
803
swift_reflection_interop_genericArgumentOfTypeRef (
793
804
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef,
794
805
unsigned Index) {
@@ -826,19 +837,22 @@ swift_reflection_interop_dumpTypeRef(SwiftReflectionInteropContextRef ContextRef
826
837
Library->Functions .dumpTypeRef (OpaqueTypeRef.Typeref );
827
838
}
828
839
829
- void swift_reflection_interop_dumpInfoForTypeRef (
840
+ static inline void
841
+ swift_reflection_interop_dumpInfoForTypeRef (
830
842
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef) {
831
843
DECLARE_LIBRARY (OpaqueTypeRef.Library );
832
844
Library->Functions .dumpInfoForTypeRef (Library->Context , OpaqueTypeRef.Typeref );
833
845
}
834
846
835
- void swift_reflection_interop_dumpInfoForMetadata (SwiftReflectionInteropContextRef ContextRef,
847
+ static inline void
848
+ swift_reflection_interop_dumpInfoForMetadata (SwiftReflectionInteropContextRef ContextRef,
836
849
swift_metadata_interop_t Metadata) {
837
850
DECLARE_LIBRARY (Metadata.Library );
838
851
Library->Functions .dumpInfoForMetadata (Library->Context , Metadata.Metadata );
839
852
}
840
853
841
- void swift_reflection_interop_dumpInfoForInstance (SwiftReflectionInteropContextRef ContextRef,
854
+ static inline void
855
+ swift_reflection_interop_dumpInfoForInstance (SwiftReflectionInteropContextRef ContextRef,
842
856
uintptr_t Object) {
843
857
FOREACH_LIBRARY {
844
858
if (!swift_reflection_interop_libraryOwnsObject (ContextRef, Library, Object))
@@ -849,11 +863,12 @@ void swift_reflection_interop_dumpInfoForInstance(SwiftReflectionInteropContextR
849
863
}
850
864
}
851
865
852
- size_t swift_reflection_interop_demangle (SwiftReflectionInteropContextRef ContextRef,
853
- const char *MangledName,
854
- size_t Length,
855
- char *OutDemangledName,
856
- size_t MaxLength) {
866
+ static inline size_t
867
+ swift_reflection_interop_demangle (SwiftReflectionInteropContextRef ContextRef,
868
+ const char *MangledName,
869
+ size_t Length,
870
+ char *OutDemangledName,
871
+ size_t MaxLength) {
857
872
FOREACH_LIBRARY {
858
873
return Library->Functions .demangle (MangledName, Length, OutDemangledName, MaxLength);
859
874
}
0 commit comments