[RemoteMirrors] Don't use addImage in swift-reflection-dump, it doesn't work if the target bitness doesn't match our bitness.

This commit is contained in:
Mike Ash
2018-03-02 15:30:57 -05:00
parent 9a27add5f8
commit 4852d57663

View File

@@ -83,7 +83,6 @@ static T unwrap(llvm::Expected<T> value) {
exit(EXIT_FAILURE);
}
#if !(defined(__APPLE__) && defined(__MACH__))
static SectionRef getSectionRef(const ObjectFile *objectFile,
ArrayRef<StringRef> anySectionNames) {
for (auto section : objectFile->sections()) {
@@ -150,7 +149,6 @@ static ReflectionInfo findReflectionInfo(const ObjectFile *objectFile) {
/*RemoteStartAddress*/ startAddress,
};
}
#endif // defined(__APPLE__) && defined(__MACH__)
using NativeReflectionContext
= ReflectionContext<External<RuntimeTarget<sizeof(uintptr_t)>>>;
@@ -253,11 +251,7 @@ static int doDumpReflectionSections(ArrayRef<std::string> binaryFilenames,
objectOwners.push_back(std::move(objectOwner));
objectFiles.push_back(objectFile);
#if defined(__APPLE__) && defined(__MACH__)
context.addImage(RemoteAddress((uint64_t)(objectFile->getData().begin())));
#else
context.addReflectionInfo(findReflectionInfo(objectFile));
#endif
}
switch (action) {