Skip to content

Support: Do not check if a file exists before executing #128821

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
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
7 changes: 0 additions & 7 deletions llvm/lib/Support/Unix/Program.inc
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ static bool Execute(ProcessInfo &PI, StringRef Program,
ArrayRef<std::optional<StringRef>> Redirects,
unsigned MemoryLimit, std::string *ErrMsg,
BitVector *AffinityMask, bool DetachProcess) {
if (!llvm::sys::fs::exists(Program)) {
if (ErrMsg)
*ErrMsg = std::string("Executable \"") + Program.str() +
std::string("\" doesn't exist!");
return false;
}

assert(!AffinityMask && "Starting a process with an affinity mask is "
"currently not supported on Unix!");

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/tools/llvm-rc/windres-preproc.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

;; Test error messages when unable to execute the preprocessor.

; RUN: not llvm-windres --preprocessor intentionally-missing-executable %p/Inputs/empty.rc %t.res 2>&1 | FileCheck %s --check-prefix=CHECK4
; CHECK4: llvm-rc: Preprocessing failed: Executable "intentionally-missing-executable" doesn't exist!
; RUN: not llvm-windres --preprocessor intentionally-missing-executable %p/Inputs/empty.rc %t.res 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=CHECK4
; CHECK4: llvm-rc: Preprocessing failed: posix_spawn failed: [[MSG]]

;; Test --preprocessor with an argument with spaces.

Expand Down