diff options
author | Jia Liu <proljc@gmail.com> | 2012-03-02 11:30:51 +0000 |
---|---|---|
committer | Jia Liu <proljc@gmail.com> | 2012-03-02 11:30:51 +0000 |
commit | 08bc33dcbb890386c04f9f097d1d064757f31157 (patch) | |
tree | 892868b59810f422da3cbe655b65733591594f29 /docs | |
parent | dc62a9069648e86846f9f5a8eed7ad29de6f4163 (diff) | |
download | external_llvm-08bc33dcbb890386c04f9f097d1d064757f31157.zip external_llvm-08bc33dcbb890386c04f9f097d1d064757f31157.tar.gz external_llvm-08bc33dcbb890386c04f9f097d1d064757f31157.tar.bz2 |
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
Diffstat (limited to 'docs')
-rw-r--r-- | docs/GarbageCollection.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/GarbageCollection.html b/docs/GarbageCollection.html index a226b0e..9e88864 100644 --- a/docs/GarbageCollection.html +++ b/docs/GarbageCollection.html @@ -1,4 +1,4 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> @@ -429,7 +429,8 @@ programs that use different garbage collection algorithms (or none at all).</p> <p>The <tt>llvm.gcroot</tt> 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 <a -href="#plugin">compiler plugin</a>.</p> +href="#plugin">compiler plugin</a>. All calls to <tt>llvm.gcroot</tt> <b>must</b> reside + inside the first basic block.</p> <p>A compiler which uses mem2reg to raise imperative code using <tt>alloca</tt> into SSA form need only add a call to <tt>@llvm.gcroot</tt> for those variables @@ -437,7 +438,9 @@ which a pointers into the GC heap.</p> <p>It is also important to mark intermediate values with <tt>llvm.gcroot</tt>. For example, consider <tt>h(f(), g())</tt>. Beware leaking the result of -<tt>f()</tt> in the case that <tt>g()</tt> triggers a collection.</p> +<tt>f()</tt> in the case that <tt>g()</tt> triggers a collection. Note, that +stack variables must be initialized and marked with <tt>llvm.gcroot</tt> in +function's prologue.</p> <p>The first argument <b>must</b> be a value referring to an alloca instruction or a bitcast of an alloca. The second contains a pointer to metadata that |