Skip to content

Commit a6c560b

Browse files
[Modules] Make SubInstance spawn correctly under DirectCC1Mode
Make sure ClangExtraArgs are inherited in the subinstance for module lookup/building when direct cc1 mode is used. This is useful for lldb, which does a slight different variant of the explicit module build 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. rdar://135611011
1 parent 863d2e4 commit a6c560b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,9 +1953,13 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
19531953
genericSubInvocation.getFrontendOptions()
19541954
.DependencyScanningSubInvocation = true;
19551955
} else if (LoaderOpts.strictImplicitModuleContext ||
1956-
// Explicit module Interface verification jobs still spawn a sub-instance
1957-
// and we must ensure this sub-instance gets all of the Xcc flags.
1958-
LoaderOpts.disableImplicitSwiftModule) {
1956+
// Explicit module Interface verification jobs still spawn a
1957+
// sub-instance and we must ensure this sub-instance gets all of
1958+
// the Xcc flags.
1959+
LoaderOpts.disableImplicitSwiftModule ||
1960+
// If using direct cc1 argument mode for lldb or typecheck
1961+
// interface, inherit all clang arguments.
1962+
clangImporterOpts.DirectClangCC1ModuleBuild) {
19591963
// If the compiler has been asked to be strict with ensuring downstream
19601964
// dependencies get the parent invocation's context, inherit the extra Clang
19611965
// arguments also. Inherit any clang-specific state of the compilation

0 commit comments

Comments
 (0)