[LLVMdev] Re: Re: variable sized structs in LLVM

Chris Lattner sabre at nondot.org
Fri Jun 24 11:13:40 PDT 2005


On Wed, 22 Jun 2005, Ed Cogburn wrote:
>> Frontends can be completely separate from the LLVM infrastructure and do
>> not even need to be linked with any LLVM classes to create LLVM code from
>> source languages.
>
>
> Unless, apparently, you're trying to implement variable-sized objects in
> your language. :)

Heh, hopefully my previous emails help clear this up.  Variable sized 
objects should not be a problem for llvm.

> One of LLVM's powerful (IMHO) selling points was the concept of a 
> *complete*, abstract IR language which any independent frontend could 
> write to (sending llvm-as unoptimized, even ugly, but correct, IR 
> assembly that gets converted to optimized native code), without being 
> dependent on LLVM's own code, i.e. just write to the IR spec, and be 
> able to do anything that any frontend linked to LLVM itself, like Reid's 
> Stacker, could do.

Yup!

> I guess what I'm suggesting is that both the variable struct & data
> alignment problems should be at some point abstracted away within LLVM's IR
> language, with data alignment issues ideally completely invisible to the
> user of LLVM's IR, and with variable structs handled perhaps like GCC & C99
> eventually did to support variable sized structs in C.  See 'Zero-length
> arrays':
>
> http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html#Zero-Length

Yup, I agree.  If my previous email didn't clear this up, please lemme 
know :)

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list