<div dir="ltr"><div>Thank you! It works like a charm</div><div><br></div><div>Regards</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/25 Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Apr 25, 2013 at 3:14 PM, B B <<a href="mailto:blackbox.dev.ml@gmail.com">blackbox.dev.ml@gmail.com</a>> wrote:<br>

> > %call = call noalias i8* @_Znwm(i64 ptrtoint(%class.A* getelementptr(%class.A* null, i32 1) to i64))<br>
</div><div class="im">> Yes, by "dynamically" I meant at IR code generation time. So if I<br>
> understand, in your approach I need only to determine how many elements are<br>
> in the structure. How can I get this value?<br>
<br>
</div>Actually, you don't even need that. The "1" means "one full struct"<br>
rather than "after field 1" or anything similar. So it won't change<br>
depending on how many fields are in the struct.<br>
<br>
You might find this page from the docs useful:<br>
<a href="http://llvm.org/docs/GetElementPtr.html" target="_blank">http://llvm.org/docs/GetElementPtr.html</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>