[PATCH] D112297: [LTO] Fix assertion failed when flushing bitcode incrementally for LTO output.

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 17:38:35 PDT 2021


stephan.yichao.zhao added a comment.

To limit the restriction to only devices-like file, this <https://www.gnu.org/software/libc/manual/html_node/Testing-File-Type.html> says character and block types are devices, using LLVM enums <https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Support/FileSystem.h#L72-L73>, it could be like this:

  sys::fs::file_status Status;
  std::error_code EC = status(FD, Status);
  if (EC ||
      Status.type() == sys::fs::file_type::block_file || 
      Status.type() == sys::fs::file_type:: character_file) {
    SupportsSeeking = false;
  } else {
    off_t loc = ::lseek(FD, 0, SEEK_CUR);
    SupportsSeeking = loc != (off_t)-1;
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112297/new/

https://reviews.llvm.org/D112297



More information about the llvm-commits mailing list