Skip to content

Commit 558aee9

Browse files
committed
[swift-refactor] Add the option -resource-dir.
This lets one customize in the compiler invocation where the compiler looks for the stdlib. This is necessary if the toolchain is not using a stdlib installed with it.
1 parent b62c1dc commit 558aee9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/swift-refactor/swift-refactor.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ static llvm::cl::list<std::string>
138138
static llvm::cl::opt<std::string>
139139
Triple("target", llvm::cl::desc("target triple"));
140140

141+
static llvm::cl::opt<std::string> ResourceDir(
142+
"resource-dir",
143+
llvm::cl::desc("The directory that holds the compiler resource files"));
144+
141145
enum class DumpType {
142146
REWRITTEN,
143147
JSON,
@@ -294,6 +298,9 @@ int main(int argc, char *argv[]) {
294298
if (!options::Triple.empty())
295299
Invocation.setTargetTriple(options::Triple);
296300

301+
if (!options::ResourceDir.empty())
302+
Invocation.setRuntimeResourcePath(options::ResourceDir);
303+
297304
Invocation.getFrontendOptions().InputsAndOutputs.addInputFile(
298305
options::SourceFilename);
299306
Invocation.getLangOptions().AttachCommentsToDecls = true;

0 commit comments

Comments
 (0)