@@ -3813,29 +3813,6 @@ void SwiftASTContext::CacheModule(swift::ModuleDecl *module) {
38133813 m_swift_module_cache.insert ({ID, module });
38143814}
38153815
3816- void SwiftASTContext::RegisterModuleABINameToRealName (
3817- swift::ModuleDecl *module ) {
3818- if (module ->getABIName () == module ->getName ())
3819- return ;
3820-
3821- // Ignore _Concurrency, which is hardcoded in the compiler and should be
3822- // looked up using its ABI name "Swift"
3823- if (module ->getName ().str () == swift::SWIFT_CONCURRENCY_NAME)
3824- return ;
3825-
3826- // Also ignore modules with the special "Compiler" prefix.
3827- if (module ->getABIName ().str ().starts_with (
3828- swift::SWIFT_MODULE_ABI_NAME_PREFIX))
3829- return ;
3830-
3831- LOG_PRINTF (GetLog (LLDBLog::Types),
3832- " Mapping module ABI name \" %s\" to its regular name \" %s\" " ,
3833- module ->getABIName ().str ().str ().c_str (),
3834- module ->getName ().str ().str ().c_str ());
3835- m_module_abi_to_regular_name.insert ({module ->getABIName ().str (),
3836- module ->getName ().str ()});
3837- }
3838-
38393816swift::ModuleDecl *SwiftASTContext::GetModule (const SourceModule &module ,
38403817 Status &error, bool *cached) {
38413818 if (cached)
@@ -3945,7 +3922,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const SourceModule &module,
39453922 module .path .front ().GetCString (),
39463923 module_decl->getName ().str ().str ().c_str ());
39473924
3948- RegisterModuleABINameToRealName (module_decl);
39493925 m_swift_module_cache[module .path .front ().GetStringRef ()] = module_decl;
39503926 return module_decl;
39513927}
@@ -4000,7 +3976,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const FileSpec &module_spec,
40003976 module_spec.GetPath ().c_str (),
40013977 module ->getName ().str ().str ().c_str ());
40023978
4003- RegisterModuleABINameToRealName (module );
40043979 m_swift_module_cache[module_basename.GetCString ()] = module ;
40053980 return module ;
40063981 } else {
@@ -4670,7 +4645,7 @@ SwiftASTContext::ReconstructTypeOrWarn(ConstString mangled_typename) {
46704645}
46714646
46724647llvm::Expected<swift::TypeBase *>
4673- SwiftASTContext::ReconstructTypeImpl (ConstString mangled_typename) {
4648+ SwiftASTContext::ReconstructType (ConstString mangled_typename) {
46744649 VALID_OR_RETURN (nullptr );
46754650
46764651 const char *mangled_cstr = mangled_typename.AsCString ();
@@ -4770,43 +4745,6 @@ SwiftASTContext::ReconstructTypeImpl(ConstString mangled_typename) {
47704745 " \" was not found" );
47714746}
47724747
4773- llvm::Expected<swift::TypeBase *>
4774- SwiftASTContext::ReconstructType (ConstString mangled_typename) {
4775- VALID_OR_RETURN (nullptr );
4776-
4777- // Mangled names are encoded with the ABI module name in debug info, but with
4778- // the regular module name in the swift module. When reconstructing these
4779- // types, SwiftASTContext must first substitute the ABI module name with the
4780- // regular one on the type's mangled name before attempting to reconstruct
4781- // them.
4782- auto mangling = TypeSystemSwiftTypeRef::TransformModuleName (
4783- mangled_typename, m_module_abi_to_regular_name);
4784- ConstString module_adjusted_mangled_typename;
4785- if (mangling.isSuccess ())
4786- module_adjusted_mangled_typename = ConstString (mangling.result ());
4787-
4788- if (mangled_typename == module_adjusted_mangled_typename)
4789- return ReconstructTypeImpl (mangled_typename);
4790-
4791- // If the mangles names don't match, try the one with the module's regular
4792- // name first.
4793- auto result = ReconstructTypeImpl (module_adjusted_mangled_typename);
4794-
4795- if (result)
4796- return result;
4797-
4798- auto error = llvm::toString (result.takeError ());
4799- LOG_PRINTF (
4800- GetLog (LLDBLog::Types),
4801- " Reconstruct type failed for adjusted type: \" %s\" with error: \" %s\" " ,
4802- module_adjusted_mangled_typename.GetCString (), error.c_str ());
4803-
4804- // If the mangled name with the regular name fails, try the one with the ABI
4805- // name. This could happen if a module's ABI name is the same as another
4806- // module's regular name.
4807- return ReconstructTypeImpl (mangled_typename);
4808- }
4809-
48104748CompilerType SwiftASTContext::GetAnyObjectType () {
48114749 VALID_OR_RETURN (CompilerType ());
48124750 ThreadSafeASTContext ast = GetASTContext ();
0 commit comments