From d9605a6582dab2d44fbf494b11dce49bf49115d9 Mon Sep 17 00:00:00 2001 From: Jia Liu Date: Fri, 2 Mar 2012 11:30:51 +0000 Subject: add llvm.gcroot into GarbageCollection.html, patch bylost lostfreeman@gmail.com. llvm-svn: 151908 --- llvm/docs/GarbageCollection.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'llvm/docs/GarbageCollection.html') diff --git a/llvm/docs/GarbageCollection.html b/llvm/docs/GarbageCollection.html index a226b0ee3e1..9e888649e7d 100644 --- a/llvm/docs/GarbageCollection.html +++ b/llvm/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 -- cgit v1.2.3