[PATCH] D20268: Resolution-based LTO API.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 17:50:02 PDT 2016


mehdi_amini added inline comments.

================
Comment at: lib/LTO/LTO.cpp:318
@@ +317,3 @@
+    RegularLTO.CombinedModule->setTargetTriple(M.getTargetTriple());
+    RegularLTO.CombinedModule->setDataLayout(M.getDataLayout());
+  }
----------------
mehdi_amini wrote:
> The ", we typically have callback hooks into the linker defined where the linker could add its own resolved symbols to the combined module" is not clear to me at all (LTOCodeGenerator will never do that AFAIK for example).
> (I understand that Gold does something with "commons" at that time, but haven't add time to figure why it is needed) 
To be more explicit: I don't like this behavior because it creates a relatively strong coupling between the linker and the plugin. The linker changes the module in an unpredictable way that can conflict with assumption that the plugin implementation could make. It makes it harder to follow invariant in the plugin implementation, and makes it easy to break the client of the API (the linker).



https://reviews.llvm.org/D20268





More information about the llvm-commits mailing list