[PATCH] D45798: LowerTypeTests: Propagate symver directives

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 11:31:59 PDT 2018


pcc added a subscriber: tejohnson.
pcc accepted this revision.
pcc added a comment.
This revision is now accepted and ready to land.

LGTM

I don't think this will do the right thing if two modules have different `.symver` targets, but then again that would seem to be problematic even without CFI (consider the case where the modules with different targets get imported into one another).

Probably something to consider in the future would be to rename functions at the IR level in the ThinLTOBitcodeWriter according to the `.symver` directives.



================
Comment at: lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:361
+    Function *F = M.getFunction(Name);
+    if (!F || F->use_empty())
+      return;
----------------
vlad.tsyrklevich wrote:
> @pcc This should probably be `F->hasAddressTaken()` instead of `F->use_empty()`, but I seem to recall that that would be actually be to restrictive for which functions we currently export--is that right?
I think so, in the importer we would end up redirecting all references (including direct calls) to go through the jump table, so we need to make sure that the jump table points to the right function.


Repository:
  rL LLVM

https://reviews.llvm.org/D45798





More information about the llvm-commits mailing list