@@ -3977,29 +3977,6 @@ void SwiftASTContext::CacheModule(swift::ModuleDecl *module) {
39773977 m_swift_module_cache.insert ({ID, module });
39783978}
39793979
3980- void SwiftASTContext::RegisterModuleABINameToRealName (
3981- swift::ModuleDecl *module ) {
3982- if (module ->getABIName () == module ->getName ())
3983- return ;
3984-
3985- // Ignore _Concurrency, which is hardcoded in the compiler and should be
3986- // looked up using its ABI name "Swift"
3987- if (module ->getName ().str () == swift::SWIFT_CONCURRENCY_NAME)
3988- return ;
3989-
3990- // Also ignore modules with the special "Compiler" prefix.
3991- if (module ->getABIName ().str ().starts_with (
3992- swift::SWIFT_MODULE_ABI_NAME_PREFIX))
3993- return ;
3994-
3995- LOG_PRINTF (GetLog (LLDBLog::Types),
3996- " Mapping module ABI name \" %s\" to its regular name \" %s\" " ,
3997- module ->getABIName ().str ().str ().c_str (),
3998- module ->getName ().str ().str ().c_str ());
3999- m_module_abi_to_regular_name.insert ({module ->getABIName ().str (),
4000- module ->getName ().str ()});
4001- }
4002-
40033980swift::ModuleDecl *SwiftASTContext::GetModule (const SourceModule &module ,
40043981 Status &error, bool *cached) {
40053982 if (cached)
@@ -4109,7 +4086,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const SourceModule &module,
41094086 module .path .front ().GetCString (),
41104087 module_decl->getName ().str ().str ().c_str ());
41114088
4112- RegisterModuleABINameToRealName (module_decl);
41134089 m_swift_module_cache[module .path .front ().GetStringRef ()] = module_decl;
41144090 return module_decl;
41154091}
@@ -4164,7 +4140,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const FileSpec &module_spec,
41644140 module_spec.GetPath ().c_str (),
41654141 module ->getName ().str ().str ().c_str ());
41664142
4167- RegisterModuleABINameToRealName (module );
41684143 m_swift_module_cache[module_basename.GetCString ()] = module ;
41694144 return module ;
41704145 } else {
@@ -4833,7 +4808,7 @@ SwiftASTContext::ReconstructTypeOrWarn(ConstString mangled_typename) {
48334808}
48344809
48354810llvm::Expected<swift::TypeBase *>
4836- SwiftASTContext::ReconstructTypeImpl (ConstString mangled_typename) {
4811+ SwiftASTContext::ReconstructType (ConstString mangled_typename) {
48374812 VALID_OR_RETURN (nullptr );
48384813
48394814 const char *mangled_cstr = mangled_typename.AsCString ();
@@ -4939,43 +4914,6 @@ SwiftASTContext::ReconstructTypeImpl(ConstString mangled_typename) {
49394914 " \" was not found" );
49404915}
49414916
4942- llvm::Expected<swift::TypeBase *>
4943- SwiftASTContext::ReconstructType (ConstString mangled_typename) {
4944- VALID_OR_RETURN (nullptr );
4945-
4946- // Mangled names are encoded with the ABI module name in debug info, but with
4947- // the regular module name in the swift module. When reconstructing these
4948- // types, SwiftASTContext must first substitute the ABI module name with the
4949- // regular one on the type's mangled name before attempting to reconstruct
4950- // them.
4951- auto mangling = TypeSystemSwiftTypeRef::TransformModuleName (
4952- mangled_typename, m_module_abi_to_regular_name);
4953- ConstString module_adjusted_mangled_typename;
4954- if (mangling.isSuccess ())
4955- module_adjusted_mangled_typename = ConstString (mangling.result ());
4956-
4957- if (mangled_typename == module_adjusted_mangled_typename)
4958- return ReconstructTypeImpl (mangled_typename);
4959-
4960- // If the mangles names don't match, try the one with the module's regular
4961- // name first.
4962- auto result = ReconstructTypeImpl (module_adjusted_mangled_typename);
4963-
4964- if (result)
4965- return result;
4966-
4967- auto error = llvm::toString (result.takeError ());
4968- LOG_PRINTF (
4969- GetLog (LLDBLog::Types),
4970- " Reconstruct type failed for adjusted type: \" %s\" with error: \" %s\" " ,
4971- module_adjusted_mangled_typename.GetCString (), error.c_str ());
4972-
4973- // If the mangled name with the regular name fails, try the one with the ABI
4974- // name. This could happen if a module's ABI name is the same as another
4975- // module's regular name.
4976- return ReconstructTypeImpl (mangled_typename);
4977- }
4978-
49794917CompilerType SwiftASTContext::GetAnyObjectType () {
49804918 VALID_OR_RETURN (CompilerType ());
49814919 ThreadSafeASTContext ast = GetASTContext ();
0 commit comments