Skip to content

Commit 35c31e7

Browse files
authored
[lldb] Do not print qualified lldb module names. (#25708)
Non-robust fix for `use of undeclared type '__lldb_expr_'` errors in the REPL. Patch for TF-590.
1 parent af0e78f commit 35c31e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,6 +3509,22 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
35093509
}
35103510

35113511
bool shouldPrintFullyQualified(TypeBase *T) {
3512+
// SWIFT_ENABLE_TENSORFLOW
3513+
// NOTE(TF-590): Workaround for REPL qualified module name bug.
3514+
// Do not print qualified LLDB module names.
3515+
{
3516+
Decl *D;
3517+
if (auto *TAT = dyn_cast<TypeAliasType>(T))
3518+
D = TAT->getDecl();
3519+
else
3520+
D = T->getAnyGeneric();
3521+
3522+
ModuleDecl *M = D->getDeclContext()->getParentModule();
3523+
if (isLLDBExpressionModule(M))
3524+
return false;
3525+
}
3526+
// SWIFT_ENABLE_TENSORFLOW END
3527+
35123528
if (Options.FullyQualifiedTypes)
35133529
return true;
35143530

0 commit comments

Comments
 (0)