Skip to content

Commit 1271d89

Browse files
authored
Merge pull request #22241 from slavapestov/type-reconstruction-lldb-fix
Small ASTMangler tweak to make it work from lldb
2 parents 78d759a + fee5bc4 commit 1271d89

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/AST/ASTDemangler.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -802,16 +802,17 @@ ASTBuilder::findDeclContext(const Demangle::NodePointer &node) {
802802
return nullptr;
803803
}
804804

805+
// Do some special logic for foreign type declarations.
806+
if (privateDiscriminator.empty()) {
807+
if (auto foreignModuleKind = getForeignModuleKind(node->getChild(0))) {
808+
return findForeignTypeDecl(name, relatedEntityKind,
809+
foreignModuleKind.getValue(),
810+
node->getKind());
811+
}
812+
}
813+
805814
DeclContext *dc = findDeclContext(node->getChild(0));
806815
if (!dc) {
807-
// Do some backup logic for foreign type declarations.
808-
if (privateDiscriminator.empty()) {
809-
if (auto foreignModuleKind = getForeignModuleKind(node->getChild(0))) {
810-
return findForeignTypeDecl(name, relatedEntityKind,
811-
foreignModuleKind.getValue(),
812-
node->getKind());
813-
}
814-
}
815816
return nullptr;
816817
}
817818

0 commit comments

Comments
 (0)