From: Jia Liu Date: Fri, 2 Mar 2012 11:30:51 +0000 (+0000) Subject: add llvm.gcroot into GarbageCollection.html, patch bylost lostfreeman@gmail.com. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=08bc33dcbb890386c04f9f097d1d064757f31157;p=oota-llvm.git add llvm.gcroot into GarbageCollection.html, patch bylost lostfreeman@gmail.com. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151908 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/GarbageCollection.html b/docs/GarbageCollection.html index a226b0ee3e1..9e888649e7d 100644 --- a/docs/GarbageCollection.html +++ b/docs/GarbageCollection.html @@ -1,4 +1,4 @@ - @@ -429,7 +429,8 @@ programs that use different garbage collection algorithms (or none at all).

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