@@ -979,7 +979,9 @@ SwiftASTContext::SwiftASTContext(std::string description,
979
979
// Set the clang modules cache path.
980
980
m_compiler_invocation_ap->setClangModuleCachePath (
981
981
GetClangModulesCacheProperty ());
982
+ }
982
983
984
+ void SwiftASTContext::SetCompilerInvocationLLDBOverrides () {
983
985
swift::IRGenOptions &ir_gen_opts =
984
986
m_compiler_invocation_ap->getIRGenOptions ();
985
987
ir_gen_opts.OutputKind = swift::IRGenOutputKind::Module;
@@ -1964,6 +1966,8 @@ SwiftASTContext::CreateInstance(lldb::LanguageType language, Module &module,
1964
1966
ConfigureResourceDirs (swift_ast_sp->GetCompilerInvocation (), resource_dir,
1965
1967
triple);
1966
1968
1969
+ swift_ast_sp->SetCompilerInvocationLLDBOverrides ();
1970
+
1967
1971
// Apply the working directory to all relative paths.
1968
1972
std::vector<std::string> DeserializedArgs = swift_ast_sp->GetClangArguments ();
1969
1973
swift_ast_sp->GetClangImporterOptions ().ExtraArgs .clear ();
@@ -2490,6 +2494,8 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
2490
2494
// otherwise no modules will be found.
2491
2495
swift_ast_sp->InitializeSearchPathOptions (module_search_paths,
2492
2496
framework_search_paths);
2497
+ swift_ast_sp->SetCompilerInvocationLLDBOverrides ();
2498
+
2493
2499
if (!swift_ast_sp->GetClangImporter ()) {
2494
2500
logError (" couldn't create a ClangImporter" );
2495
2501
return {};
@@ -2771,6 +2777,8 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
2771
2777
// otherwise no modules will be found.
2772
2778
swift_ast_sp->InitializeSearchPathOptions (module_search_paths,
2773
2779
framework_search_paths);
2780
+ swift_ast_sp->SetCompilerInvocationLLDBOverrides ();
2781
+
2774
2782
if (!swift_ast_sp->GetClangImporter ()) {
2775
2783
logError (" couldn't create a ClangImporter" );
2776
2784
return {};
0 commit comments