<p>a is a pointer.The size of a pointer always equals the size of an int,doesn't it? </p>
<div class="gmail_quote">ÔÚ 2014-4-9 ÏÂÎç4:32£¬"Peter Conn" <<a href="mailto:conn.peter@gmail.com">conn.peter@gmail.com</a>>дµÀ£º<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello,<div><br></div><div>I'm replacing a struct with another struct of a different size. A problem arises when the following line occurs in the source code:</div><div><br></div><div>MyStruct *a = malloc(sizeof(a));</div>

<div><br></div><div>The 'sizeof(a)' is turned into a constant in the LLVM IR, resulting in the wrong amount of memory being allocated for the struct. Is there any way to find all the constants that have arisen from sizeof?</div>

<div><br></div><div>Thanks, Peter</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div>