[PATCH] D55717: Add --plugin-opt=emit-llvm option.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 14 13:47:21 PST 2018


tejohnson accepted this revision.
tejohnson added a comment.

Noting below one difference compared to gold-plugin behavior, which I think is ok, so LGTM.



================
Comment at: lld/ELF/LTO.cpp:106
 
+  if (Config->EmitLLVM) {
+    C.PostInternalizeModuleHook = [](size_t Task, const Module &M) {
----------------
In gold-plugin, emit-llvm and save-temps are mutually-exclusive (last one wins) at the plugin level. With this, you get kindof a hybrid if both are specified: addSaveTemps code will essentially install a bunch of hooks including PostInternalizeModuleHook, but from what I can tell looking at the addSaveTemps code, it will recognize that PostInternalizeModuleHook is already set and ensure the original hook is invoked first. This means that you would get some of the save-temps output, but then at the post-internalization point you'll get this hook to write the bitcode to the output file and then stop. In some ways this seems nicer to me though. Not objecting, just noting the difference.


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

https://reviews.llvm.org/D55717





More information about the llvm-commits mailing list