A question about gcWriter

Hi all,

According to my understanding, gcWriter is a write barrier which will be inserted to the source code whenever there is a write to a pointer which is pointing to a heap address, right? My question is on which level llvm inserts the barrier? Does llvm do it on AST, I mean insert a function call node calling the write barrier function to the AST, or llvm does it on code generation step?