Split swift-refleciton-test into host and target test targets

swift-reflection-test is now the test that forks a swift executable
and performs remote reflection, making it runnable on other targets,
such as the iOS simulator.

swift-reflection-dump is now a host-side tool that dumps the remote
reflection sections for any platform binary and will continue to
link in LLVM object file support.

This necessitates finally moving lib/Refleciton into stdlib/public,
since we're linking target-specific versions of the test tool and
we would eventually like to adopt some of this functionality in
the runtime anyway.
This commit is contained in:
David Farler
2016-03-28 12:24:41 -07:00
parent 884155c09c
commit 5ea5bb06a3
21 changed files with 300 additions and 248 deletions

View File

@@ -187,8 +187,8 @@ internal func sendReflectionInfos() {
for info in infos {
debugLog("Sending info for \(info.imageName)")
let imageNameBytes = Array(info.imageName.utf8)
var imageNameLength = UInt64(imageNameBytes.count)
fwrite(&imageNameLength, sizeof(UInt64.self), 1, stdout)
var imageNameLength = UInt(imageNameBytes.count)
fwrite(&imageNameLength, sizeof(UInt.self), 1, stdout)
fflush(stdout)
fwrite(imageNameBytes, 1, imageNameBytes.count, stdout)
fflush(stdout)
@@ -235,7 +235,7 @@ internal func sendSymbolAddress() {
name.withCString {
let handle = unsafeBitCast(Int(-2), to: UnsafeMutablePointer<Void>.self)
let symbol = dlsym(handle, $0)
let symbolAddress = unsafeBitCast(symbol, to: UInt64.self)
let symbolAddress = unsafeBitCast(symbol, to: UInt.self)
sendValue(symbolAddress)
}
}