We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 066b9e8 + bff2aa6 commit c3993d6Copy full SHA for c3993d6
clang/lib/Driver/Driver.cpp
@@ -2542,10 +2542,14 @@ bool Driver::HandleImmediateArgs(Compilation &C) {
2542
}
2543
2544
if (C.getArgs().hasArg(options::OPT_print_runtime_dir)) {
2545
- if (std::optional<std::string> RuntimePath = TC.getRuntimePath())
2546
- llvm::outs() << *RuntimePath << '\n';
2547
- else
2548
- llvm::outs() << TC.getCompilerRTPath() << '\n';
+ for (auto RuntimePath :
+ {TC.getRuntimePath(), std::make_optional(TC.getCompilerRTPath())}) {
+ if (RuntimePath && getVFS().exists(*RuntimePath)) {
+ llvm::outs() << *RuntimePath << '\n';
2549
+ return false;
2550
+ }
2551
2552
+ llvm::outs() << "(runtime dir is not present)" << '\n';
2553
return false;
2554
2555
0 commit comments