Skip to content

Commit 2cac7e1

Browse files
committed
SIL tools always operate as -parse-stdlib, even when working with modules.
r18796 added a check that the standard library is always available when not working in -parse-stdlib or SIL mode, but sil-opt and sil-extract have no need to load the stdlib if the module file they're working on does not depend on it. Treat these tools as if they are always in a -parse-stdlib mode. This fixes the failure in witness_tables.sil, which is due to us pulling in witness tables from all loaded modules. Swift SVN r18807
1 parent ea8e7f5 commit 2cac7e1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tools/sil-extract/SILExtract.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ int main(int argc, char **argv) {
8585
// Give the context the list of search paths to use for modules.
8686
Invocation.setImportSearchPaths(ImportPaths);
8787
Invocation.getClangImporterOptions().ModuleCachePath = ModuleCachePath;
88+
Invocation.setParseStdlib();
8889

8990
// Load the input file.
9091
std::unique_ptr<llvm::MemoryBuffer> InputFile;

tools/sil-opt/SILOpt.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ int main(int argc, char **argv) {
436436
// Set the module cache path. If not passed in we use the default swift module
437437
// cache.
438438
Invocation.getClangImporterOptions().ModuleCachePath = ModuleCachePath;
439+
Invocation.setParseStdlib();
439440

440441
// Load the input file.
441442
std::unique_ptr<llvm::MemoryBuffer> InputFile;

0 commit comments

Comments
 (0)