[PATCH] D29844: WholeProgramDevirt: Implement importing for single-impl devirtualization.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 16:17:59 PST 2017


tejohnson accepted this revision.
tejohnson added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp:1057
+    auto *SingleImpl = M.getOrInsertFunction(
+        Res.SingleImplName, Type::getVoidTy(M.getContext()), nullptr);
+    bool IsExported;
----------------
pcc wrote:
> tejohnson wrote:
> > I forget - is there a constraint that the single implementation function return void and not take any args?
> The type of the function in the declaration is irrelevant because every call site will cast it to the correct type. Added comment.
I suppose you could get the correct type then from the IR? Not sure if there is any benefit though...


https://reviews.llvm.org/D29844





More information about the llvm-commits mailing list