[LLVMdev] Idea for Google Summer Code : C Compiler for EFI Byte Code implement in LLVM

Andrew Lenharth andrewl at lenharth.org
Fri Mar 19 06:02:19 PDT 2010


On Mon, Mar 15, 2010 at 10:50 AM, Renato Golin <rengolin at systemcall.org> wrote:
> On 10 March 2010 16:57, 琬菁楊 <ching1119.cs96 at g2.nctu.edu.tw> wrote:
>> I think the main issue is that EFI C dialect is not ANSI-C compliant: the
>> size of pointer is determined at the run-time and therefore the layout of
>> the structure is not static. Does LLVM support this model?
>
> Hi Ching,
>
> The LLVM IR doesn't care about the size of your pointers, and this is
> why you have the 'datalayout' explicit on the object file. I don't
> know, however, if you can omit the layout definition and leave it for
> run time.

The layout for non-packed structures is, in this sense, left for
runtime.  The definition, if lacking any alignment attributes, will be
layed out in the backend according to the alignment rules then.  The
IR layout definition can be happily cross-platform if you always
access the structures in a type-safe way (using GEP, never castes,
etc).

> If LLVM doesn't allow omitting the layout, it should, as we now have
> an use case that needs it. If it does, it should be just a matter of
> converting the current IR into EFI bytecode and creating intrinsics to
> deal with the run-time variables. You could even benefit from having
> different languages (LLVM supports) into EFI bytecode...

How does EFI describe structures if the pointer size can change?  This
shouldn't be a harder problem than C struct -> llvm struct.  I assume
the EFI bytecode has some way to describe them.  What is it?
(Question is for Ching)

Andrew

>> And I am wondering whether this kind of idea is valuable to the LLVM
>> community? or are there any other related ideas is more valuable?
>
> I think that an open source compiler to EFI byte code is not only
> desirable, but necessary.
>
>
> cheers,
> --renato
>
> http://systemcall.org/
>
> Reclaim your digital rights, eliminate DRM, learn more at
> http://www.defectivebydesign.org/what_is_drm
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list