Chris Lattner
2010-Mar-30 18:23 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
On Mar 30, 2010, at 10:31 AM, 琬菁楊 wrote:> What do you mean by "variable sized pointers"? What does: > > struct S {void *X; }; > > return for sizeof(struct S); ? > > I have surveyed the UEFI spec2.3. > In my opinion, if the EBC VM is running on 32-bit processor, return value is 4 > if the EBC VM is running on 64-bit processor, return value is 8 > > If error out on any sizeof that include a pointer, does it means that no issue about pointer size determined at runtime??Yes, if it is an error, it makes it much more feasible to implement. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100330/0b192afa/attachment.html>
Tristan Gingold
2010-Mar-31 07:59 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
On Mar 30, 2010, at 8:23 PM, Chris Lattner wrote:> > On Mar 30, 2010, at 10:31 AM, 琬菁楊 wrote: > >> What do you mean by "variable sized pointers"? What does: >> >> struct S {void *X; }; >> >> return for sizeof(struct S); ? >> >> I have surveyed the UEFI spec2.3. >> In my opinion, if the EBC VM is running on 32-bit processor, return value is 4 >> if the EBC VM is running on 64-bit processor, return value is 8 >> >> If error out on any sizeof that include a pointer, does it means that no issue about pointer size determined at runtime?? > > Yes, if it is an error, it makes it much more feasible to implement.But it is not an error, otherwise it would be hard to use malloc() like functions.
Renato Golin
2010-Mar-31 09:18 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
2010/3/30 Chris Lattner <clattner at apple.com>:> If error out on any sizeof that include a pointer, does it means that no > issue about pointer size determined at runtime?? > > Yes, if it is an error, it makes it much more feasible to implement.I don't see why it should be that difficult. If sizeof becomes an intrinsic that is called at runtime to determine the pointer size (probably stored in some global or read from a configuration register), than the problem is solved. If the types' sizes change too, this intrinsic could accept a parameter (enum?) with the type of the type. cheers, --renato http://systemcall.org/ Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm
琬菁楊
2010-Mar-31 18:48 UTC
[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
Hi Tristan,> But it is not an error, otherwise it would be hard to use malloc() like > functions. > >I cannot understand that it would be hard to use malloc() like functions the parameter passed to malloc is evaluated at runtime what is the issue of malloc when sizeof is determined at runtime? thanks ching -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100401/7bb13a4d/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM
- [LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM