Add flag that allows ignoring compiler flags specified in an interface file when running a '-compile-module-from-interface' frontend action.

This commit is contained in:
Artem Chikin
2022-08-02 10:02:53 -07:00
parent 78f5e0b0fd
commit 7bdec998b1
12 changed files with 92 additions and 14 deletions

View File

@@ -180,7 +180,9 @@ struct ErrorDowngradeConsumerRAII: DiagnosticConsumer {
};
bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
StringRef OutPath, bool ShouldSerializeDeps,
StringRef OutPath,
bool ShouldSerializeDeps,
bool IgnoreInterfaceProvidedOptions,
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
ArrayRef<std::string> CompiledCandidates) {
@@ -200,6 +202,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
interfacePath,
OutPath,
diagnosticLoc,
IgnoreInterfaceProvidedOptions,
[&](SubCompilerInstanceInfo &info) {
auto &SubInstance = *info.Instance;
auto subInvocation = SubInstance.getInvocation();
@@ -320,6 +323,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
bool ModuleInterfaceBuilder::buildSwiftModule(StringRef OutPath,
bool ShouldSerializeDeps,
bool IgnoreInterfaceProvidedOptions,
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
llvm::function_ref<void()> RemarkRebuild,
ArrayRef<std::string> CompiledCandidates) {
@@ -327,8 +331,8 @@ bool ModuleInterfaceBuilder::buildSwiftModule(StringRef OutPath,
if (RemarkRebuild) {
RemarkRebuild();
}
return buildSwiftModuleInternal(OutPath, ShouldSerializeDeps, ModuleBuffer,
CompiledCandidates);
return buildSwiftModuleInternal(OutPath, ShouldSerializeDeps, IgnoreInterfaceProvidedOptions,
ModuleBuffer, CompiledCandidates);
};
if (disableInterfaceFileLock) {
return build();