mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Account for multiple modules when looking up the DeclContext of a type
When looking up the decl context of a type, ASTDemangler has to take into account that there are multiple different modules where that type could've come from. This is due to two facts: - Thanks to the `-module-abi-name` flag, multiple modules can share the same ABI name (which is the module name that is usually used when mangling a type). - In some situations mangling can use the module's real name, for example, when mangling for the debugger or USRs coupled with @_originallyDefinedIn. rdar://134095412
This commit is contained in:
@@ -1956,6 +1956,11 @@ Identifier ModuleDecl::getABIName() const {
|
||||
return getName();
|
||||
}
|
||||
|
||||
void ModuleDecl::setABIName(Identifier name) {
|
||||
getASTContext().moduleABINameWillChange(this, name);
|
||||
ModuleABIName = name;
|
||||
}
|
||||
|
||||
StringRef ModuleDecl::getModuleFilename() const {
|
||||
// FIXME: Audit uses of this function and figure out how to migrate them to
|
||||
// per-file names. Modules can consist of more than one file.
|
||||
|
||||
Reference in New Issue
Block a user