llvm.org GIT mirror llvm / b5f992c
Convert a member variable to a local variable. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224311 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 4 years ago
2 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
640640 void *Mapping;
641641 #ifdef LLVM_ON_WIN32
642642 void *FileHandle;
643 void *FileMappingHandle;
644643 #endif
645644
646645 std::error_code init(int FD, uint64_t Offset, mapmode Mode);
470470 case priv: flprotect = PAGE_WRITECOPY; break;
471471 }
472472
473 FileMappingHandle =
473 HANDLE FileMappingHandle =
474474 ::CreateFileMappingW(FileHandle, 0, flprotect,
475475 (Offset + Size) >> 32,
476476 (Offset + Size) & 0xffffffff,
518518 mapped_file_region::mapped_file_region(int fd, mapmode mode, uint64_t length,
519519 uint64_t offset, std::error_code &ec)
520520 : Size(length), Mapping(),
521 FileHandle(INVALID_HANDLE_VALUE), FileMappingHandle() {
521 FileHandle(INVALID_HANDLE_VALUE) {
522522 FileHandle = reinterpret_cast(_get_osfhandle(fd));
523523 if (FileHandle == INVALID_HANDLE_VALUE) {
524524 ec = make_error_code(errc::bad_file_descriptor);
527527
528528 ec = init(fd, offset, mode);
529529 if (ec) {
530 Mapping = FileMappingHandle = 0;
530 Mapping = 0;
531531 FileHandle = INVALID_HANDLE_VALUE;
532532 }
533533 }