Skip to content

Commit

Permalink
[Modules] Do not inherit DirectCC1Mode in subInstance
Browse files Browse the repository at this point in the history
Stop inheriting DirectCC1 clang option in subInstance for module
loading. The option was inherited when it was used for both direct cc1
scanning (generating direct cc1 compile commands) and compilation
(consume direct cc1 commands), but it is not really useful for
compilation since the explicit module builds that use the configuration
do not spawn sub-instance for module loading.

Except LLDB, which does a slight different variant of the explicit
module that do not have swift-driver cooridination and replies on the
subInstance to load swiftmodule. When such configuration is used, if
DirectCC1 compile option is inherited without any extra cc1 arguments,
the clang importer inside the sub-instance is actually malformed,
causing the swift instance failed to be created. Stop inheriting the
DirectCC1 compilation option will allow sub-instance to be created.

rdar://135611011
  • Loading branch information
cachemeifyoucan committed Sep 10, 2024
1 parent 863d2e4 commit c838575
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/Frontend/ModuleInterfaceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1782,8 +1782,6 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
Feature::LayoutPrespecialization);
}

genericSubInvocation.getClangImporterOptions().DirectClangCC1ModuleBuild =
clangImporterOpts.DirectClangCC1ModuleBuild;
genericSubInvocation.getClangImporterOptions().ClangImporterDirectCC1Scan =
clangImporterOpts.ClangImporterDirectCC1Scan;

Expand Down

0 comments on commit c838575

Please sign in to comment.