Skip to content

Commit 6537df8

Browse files
authored
Merge pull request #9888 from adrian-prantl/143580031
Disable reading conformances on remote devices.
2 parents ff59629 + 30e44d9 commit 6537df8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,6 +3096,15 @@ SwiftLanguageRuntime::ResolveTypeAlias(CompilerType alias) {
30963096
ThreadSafeReflectionContext reflection_ctx = GetReflectionContext();
30973097
if (!reflection_ctx)
30983098
return llvm::createStringError("no reflection context");
3099+
3100+
// FIXME: The current implementation that loads all conformances
3101+
// up-front creates too much small memory traffic. As a stop-gap,
3102+
// disable the feature on remote devices.
3103+
auto &triple = GetProcess().GetTarget().GetArchitecture().GetTriple();
3104+
if (triple.isOSDarwin() && !triple.isTargetMachineMac())
3105+
return llvm::createStringError("conformance loading disabled on remote "
3106+
"devices for performance reasons");
3107+
30993108
for (const std::string &protocol : GetConformances(in_type)) {
31003109
auto *type_ref =
31013110
reflection_ctx->LookupTypeWitness(in_type, member, protocol);

0 commit comments

Comments
 (0)