[PATCH] D42680: [ThinLTO] Ignore object files with no ThinLTO modules if -fthinlto-index= is set

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 5 06:53:56 PST 2018


tejohnson added a comment.

This looks ok to me, assuming it produces the empty output file as I expect it should. Please wait for pcc to take a look as well.



================
Comment at: clang/lib/CodeGen/CodeGenAction.cpp:959
+    if (!Bm)
+      return {};
     Expected<std::unique_ptr<llvm::Module>> MOrErr =
----------------
It looks like this should result in an empty .o file being produced, but please confirm in the test (otherwise the build system may complain that expected output not produced).


================
Comment at: clang/test/CodeGen/thinlto_backend.ll:24
+; Ensure we don't fail with index and non-ThinLTO object file, and run
+; non-ThinLTO compilation which
+; RUN: opt -o %t5.o %s
----------------
comment isn't complete (ends in "which").


================
Comment at: clang/test/CodeGen/thinlto_backend.ll:26
+; RUN: opt -o %t5.o %s
+; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t4.o -x ir %t5.o -c -fthinlto-index=%t.thinlto.bc
+
----------------
Check that empty $t4.o is produced.


https://reviews.llvm.org/D42680





More information about the cfe-commits mailing list