/// append them to ASTs.
int buildASTs(std::vector<std::unique_ptr<ASTUnit>> &ASTs);
- /// Sets whether working directory should be restored after calling run(). By
- /// default, working directory is restored. However, it could be useful to
- /// turn this off when running on multiple threads to avoid the raciness.
- void setRestoreWorkingDir(bool RestoreCWD);
-
/// Sets whether an error message should be printed out if an action fails. By
/// default, if an action fails, a message is printed out to stderr.
void setPrintErrorMessage(bool PrintErrorMessage);
DiagnosticConsumer *DiagConsumer = nullptr;
- bool RestoreCWD = true;
bool PrintErrorMessage = true;
};
// Remember the working directory in case we need to restore it.
std::string InitialWorkingDir;
- if (RestoreCWD) {
- if (auto CWD = OverlayFileSystem->getCurrentWorkingDirectory()) {
- InitialWorkingDir = std::move(*CWD);
- } else {
- llvm::errs() << "Could not get working directory: "
- << CWD.getError().message() << "\n";
- }
+ if (auto CWD = OverlayFileSystem->getCurrentWorkingDirectory()) {
+ InitialWorkingDir = std::move(*CWD);
+ } else {
+ llvm::errs() << "Could not get working directory: "
+ << CWD.getError().message() << "\n";
}
for (llvm::StringRef File : AbsolutePaths) {
return run(&Action);
}
-void ClangTool::setRestoreWorkingDir(bool RestoreCWD) {
- this->RestoreCWD = RestoreCWD;
-}
-
void ClangTool::setPrintErrorMessage(bool PrintErrorMessage) {
this->PrintErrorMessage = PrintErrorMessage;
}