Files
swift-mirror/test/Serialization/Recovery/Inputs/custom-modules/RenameAcrossVersions.h
Jordan Rose ec90545ff2 [Serialization] Follow compatibility typealiases for non-generic types (#16618)
Now that we use the C names of imported types in mangled names, it's
safe to resolve a compatibility alias when a type gets an
NS_SWIFT_NAME for the first time, rather than requiring the developer
to recompile the imported library.

This doesn't include generic types, which only applies for Objective-C
generics. There shouldn't be additional complications here but I want
to be extra careful.

rdar://problem/39661212
2018-05-15 10:04:40 -07:00

23 lines
474 B
C

#if NEW
# define NEW_NAME(x) __attribute__((swift_name(#x)))
#else
# define NEW_NAME(x)
#endif
struct BeforeStruct {
int value;
} NEW_NAME(AfterStruct);
typedef int BeforeTypedef NEW_NAME(AfterTypedef);
typedef int BeforeWrappedTypedef __attribute__((swift_wrapper(struct))) NEW_NAME(AfterWrappedTypedef);
#if NEW
typedef struct DifferentStruct {
int value;
} BeforeReplacedType NEW_NAME(AfterReplacedType);
#else
struct BeforeReplacedType {
float value;
};
#endif