Thanks, John.<div>I am writing not an LLVM pass but a compiler backend, so this doesn't work for me.</div><div><br></div><div>Victor<br><br><div class="gmail_quote">On 28 May 2010 17:35, John Criswell <span dir="ltr"><<a href="mailto:criswell@illinois.edu">criswell@illinois.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">Victor Zverovich wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all<br>
<br>
I am trying to get the size of an LLVM pointer type.<br>
getPrimitiveSizeInBits() returns 0 for it and the documentation for isSized() suggest to use TargetData.<br>
I figured out from Kaleidoscope example that one can get a pointer to TagetData object through the execution engine but it seems to be an overkill.<br>
What is the right way to do it?<br>
</blockquote></div></div>
TargetData is an LLVM pass.  If you're writing an LLVM pass, just make TargetData one of its prerequisite analysis passes in the getAnalysisUsage() method and use the getAnalysis<TargetData>() function to get a reference to the TargetData pass within your pass.<br>


<br>
-- John T.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best regards,<br>
Victor<br>
<br>
</blockquote>
<br>
</blockquote></div><br></div>