[LLVMdev] CollectorRegistry

Simon Ask Ulsnes vinterbleg at gmail.com
Thu Jul 24 00:10:30 PDT 2008


> I would say that accurate GC would generally require considerable
> cooperation from the front-end compiler, which GCC does not
> particularly provide. But you could experiment with it. Simply adding
> a GC attribute to an existing function should generally be harmless
> (e.g., the inliner will do so inlining a function with GC into a
> function without), but doing so won't annotate the roots in the
> function.

Hm, it seems this will be more interesting than I had initially
expected. I had assumed that the annotation took place at the IR
level, so frontend compilers would not need to be modified. Would this
be a viable alternative in the future?

If not, do you think it would require very significant changes to the
GCC frontend to make it annotate roots on the stack etc.?

I'm thinking along the lines of a command-line option a la:

llvm-gcc --emit-llvm -c myfile.c -o myfile.bc --garbage-collector=mygc

This could be a fun project, if the GCC code is not too hard to modify
like this. :-)

– Simon




More information about the llvm-dev mailing list