[PATCH] D86905: Flush bitcode incrementally for LTO output

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 00:28:48 PDT 2020


stephan.yichao.zhao added a comment.

In D86905#2248592 <https://reviews.llvm.org/D86905#2248592>, @MaskRay wrote:

> I can understand the read-write stream requirement, but the changes to lib/Support may require an additional set of reviewers. You will need some unittests (see `llvm/unittests/Support/raw_ostream_test.cpp` for example) Probably consider splitting the patch into two.

created D86913 <https://reviews.llvm.org/D86913> with unit tests.



================
Comment at: lld/ELF/LTO.cpp:71
+  }
+  return openFile(file);
+}
----------------
MaskRay wrote:
> `return {};`
> 
> openFile would likely fail for the same reason.
openFile opens raw_fd_ostream (write-only) but not raw_fd_stream (read-write-seek). So openFile may work on a platform that does not support seek or read-write mode).


================
Comment at: llvm/include/llvm/Support/raw_ostream.h:318
+
+  virtual Kinds get_kind() const;
+
----------------
MaskRay wrote:
> https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html
> 
> We usually use static `classof`
Thank you.
I implemented classof. then dyn_cast works!
But I did not make kind as a class member initialized at constructor like that link does. Making that change will change lots of code at different child classes. Is the way that kind is defined in the link a requirement in LLVM codebase?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86905



More information about the llvm-commits mailing list