From 7126ba1ee064def54c307a5e139884fc7d09c9bf Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 15 Jul 2013 20:52:01 +0000 Subject: Remove an extra is_directory call. I checked that opening a directory on windows does fail, so this saves a "stat". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186345 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/MemoryBuffer.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'lib/Support/MemoryBuffer.cpp') diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index b8df7a4f14..a7553d1c96 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -253,17 +253,6 @@ error_code MemoryBuffer::getFile(const char *Filename, OwningPtr &result, int64_t FileSize, bool RequiresNullTerminator) { - // FIXME: Review if this check is unnecessary on windows as well. -#ifdef LLVM_ON_WIN32 - // First check that the "file" is not a directory - bool is_dir = false; - error_code err = sys::fs::is_directory(Filename, is_dir); - if (err) - return err; - if (is_dir) - return make_error_code(errc::is_a_directory); -#endif - int OpenFlags = O_RDONLY; #ifdef O_BINARY OpenFlags |= O_BINARY; // Open input file in binary mode on win32. -- cgit v1.2.3