diff --git a/include/swift/Frontend/Frontend.h b/include/swift/Frontend/Frontend.h index bdfa5fa2c9c13..4ea8e4c963a40 100644 --- a/include/swift/Frontend/Frontend.h +++ b/include/swift/Frontend/Frontend.h @@ -188,6 +188,10 @@ class CompilerInvocation { return SearchPathOpts.getFrameworkSearchPaths(); } + void setVFSOverlays(const std::vector &Overlays) { + SearchPathOpts.VFSOverlayFiles = Overlays; + } + void setCompilerPluginLibraryPaths(const std::vector &Paths) { SearchPathOpts.setCompilerPluginLibraryPaths(Paths); } diff --git a/tools/sil-opt/SILOpt.cpp b/tools/sil-opt/SILOpt.cpp index 1142346c22600..c7dabc6075b82 100644 --- a/tools/sil-opt/SILOpt.cpp +++ b/tools/sil-opt/SILOpt.cpp @@ -86,6 +86,9 @@ ImportPaths("I", llvm::cl::desc("add a directory to the import search path")); static llvm::cl::list FrameworkPaths("F", llvm::cl::desc("add a directory to the framework search path")); +static llvm::cl::list +VFSOverlays("vfsoverlay", llvm::cl::desc("add a VFS overlay")); + static llvm::cl::opt ModuleName("module-name", llvm::cl::desc("The name of the module if processing" " a module. Necessary for processing " @@ -542,6 +545,9 @@ int main(int argc, char **argv) { FramePaths.push_back({path, /*isSystem=*/false}); } Invocation.setFrameworkSearchPaths(FramePaths); + + Invocation.setVFSOverlays(VFSOverlays); + // Set the SDK path and target if given. if (SDKPath.getNumOccurrences() == 0) { const char *SDKROOT = getenv("SDKROOT");