[LLVMdev] Re: gcc like attributes and annotations

Chris Lattner sabre at nondot.org
Wed Mar 1 11:44:19 PST 2006

On Sat, 25 Feb 2006, Mike Emmel wrote:
> I think this would also help with compiling scripting languages such
> as JavaScript/Python etc. We could keep the high level meta data and
> runtime binding info as language specific bytecode in the file and
> just have the parts that are easy to represent as compileable in the
> main object sections.

Attaching (e.g.) Java bytecode or Javascript code to an LLVM module 
shouldn't be a problem.  The LLVM bcreader can read LLVM bytecode from a 
subset of a file.

> There is no intrinsic reason for all the runtime
> type information to get compiled into the core object module.  Also I
> could bypass code thats difficult to compile and just stuff its
> bytcode into this section. So I think this really helps with partial
> compliation and supporting languags that have complex runtimes.
> The llvm bycode section would just get a stub runtime upcall for code
> that not compiled.

Sure, the JIT does something similar to this, without annotations.

> For java for example this would probably be the compiled parts with
> stubs and a regular classfile for the runtime data with compiled
> functions converted to native.

Makes sense.  Again, you can do this today, without annotations.



More information about the llvm-dev mailing list