@@ -3986,29 +3986,6 @@ void SwiftASTContext::CacheModule(swift::ModuleDecl *module) {
39863986 m_swift_module_cache.insert ({ID, module });
39873987}
39883988
3989- void SwiftASTContext::RegisterModuleABINameToRealName (
3990- swift::ModuleDecl *module ) {
3991- if (module ->getABIName () == module ->getName ())
3992- return ;
3993-
3994- // Ignore _Concurrency, which is hardcoded in the compiler and should be
3995- // looked up using its ABI name "Swift"
3996- if (module ->getName ().str () == swift::SWIFT_CONCURRENCY_NAME)
3997- return ;
3998-
3999- // Also ignore modules with the special "Compiler" prefix.
4000- if (module ->getABIName ().str ().starts_with (
4001- swift::SWIFT_MODULE_ABI_NAME_PREFIX))
4002- return ;
4003-
4004- LOG_PRINTF (GetLog (LLDBLog::Types),
4005- " Mapping module ABI name \" %s\" to its regular name \" %s\" " ,
4006- module ->getABIName ().str ().str ().c_str (),
4007- module ->getName ().str ().str ().c_str ());
4008- m_module_abi_to_regular_name.insert ({module ->getABIName ().str (),
4009- module ->getName ().str ()});
4010- }
4011-
40123989swift::ModuleDecl *SwiftASTContext::GetModule (const SourceModule &module ,
40133990 Status &error, bool *cached) {
40143991 if (cached)
@@ -4118,7 +4095,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const SourceModule &module,
41184095 module .path .front ().GetCString (),
41194096 module_decl->getName ().str ().str ().c_str ());
41204097
4121- RegisterModuleABINameToRealName (module_decl);
41224098 m_swift_module_cache[module .path .front ().GetStringRef ()] = module_decl;
41234099 return module_decl;
41244100}
@@ -4173,7 +4149,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const FileSpec &module_spec,
41734149 module_spec.GetPath ().c_str (),
41744150 module ->getName ().str ().str ().c_str ());
41754151
4176- RegisterModuleABINameToRealName (module );
41774152 m_swift_module_cache[module_basename.GetCString ()] = module ;
41784153 return module ;
41794154 } else {
@@ -4842,7 +4817,7 @@ SwiftASTContext::ReconstructTypeOrWarn(ConstString mangled_typename) {
48424817}
48434818
48444819llvm::Expected<swift::TypeBase *>
4845- SwiftASTContext::ReconstructTypeImpl (ConstString mangled_typename) {
4820+ SwiftASTContext::ReconstructType (ConstString mangled_typename) {
48464821 VALID_OR_RETURN (nullptr );
48474822
48484823 const char *mangled_cstr = mangled_typename.AsCString ();
@@ -4948,43 +4923,6 @@ SwiftASTContext::ReconstructTypeImpl(ConstString mangled_typename) {
49484923 " \" was not found" );
49494924}
49504925
4951- llvm::Expected<swift::TypeBase *>
4952- SwiftASTContext::ReconstructType (ConstString mangled_typename) {
4953- VALID_OR_RETURN (nullptr );
4954-
4955- // Mangled names are encoded with the ABI module name in debug info, but with
4956- // the regular module name in the swift module. When reconstructing these
4957- // types, SwiftASTContext must first substitute the ABI module name with the
4958- // regular one on the type's mangled name before attempting to reconstruct
4959- // them.
4960- auto mangling = TypeSystemSwiftTypeRef::TransformModuleName (
4961- mangled_typename, m_module_abi_to_regular_name);
4962- ConstString module_adjusted_mangled_typename;
4963- if (mangling.isSuccess ())
4964- module_adjusted_mangled_typename = ConstString (mangling.result ());
4965-
4966- if (mangled_typename == module_adjusted_mangled_typename)
4967- return ReconstructTypeImpl (mangled_typename);
4968-
4969- // If the mangles names don't match, try the one with the module's regular
4970- // name first.
4971- auto result = ReconstructTypeImpl (module_adjusted_mangled_typename);
4972-
4973- if (result)
4974- return result;
4975-
4976- auto error = llvm::toString (result.takeError ());
4977- LOG_PRINTF (
4978- GetLog (LLDBLog::Types),
4979- " Reconstruct type failed for adjusted type: \" %s\" with error: \" %s\" " ,
4980- module_adjusted_mangled_typename.GetCString (), error.c_str ());
4981-
4982- // If the mangled name with the regular name fails, try the one with the ABI
4983- // name. This could happen if a module's ABI name is the same as another
4984- // module's regular name.
4985- return ReconstructTypeImpl (mangled_typename);
4986- }
4987-
49884926CompilerType SwiftASTContext::GetAnyObjectType () {
49894927 VALID_OR_RETURN (CompilerType ());
49904928 ThreadSafeASTContext ast = GetASTContext ();
0 commit comments