mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-reflection-test: silence tautological warning
PE/COFF does not permit weak linking semantics. This means that the expression `&symbol == NULL` is tautologically false. In order to support this semantic, the symbol needs to be dynamically looked up at runtime. Since the ObjC runtime is not in use on Windows currently, just ignore this for the time being. Silences a warning from clang about the tautological comparison.
This commit is contained in:
@@ -575,11 +575,16 @@ int main(int argc, char *argv[]) {
|
||||
printUsageAndExit();
|
||||
|
||||
const char *BinaryFilename = argv[1];
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
// FIXME(compnerd) weak linking is not permitted on PE/COFF, we should fall
|
||||
// back to GetProcAddress to see if the symbol is present.
|
||||
#else
|
||||
// swift_reflection_classIsSwiftMask is weak linked so we can work
|
||||
// with older Remote Mirror dylibs.
|
||||
if (&swift_reflection_classIsSwiftMask != NULL)
|
||||
swift_reflection_classIsSwiftMask = computeClassIsSwiftMask();
|
||||
#endif
|
||||
|
||||
uint16_t Version = swift_reflection_getSupportedMetadataVersion();
|
||||
printf("Metadata version: %u\n", Version);
|
||||
|
||||
Reference in New Issue
Block a user