MaskRay added a comment.

Is the motivation just to avoid -flto or -flto=lto at link time? I am afraid 
that the advantage probably is not large enough to justify the potentially 
costly object file parsing in the driver. Before this, as I understand it, 
object files are opaque to the driver. The driver just passes all file names to 
the linker. With this change, every object file will be opened and 
`llvm::getBitcodeFileContents` will be called on every object file.



================
Comment at: clang/lib/Driver/Driver.cpp:1205
 
+  setLTOModeFromInputFiles(&Inputs);
+
----------------
On line 1133, there is a similar setLTOMode. If we are going to add the logic, 
probably consider unifying the logic. However, I am concerned with the cost, 
see my main comment


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90457

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D90457: [clang][drive... Fangrui Song via Phabricator via cfe-commits

Reply via email to