Skip to content

Commit 91df537

Browse files
authored
Merge pull request #83795 from kubamracek/embedded-propagate-to-submodule-builds
[embedded] When loading (sub-)modules, propagate the Embedded flag and use it for hash computation
2 parents 4ca136a + 169ea00 commit 91df537

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/Frontend/ModuleInterfaceLoader.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2079,6 +2079,13 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
20792079
GenericArgs.push_back("-stdlib=libc++");
20802080
}
20812081
}
2082+
2083+
// Inherit Embedded Swift
2084+
if (langOpts.hasFeature(Feature::Embedded)) {
2085+
genericSubInvocation.getLangOptions().enableFeature(Feature::Embedded);
2086+
GenericArgs.push_back("-enable-experimental-feature");
2087+
GenericArgs.push_back("Embedded");
2088+
}
20822089
}
20832090

20842091
/// Calculate an output filename in \p genericSubInvocation's cache path that
@@ -2912,7 +2919,10 @@ static std::string getContextHash(const CompilerInvocation &CI,
29122919
unsigned(CI.getSILOptions().EnableOSSAModules),
29132920

29142921
// Is the C++ interop enabled?
2915-
unsigned(CI.getLangOptions().EnableCXXInterop)
2922+
unsigned(CI.getLangOptions().EnableCXXInterop),
2923+
2924+
// Is Embedded Swift enabled?
2925+
unsigned(CI.getLangOptions().hasFeature(Feature::Embedded))
29162926
);
29172927

29182928
return llvm::toString(llvm::APInt(64, H), 36, /*Signed=*/false);

0 commit comments

Comments
 (0)