DependencyScanner: add a new extraPcmArgs field for each Swift module

Building each Swift module explicitly requires dependency PCMs to be built
with the exactly same deployment target version. This means we may need to
build a Clang module multiple times with different target triples.

This patch removes the -target arguments from the reported PCM build
arguments and inserts extraPcmArgs fields to each Swift module.
swift-driver can combine the generic PCM arguments with these extra arguments
to get the command suitable for building a PCM specifically for
that loading Swift module.
This commit is contained in:
Xi Ge
2020-06-10 16:12:01 -07:00
parent ecaf9afdb3
commit 00872ba53e
9 changed files with 77 additions and 10 deletions

View File

@@ -280,7 +280,8 @@ public:
StringRef interfacePath,
StringRef outputPath,
SourceLoc diagLoc,
llvm::function_ref<bool(ASTContext&, ArrayRef<StringRef>, StringRef)> action) override;
llvm::function_ref<bool(ASTContext&, ArrayRef<StringRef>,
ArrayRef<StringRef>, StringRef)> action) override;
bool runInSubCompilerInstance(StringRef moduleName,
StringRef interfacePath,
StringRef outputPath,