[llvm-dev] Add callee list in the llvm IR

Nagaraju Mekala via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 27 04:25:48 PDT 2021


Hello All,

I have a requirement to list all the function callee's as an entry in
the llvm IR, so that one of the llvm pass can use them and do certain
optimizations.

ex:
abc()
{
   ...
   a();
   b();
}

IR:
define void @_Z23_abc() #0 !dbg !5503 !Callee_list !5504 {
 ...
!5504 = !{!"a,b"}

I tried looking into SemaDeclCXX.cpp but all I was getting in the
definition data.
Can someone point out how we can do this?

Thanks in advance
Nagaraju


More information about the llvm-dev mailing list