llvm.org GIT mirror llvm / 8b37542
Remove the last unnecessary member variable of mapped_file_region. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224312 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 4 years ago
2 changed file(s) with 6 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
638638 /// Platform-specific mapping state.
639639 uint64_t Size;
640640 void *Mapping;
641 #ifdef LLVM_ON_WIN32
642 void *FileHandle;
643 #endif
644641
645642 std::error_code init(int FD, uint64_t Offset, mapmode Mode);
646643
463463 if (Size > std::numeric_limits::max())
464464 return make_error_code(errc::invalid_argument);
465465
466 HANDLE FileHandle = reinterpret_cast(_get_osfhandle(FD));
467 if (FileHandle == INVALID_HANDLE_VALUE)
468 return make_error_code(errc::bad_file_descriptor);
469
466470 DWORD flprotect;
467471 switch (Mode) {
468472 case readonly: flprotect = PAGE_READONLY; break;
517521
518522 mapped_file_region::mapped_file_region(int fd, mapmode mode, uint64_t length,
519523 uint64_t offset, std::error_code &ec)
520 : Size(length), Mapping(),
521 FileHandle(INVALID_HANDLE_VALUE) {
522 FileHandle = reinterpret_cast(_get_osfhandle(fd));
523 if (FileHandle == INVALID_HANDLE_VALUE) {
524 ec = make_error_code(errc::bad_file_descriptor);
525 return;
526 }
527
524 : Size(length), Mapping() {
528525 ec = init(fd, offset, mode);
529 if (ec) {
526 if (ec)
530527 Mapping = 0;
531 FileHandle = INVALID_HANDLE_VALUE;
532 }
533528 }
534529
535530 mapped_file_region::~mapped_file_region() {