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:
Saleem Abdulrasool
2019-06-02 11:34:38 -07:00
parent c9bdd3a19f
commit 7b1f732b1d

View File

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