simple optimization: don't bother calling "exists" (which calls the syscall
authorChris Lattner <sabre@nondot.org>
Tue, 18 Jul 2006 07:07:51 +0000 (07:07 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 18 Jul 2006 07:07:51 +0000 (07:07 +0000)
"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

lib/System/Unix/MappedFile.inc

index 148372b0cc30b58633302b905782b6663b4144bc..341ee254890246d3d106181c770d69952b5a93e1 100644 (file)
@@ -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)