Skip to content

Commit 30e44d9

Browse files
committed
[lldb] Disable reading conformances on remote devices.
This is a stop-gap to prevent a very expensive operation on remote devices. This degrades the experience to what it was on the 6.0 branch, while preserving the functionality when debugging locally and on a simulator. rdar://143580031
1 parent 5f7c906 commit 30e44d9

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)