[LLVMdev] CollectorRegistry

Gordon Henriksen gordonhenriksen at me.com
Sat Jul 26 08:49:26 PDT 2008


On Jul 26, 2008, at 10:32, Simon Ask Ulsnes wrote:

> I forgot I still needed an answer to my original question. :-P
>
> So, I have to implement llvm_gc_initialize, llvm_gc_allocate, and  
> llvm_gc_collect

Yes. Your implementation of the llvm_gc_* functions should be compiled  
into a library and linked with your executable.

> (llvm_cg_walk_gcroots is provided by the Collector framework, right?)

An implementation of llvm_cg_walk_gcroots compatible with  
ShadowStackCollector is provided in the llvm/runtime directory. You  
can copy it into your runtime.

> in those methods, how do I access the Collector object instantiated  
> by LLVM?

I'm not sure the purpose of doing so—llvm::Collector (poorly named;  
I'm open to suggestions) exists only in the compiler, not at runtime  
in the compiled program. You should need access to it at runtime no  
more than you might need access to an instance of llvm::TargetMachine.

— Gordon





More information about the llvm-dev mailing list