[LLVMdev] Prevent sizeof being replaced by a constant in IR

Peter Conn conn.peter at gmail.com
Mon Apr 14 06:35:46 PDT 2014


Hello,

Using the following command:

clang -O0 -S -emit-llvm size.c

Will generate an LLVM IR file where uses of 'sizeof' have been replaced by
constants. Is there any way to prevent this, and perhaps leave the
'sizeof's replaced by GEPs as detailed here:
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt

Thanks,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140414/495c49cc/attachment.html>


More information about the llvm-dev mailing list