From: Chris Lattner Date: Tue, 18 Jul 2006 07:07:51 +0000 (+0000) Subject: simple optimization: don't bother calling "exists" (which calls the syscall X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ff3d80ff7e167a8b6e84621ed155481c8b6a2bb4;p=oota-llvm.git simple optimization: don't bother calling "exists" (which calls the syscall "access"). Instead, just let the open call fail if the file doesn't exist. This reduces the # syscalls executed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29173 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc index 148372b0cc3..341ee254890 100644 --- a/lib/System/Unix/MappedFile.inc +++ b/lib/System/Unix/MappedFile.inc @@ -40,9 +40,6 @@ struct sys::MappedFileInfo { }; void MappedFile::initialize() { - if (!path_.exists()) - throw std::string("Can't open file: ") + path_.toString(); - int mode = 0; if (options_ & READ_ACCESS) if (options_ & WRITE_ACCESS)