[LLVMdev] Garbage Collection

Paul van der Ende paende at cs.uu.nl
Thu Mar 25 04:15:13 PDT 2010


Hello,

I want to add garbage collection support to a compiler with a llvm
backend, using the shadow-stack compiler plugin.

I read the GC tutorial in the LLVM documentation, and the paper about
shadow-stacks. Im currently adding intrinsics to my generated llvm code,
and trying to write code to connected it to my (existing) garbage
collector library. Im not sure yet how everything fits together.

Im particularly interested in how the llvm specific shadow-stack
transformation works to get a better understanding. Is it possible to
output the llvm instructions created from the gcroot intrinsics etc after
the transformation? At what compiler stage is the transformation
performed? I tried to find out what it does with the llvm instructions
from looking at the source code of the GCStrategy class, but I like to see
an example for my own code to see what is really happening. The llvm
specific cpp code is hard to understand because im not really a llvm
framework developer.

Another question, the GC tutorial refers to
"/runtime/GC/SemiSpace/semispace.cpp" (a simple gc on top of the
shadow-stack) but this file does not exist in the 2.6 release, I was able
to find it in older releases. Is it out-dated? will there be an example
garbage collector in the 2.7 release?

Are there any other code examples of garbage collectors written on top of
the llvm shadow stack?

Thanks,
Paul.




More information about the llvm-dev mailing list