[llvm-dev] Identify virtual function call sites and candidate callees for it

Hayrapetyan, Anahit via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 26 09:44:15 PDT 2017


Hi,


I have an analysis pass which collects information about functions based on their call sites. There are problems I'm facing with processing virtual function calls, namely

. How identify virtual call sites in my pass?

. How Identify candidate callees for the given virtual call site?


For the following example, the information I want to get would be identify call of  F and as a possible callees have both B::F and D::F.


class B {

virtual void F() { // do something }

};

class D : public B {

void F() { // do something else }

};

B* d = new D();

d->F();


While doing some investigation on my problem, I found about CFI and how it makes use of llvm type.test intrinsic to check validity of virtual table pointers. I thought it might be useful. But still am not sure if this would be the correct way to solve the problem and even if it is how extend this approach to get information about potential callees.

I would greatly appreciate any ideas or hints on how to solve these problems.

Anahit.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170426/7bc8afc4/attachment.html>


More information about the llvm-dev mailing list