From 08bc33dcbb890386c04f9f097d1d064757f31157 Mon Sep 17 00:00:00 2001
From: Jia Liu
The llvm.gcroot intrinsic is used to inform LLVM that a stack variable references an object on the heap and is to be tracked for garbage collection. The exact impact on generated code is specified by a compiler plugin.
+href="#plugin">compiler plugin. All calls to llvm.gcroot must reside + inside the first basic block.A compiler which uses mem2reg to raise imperative code using alloca into SSA form need only add a call to @llvm.gcroot for those variables @@ -437,7 +438,9 @@ which a pointers into the GC heap.
It is also important to mark intermediate values with llvm.gcroot. For example, consider h(f(), g()). Beware leaking the result of -f() in the case that g() triggers a collection.
+f() in the case that g() triggers a collection. Note, that +stack variables must be initialized and marked with llvm.gcroot in +function's prologue.The first argument must be a value referring to an alloca instruction or a bitcast of an alloca. The second contains a pointer to metadata that