From f86bbacbd3a469bfb6b9dce6d917b11f4fca9703 Mon Sep 17 00:00:00 2001 From: David Goldman Date: Tue, 22 Apr 2025 18:58:48 -0400 Subject: [PATCH] Fix issue where target.source-map didn't apply to SwiftASTContext::CreateInstance This specifically is for SwiftASTContext::CreateInstance with a TypeSystemSwiftTypeRef, the other version works as expected. --- lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index fcb8512b3fcdf..151c030526bff 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -2555,6 +2555,10 @@ SwiftASTContext::CreateInstance(lldb::LanguageType language, Module &module, // Apply source path remappings found in the module's dSYM. swift_ast_sp->RemapClangImporterOptions(module.GetSourceMappingList()); + + // Apply source path remappings found in the target settings. + if (target) + swift_ast_sp->RemapClangImporterOptions(target->GetSourcePathMap()); swift_ast_sp->FilterClangImporterOptions( swift_ast_sp->GetClangImporterOptions().ExtraArgs, swift_ast_sp.get());