<div dir="ltr"><div>Thanks Tim,</div><div>using arg_begin I solved my problem.</div><div><br></div><div>Thanks again<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno sab 16 mar 2019 alle ore 08:45 Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Alberto,<br>
<br>
On Sat, 16 Mar 2019 at 07:25, Alberto Barbaro via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> The problem is that when I do F->getNumOperands() I have 0 as result.<br>
><br>
> Can you explain me why please?<br>
<br>
You should think of a "Function *" like any other GlobalValue, in that<br>
what you've got during your visit is really just @png_set_mem_fn. That<br>
(pointer to a function) doesn't depend on any other LLVM values, so it<br>
doesn't have any operands. If and when you call it, the Function will<br>
continue to have no operands but the CallInst will have the operands<br>
you're expecting to see here.<br>
<br>
However, because it's a defined Function it does have other structure;<br>
and if you want to look at what arguments it might take if you called<br>
it, you need to use Function::arg_begin or related iterators. Because<br>
there aren't actually any values associated with those arguments<br>
outside the function body, you'll only be able to meaningfully use<br>
their type (and maybe their name).<br>
<br>
Cheers.<br>
<br>
Tim.<br>
</blockquote></div>