[PATCH] D23778: [ThinLTO] Move ThinLTOCodeGenerator implementation to target the new LTO API.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 11:05:08 PDT 2016


pcc added a subscriber: pcc.
pcc added a comment.

I suppose a higher level question is whether you want to reimplement the entire ThinLTOCodeGenerator or just the libLTO interface?


================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:361
@@ +360,3 @@
+      [&](unsigned Task) -> std::unique_ptr<lto::NativeObjectOutput> {
+    struct AssertingLTOOuput : public lto::NativeObjectOutput {
+      std::unique_ptr<raw_pwrite_stream> getStream() override {
----------------
*Output

================
Comment at: lib/LTO/ThinLTOCodeGenerator.cpp:363
@@ +362,3 @@
+      std::unique_ptr<raw_pwrite_stream> getStream() override {
+        report_fatal_error("Unexpected");
+      }
----------------
tejohnson wrote:
> I'm a little confused about what this interface is used for - why are we asserting if there is any stream requested?
I think this is because this output callback is being used in cases where a hook is aborting the pipeline early by returning false (see e.g. ThinLTOCodeGenerator::promote) so we would never expect to reach here. It would probably be clearer if this was spelt out explicitly.


https://reviews.llvm.org/D23778





More information about the llvm-commits mailing list