[cfe-dev] CGCalleeInfo set Decl to Null while using as dereferenced callee

Mustakimur Rahman Khandaker (Mustakim) via cfe-dev cfe-dev at lists.llvm.org
Fri Sep 14 05:54:05 PDT 2018


I actually try to instrument before those indirect call to extract the memory address of callee (in above case: func.f). I know I can extract that using GetAddrOfLocalVar if I know the Decl of the callee. But, the point I reached to createCall for indirect call, I don't have that information anymore for these cases. I don't know if there could be an alternative design possible to achieve it.

On Sep 13 2018, at 6:29 pm, Friedman, Eli <efriedma at codeaurora.org> wrote:
>
>
> On 9/13/2018 2:26 PM, Mustakimur Rahman Khandaker (Mustakim) via cfe-dev wrote:
> > Now, in the CGCalleeInfo, compiler set the Decl for the Callee. What I have discovered is that Decl *Expr::getReferencedDeclOfCallee() returns nullptr and for that call callee set to Decl as Null from CGCallee CodeGenFunction::EmitCallee(const Expr *E). I beleive this is not an expected behavior because it is declared as MathFunc and it should be set as that.
> >
> > I would like to understand why it kept like this?
> It mostly doesn't matter because the callers of getReferencedDeclOfCallee/getCalleeDecl generally don't care about declarations that aren't a FunctionDecl, and code generally doesn't call explicit casts of function pointers.
> What are you trying to do?
> -Eli
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180914/028d4d18/attachment.html>


More information about the cfe-dev mailing list