Skip to content

Commit c01b9e0

Browse files
committed
[RemoteMirrors] Fix a bunch of missing static inlines from SwiftRemoteMirrorLegacyInterop.h.
1 parent a2d973d commit c01b9e0

File tree

1 file changed

+62
-47
lines changed

1 file changed

+62
-47
lines changed

include/swift/SwiftRemoteMirror/SwiftRemoteMirrorLegacyInterop.h

Lines changed: 62 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -63,44 +63,44 @@ static inline swift_typeref_interop_t
6363
swift_reflection_interop_typeRefForInstance(SwiftReflectionInteropContextRef ContextRef,
6464
uintptr_t Object);
6565

66-
swift_typeref_interop_t
66+
static inline swift_typeref_interop_t
6767
swift_reflection_interop_typeRefForMangledTypeName(
6868
SwiftReflectionInteropContextRef ContextRef,
6969
const char *MangledName,
7070
uint64_t Length);
7171

72-
swift_typeinfo_t
72+
static inline swift_typeinfo_t
7373
swift_reflection_interop_infoForTypeRef(SwiftReflectionInteropContextRef ContextRef,
7474
swift_typeref_interop_t OpaqueTypeRef);
7575

76-
swift_childinfo_t
76+
static inline swift_childinfo_t
7777
swift_reflection_interop_childOfTypeRef(SwiftReflectionInteropContextRef ContextRef,
7878
swift_typeref_interop_t OpaqueTypeRef,
7979
unsigned Index);
8080

81-
swift_typeinfo_t
81+
static inline swift_typeinfo_t
8282
swift_reflection_interop_infoForMetadata(SwiftReflectionInteropContextRef ContextRef,
8383
swift_metadata_interop_t Metadata);
8484

85-
swift_childinfo_t
85+
static inline swift_childinfo_t
8686
swift_reflection_interop_childOfMetadata(SwiftReflectionInteropContextRef ContextRef,
8787
swift_metadata_interop_t Metadata,
8888
unsigned Index);
8989

90-
swift_typeinfo_t
90+
static inline swift_typeinfo_t
9191
swift_reflection_interop_infoForInstance(SwiftReflectionInteropContextRef ContextRef,
9292
uintptr_t Object);
9393

94-
swift_childinfo_t
94+
static inline swift_childinfo_t
9595
swift_reflection_interop_childOfInstance(SwiftReflectionInteropContextRef ContextRef,
9696
uintptr_t Object,
9797
unsigned Index);
9898

99-
unsigned
99+
static inline unsigned
100100
swift_reflection_interop_genericArgumentCountOfTypeRef(
101101
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef);
102102

103-
swift_typeref_interop_t
103+
static inline swift_typeref_interop_t
104104
swift_reflection_interop_genericArgumentOfTypeRef(
105105
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef,
106106
unsigned Index);
@@ -116,20 +116,24 @@ static inline void
116116
swift_reflection_interop_dumpTypeRef(SwiftReflectionInteropContextRef ContextRef,
117117
swift_typeref_interop_t OpaqueTypeRef);
118118

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);
121122

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);
124126

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);
127130

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);
133137

134138

135139

@@ -292,7 +296,8 @@ struct SwiftReflectionInteropContext {
292296
#define DECLARE_LIBRARY(index) \
293297
struct SwiftReflectionInteropContextLibrary *Library = &ContextRef->Libraries[index]
294298

295-
static inline int swift_reflection_interop_libraryOwnsObject(
299+
static inline int
300+
swift_reflection_interop_libraryOwnsObject(
296301
struct SwiftReflectionInteropContext *ContextRef,
297302
struct SwiftReflectionInteropContextLibrary *Library,
298303
uintptr_t Object) {
@@ -325,8 +330,10 @@ static inline int swift_reflection_interop_libraryOwnsObject(
325330
return 0;
326331
}
327332

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) {
330337
if (Handle == NULL)
331338
return;
332339

@@ -388,10 +395,11 @@ static inline void swift_reflection_interop_loadFunctions(
388395
#endif
389396
}
390397

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) {
395403
SwiftReflectionInteropContextRef Context =
396404
(SwiftReflectionInteropContextRef)reader_context;
397405

@@ -407,19 +415,22 @@ static int swift_reflection_interop_readBytesAdapter(void *reader_context,
407415
return 1;
408416
}
409417

410-
static uint8_t swift_reflection_interop_getSizeAdapter(void *reader_context) {
418+
static inline uint8_t
419+
swift_reflection_interop_getSizeAdapter(void *reader_context) {
411420
// Legacy library doesn't pay attention to these anyway.
412421
return sizeof(void *);
413422
}
414423

415-
static uint64_t swift_reflection_interop_GetStringLengthAdapter(
424+
static inline uint64_t
425+
swift_reflection_interop_GetStringLengthAdapter(
416426
void *reader_context, swift_addr_t address) {
417427
SwiftReflectionInteropContextRef Context =
418428
(SwiftReflectionInteropContextRef)reader_context;
419429
return Context->GetStringLength(Context->ReaderContext, address);
420430
}
421431

422-
static swift_addr_t swift_reflection_interop_GetSymbolAddressAdapter(
432+
static inline swift_addr_t
433+
swift_reflection_interop_GetSymbolAddressAdapter(
423434
void *reader_context, const char *name, uint64_t name_length) {
424435
SwiftReflectionInteropContextRef Context =
425436
(SwiftReflectionInteropContextRef)reader_context;
@@ -692,7 +703,7 @@ swift_reflection_interop_typeRefForInstance(SwiftReflectionInteropContextRef Con
692703
return Result;
693704
}
694705

695-
swift_typeref_interop_t
706+
static inline swift_typeref_interop_t
696707
swift_reflection_interop_typeRefForMangledTypeName(
697708
SwiftReflectionInteropContextRef ContextRef,
698709
const char *MangledName,
@@ -714,14 +725,14 @@ swift_reflection_interop_typeRefForMangledTypeName(
714725
return Result;
715726
}
716727

717-
swift_typeinfo_t
728+
static inline swift_typeinfo_t
718729
swift_reflection_interop_infoForTypeRef(SwiftReflectionInteropContextRef ContextRef,
719730
swift_typeref_interop_t OpaqueTypeRef) {
720731
DECLARE_LIBRARY(OpaqueTypeRef.Library);
721732
return Library->Functions.infoForTypeRef(Library->Context, OpaqueTypeRef.Typeref);
722733
}
723734

724-
swift_childinfo_t
735+
static inline swift_childinfo_t
725736
swift_reflection_interop_childOfTypeRef(SwiftReflectionInteropContextRef ContextRef,
726737
swift_typeref_interop_t OpaqueTypeRef,
727738
unsigned Index) {
@@ -731,22 +742,22 @@ swift_reflection_interop_childOfTypeRef(SwiftReflectionInteropContextRef Context
731742
Index);
732743
}
733744

734-
swift_typeinfo_t
745+
static inline swift_typeinfo_t
735746
swift_reflection_interop_infoForMetadata(SwiftReflectionInteropContextRef ContextRef,
736747
swift_metadata_interop_t Metadata) {
737748
DECLARE_LIBRARY(Metadata.Library);
738749
return Library->Functions.infoForMetadata(Library->Context, Metadata.Metadata);
739750
}
740751

741-
swift_childinfo_t
752+
static inline swift_childinfo_t
742753
swift_reflection_interop_childOfMetadata(SwiftReflectionInteropContextRef ContextRef,
743754
swift_metadata_interop_t Metadata,
744755
unsigned Index) {
745756
DECLARE_LIBRARY(Metadata.Library);
746757
return Library->Functions.childOfMetadata(Library->Context, Metadata.Metadata, Index);
747758
}
748759

749-
swift_typeinfo_t
760+
static inline swift_typeinfo_t
750761
swift_reflection_interop_infoForInstance(SwiftReflectionInteropContextRef ContextRef,
751762
uintptr_t Object) {
752763
swift_typeinfo_t Result = {};
@@ -765,7 +776,7 @@ swift_reflection_interop_infoForInstance(SwiftReflectionInteropContextRef Contex
765776
return Result;
766777
}
767778

768-
swift_childinfo_t
779+
static inline swift_childinfo_t
769780
swift_reflection_interop_childOfInstance(SwiftReflectionInteropContextRef ContextRef,
770781
uintptr_t Object,
771782
unsigned Index) {
@@ -781,14 +792,14 @@ swift_reflection_interop_childOfInstance(SwiftReflectionInteropContextRef Contex
781792
return Result;
782793
}
783794

784-
unsigned
795+
static inline unsigned
785796
swift_reflection_interop_genericArgumentCountOfTypeRef(
786797
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef) {
787798
DECLARE_LIBRARY(OpaqueTypeRef.Library);
788799
return Library->Functions.genericArgumentCountOfTypeRef(OpaqueTypeRef.Typeref);
789800
}
790801

791-
swift_typeref_interop_t
802+
static inline swift_typeref_interop_t
792803
swift_reflection_interop_genericArgumentOfTypeRef(
793804
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef,
794805
unsigned Index) {
@@ -826,19 +837,22 @@ swift_reflection_interop_dumpTypeRef(SwiftReflectionInteropContextRef ContextRef
826837
Library->Functions.dumpTypeRef(OpaqueTypeRef.Typeref);
827838
}
828839

829-
void swift_reflection_interop_dumpInfoForTypeRef(
840+
static inline void
841+
swift_reflection_interop_dumpInfoForTypeRef(
830842
SwiftReflectionInteropContextRef ContextRef, swift_typeref_interop_t OpaqueTypeRef) {
831843
DECLARE_LIBRARY(OpaqueTypeRef.Library);
832844
Library->Functions.dumpInfoForTypeRef(Library->Context, OpaqueTypeRef.Typeref);
833845
}
834846

835-
void swift_reflection_interop_dumpInfoForMetadata(SwiftReflectionInteropContextRef ContextRef,
847+
static inline void
848+
swift_reflection_interop_dumpInfoForMetadata(SwiftReflectionInteropContextRef ContextRef,
836849
swift_metadata_interop_t Metadata) {
837850
DECLARE_LIBRARY(Metadata.Library);
838851
Library->Functions.dumpInfoForMetadata(Library->Context, Metadata.Metadata);
839852
}
840853

841-
void swift_reflection_interop_dumpInfoForInstance(SwiftReflectionInteropContextRef ContextRef,
854+
static inline void
855+
swift_reflection_interop_dumpInfoForInstance(SwiftReflectionInteropContextRef ContextRef,
842856
uintptr_t Object) {
843857
FOREACH_LIBRARY {
844858
if (!swift_reflection_interop_libraryOwnsObject(ContextRef, Library, Object))
@@ -849,11 +863,12 @@ void swift_reflection_interop_dumpInfoForInstance(SwiftReflectionInteropContextR
849863
}
850864
}
851865

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) {
857872
FOREACH_LIBRARY {
858873
return Library->Functions.demangle(MangledName, Length, OutDemangledName, MaxLength);
859874
}

0 commit comments

Comments
 (0)