@@ -3820,29 +3820,6 @@ void SwiftASTContext::CacheModule(swift::ModuleDecl *module) {
38203820 m_swift_module_cache.insert ({ID, module });
38213821}
38223822
3823- void SwiftASTContext::RegisterModuleABINameToRealName (
3824- swift::ModuleDecl *module ) {
3825- if (module ->getABIName () == module ->getName ())
3826- return ;
3827-
3828- // Ignore _Concurrency, which is hardcoded in the compiler and should be
3829- // looked up using its ABI name "Swift"
3830- if (module ->getName ().str () == swift::SWIFT_CONCURRENCY_NAME)
3831- return ;
3832-
3833- // Also ignore modules with the special "Compiler" prefix.
3834- if (module ->getABIName ().str ().starts_with (
3835- swift::SWIFT_MODULE_ABI_NAME_PREFIX))
3836- return ;
3837-
3838- LOG_PRINTF (GetLog (LLDBLog::Types),
3839- " Mapping module ABI name \" %s\" to its regular name \" %s\" " ,
3840- module ->getABIName ().str ().str ().c_str (),
3841- module ->getName ().str ().str ().c_str ());
3842- m_module_abi_to_regular_name.insert ({module ->getABIName ().str (),
3843- module ->getName ().str ()});
3844- }
3845-
38463823swift::ModuleDecl *SwiftASTContext::GetModule (const SourceModule &module ,
38473824 Status &error, bool *cached) {
38483825 if (cached)
@@ -3952,7 +3929,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const SourceModule &module,
39523929 module .path .front ().GetCString (),
39533930 module_decl->getName ().str ().str ().c_str ());
39543931
3955- RegisterModuleABINameToRealName (module_decl);
39563932 m_swift_module_cache[module .path .front ().GetStringRef ()] = module_decl;
39573933 return module_decl;
39583934}
@@ -4007,7 +3983,6 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const FileSpec &module_spec,
40073983 module_spec.GetPath ().c_str (),
40083984 module ->getName ().str ().str ().c_str ());
40093985
4010- RegisterModuleABINameToRealName (module );
40113986 m_swift_module_cache[module_basename.GetCString ()] = module ;
40123987 return module ;
40133988 } else {
@@ -4677,7 +4652,7 @@ SwiftASTContext::ReconstructTypeOrWarn(ConstString mangled_typename) {
46774652}
46784653
46794654llvm::Expected<swift::TypeBase *>
4680- SwiftASTContext::ReconstructTypeImpl (ConstString mangled_typename) {
4655+ SwiftASTContext::ReconstructType (ConstString mangled_typename) {
46814656 VALID_OR_RETURN (nullptr );
46824657
46834658 const char *mangled_cstr = mangled_typename.AsCString ();
@@ -4777,43 +4752,6 @@ SwiftASTContext::ReconstructTypeImpl(ConstString mangled_typename) {
47774752 " \" was not found" );
47784753}
47794754
4780- llvm::Expected<swift::TypeBase *>
4781- SwiftASTContext::ReconstructType (ConstString mangled_typename) {
4782- VALID_OR_RETURN (nullptr );
4783-
4784- // Mangled names are encoded with the ABI module name in debug info, but with
4785- // the regular module name in the swift module. When reconstructing these
4786- // types, SwiftASTContext must first substitute the ABI module name with the
4787- // regular one on the type's mangled name before attempting to reconstruct
4788- // them.
4789- auto mangling = TypeSystemSwiftTypeRef::TransformModuleName (
4790- mangled_typename, m_module_abi_to_regular_name);
4791- ConstString module_adjusted_mangled_typename;
4792- if (mangling.isSuccess ())
4793- module_adjusted_mangled_typename = ConstString (mangling.result ());
4794-
4795- if (mangled_typename == module_adjusted_mangled_typename)
4796- return ReconstructTypeImpl (mangled_typename);
4797-
4798- // If the mangles names don't match, try the one with the module's regular
4799- // name first.
4800- auto result = ReconstructTypeImpl (module_adjusted_mangled_typename);
4801-
4802- if (result)
4803- return result;
4804-
4805- auto error = llvm::toString (result.takeError ());
4806- LOG_PRINTF (
4807- GetLog (LLDBLog::Types),
4808- " Reconstruct type failed for adjusted type: \" %s\" with error: \" %s\" " ,
4809- module_adjusted_mangled_typename.GetCString (), error.c_str ());
4810-
4811- // If the mangled name with the regular name fails, try the one with the ABI
4812- // name. This could happen if a module's ABI name is the same as another
4813- // module's regular name.
4814- return ReconstructTypeImpl (mangled_typename);
4815- }
4816-
48174755CompilerType SwiftASTContext::GetAnyObjectType () {
48184756 VALID_OR_RETURN (CompilerType ());
48194757 ThreadSafeASTContext ast = GetASTContext ();
0 commit comments