Skip to content

sil-opt: introduce -vfsoverlay to support Windows #63879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/swift/Frontend/Frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ class CompilerInvocation {
return SearchPathOpts.getFrameworkSearchPaths();
}

void setVFSOverlays(const std::vector<std::string> &Overlays) {
SearchPathOpts.VFSOverlayFiles = Overlays;
}

void setCompilerPluginLibraryPaths(const std::vector<std::string> &Paths) {
SearchPathOpts.setCompilerPluginLibraryPaths(Paths);
}
Expand Down
6 changes: 6 additions & 0 deletions tools/sil-opt/SILOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ ImportPaths("I", llvm::cl::desc("add a directory to the import search path"));
static llvm::cl::list<std::string>
FrameworkPaths("F", llvm::cl::desc("add a directory to the framework search path"));

static llvm::cl::list<std::string>
VFSOverlays("vfsoverlay", llvm::cl::desc("add a VFS overlay"));

static llvm::cl::opt<std::string>
ModuleName("module-name", llvm::cl::desc("The name of the module if processing"
" a module. Necessary for processing "
Expand Down Expand Up @@ -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");
Expand Down