Skip to content

Commit 3936cd2

Browse files
committed
Reflection: swift-reflection-dump now only needs a TypeRefBuilder and not a ReflectionContext, NFC
Since swift-reflection-dump does not have a remote address space, it doesn't need a full ReflectionContext. Now that TypeRefBuilder has been refactored, we can use that instead.
1 parent d184122 commit 3936cd2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tools/swift-reflection-dump/swift-reflection-dump.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
#include "swift/ABI/MetadataValues.h"
1717
#include "swift/Basic/Demangle.h"
1818
#include "swift/Basic/LLVMInitialize.h"
19-
#include "swift/Reflection/ReflectionContext.h"
20-
#include "swift/Remote/InProcessMemoryReader.h"
2119
#include "swift/Reflection/TypeRef.h"
20+
#include "swift/Reflection/TypeRefBuilder.h"
2221
#include "llvm/Object/Archive.h"
2322
#include "llvm/Object/MachO.h"
2423
#include "llvm/Object/MachOUniversal.h"
@@ -204,10 +203,9 @@ static int doDumpReflectionSections(std::string binaryFilename,
204203
reinterpret_cast<const void *>(reflectionStringsSectionContents.end())
205204
};
206205

207-
// Construct the reflection context
208-
auto reader = std::make_shared<InProcessMemoryReader>();
209-
ReflectionContext<External<RuntimeTarget<8>>> RC(reader);
210-
RC.addReflectionInfo({
206+
// Construct the TypeRefBuilder
207+
TypeRefBuilder builder;
208+
builder.addReflectionInfo({
211209
binaryFilename,
212210
fieldSection,
213211
associatedTypeSection,
@@ -217,7 +215,7 @@ static int doDumpReflectionSections(std::string binaryFilename,
217215
});
218216

219217
// Dump everything
220-
RC.dumpAllSections(std::cout);
218+
builder.dumpAllSections(std::cout);
221219

222220
return EXIT_SUCCESS;
223221
}

0 commit comments

Comments
 (0)