[cfe-dev] Running code on module load

David Chisnall csdavec at swansea.ac.uk
Sun Mar 2 07:29:16 PST 2008


Hi,

Most of the remaining parts of Objective-C code generation require  
code to be run when the module loads (calling runtime library  
functions to register the existence of classes, categories, protocols,  
and so on).

Looking at llvm-gcc, it seems that I need to put these in  
@llvm.global_ctors to have them automatically put in the .ctors  
section in the compiled module.  Does clang already have some  
infrastructure for collecting these and emitting the list?

David



More information about the cfe-dev mailing list