Skip to content

Commit ce62951

Browse files
author
Robert Widmann
committed
Teach The AST Demangler About Module ABI Names
Use the current module's ABI name to resolve references in mangled names. This is a targeted fix for a more general problem of opaque result types from protocols that have moved modules with @_originallyDefinedIn. Resolves rdar://119212609
1 parent 61326af commit ce62951

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/AST/ASTDemangler.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,10 @@ ASTBuilder::createTypeDecl(NodePointer node,
10311031
ModuleDecl *
10321032
ASTBuilder::findModule(NodePointer node) {
10331033
assert(node->getKind() == Demangle::Node::Kind::Module);
1034-
const auto &moduleName = node->getText();
1034+
const auto moduleName = node->getText();
1035+
if (Ctx.MainModule && Ctx.MainModule->getABIName().is(moduleName))
1036+
return Ctx.MainModule;
1037+
10351038
return Ctx.getModuleByName(moduleName);
10361039
}
10371040

0 commit comments

Comments
 (0)