[llvm-commits] [llvm] r41879 - in /llvm/trunk: docs/GarbageCollection.html lib/Transforms/Scalar/LowerGC.cpp

Chris Lattner sabre at nondot.org
Wed Sep 12 10:53:12 PDT 2007


Author: lattner
Date: Wed Sep 12 12:53:10 2007
New Revision: 41879

URL: http://llvm.org/viewvc/llvm-project?rev=41879&view=rev
Log:
Change llvm.gcroot to not init the root to null at runtime, this prevents
using it for live-in values etc.

Modified:
    llvm/trunk/docs/GarbageCollection.html
    llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp

Modified: llvm/trunk/docs/GarbageCollection.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GarbageCollection.html?rev=41879&r1=41878&r2=41879&view=diff

==============================================================================
--- llvm/trunk/docs/GarbageCollection.html (original)
+++ llvm/trunk/docs/GarbageCollection.html Wed Sep 12 12:53:10 2007
@@ -166,9 +166,7 @@
 The <tt>llvm.gcroot</tt> intrinsic is used to inform LLVM of a pointer variable
 on the stack.  The first argument contains the address of the variable on the
 stack, and the second contains a pointer to metadata that should be associated
-with the pointer (which <b>must</b> be a constant or global value address).  At
-runtime, the <tt>llvm.gcroot</tt> intrinsic stores a null pointer into the
-specified location to initialize the pointer.</p>
+with the pointer (which <b>must</b> be a constant or global value address).</p>
 
 <p>
 Consider the following fragment of Java code:
@@ -193,6 +191,9 @@
    %X = alloca %Object*
    ...
 
+   ;; Java null-initializes pointers.
+   store %Object* null, %Object** %X
+
    ;; "CodeBlock" is the block corresponding to the start
    ;;  of the scope above.
 CodeBlock:

Modified: llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp?rev=41879&r1=41878&r2=41879&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LowerGC.cpp Wed Sep 12 12:53:10 2007
@@ -284,10 +284,7 @@
     new StoreInst(Null, RootPtrPtr, IP);
 
     // Each occurrance of the llvm.gcroot intrinsic now turns into an
-    // initialization of the slot with the address and a zeroing out of the
-    // address specified.
-    new StoreInst(Constant::getNullValue(PtrLocTy->getElementType()),
-                  GCRoots[i]->getOperand(1), GCRoots[i]);
+    // initialization of the slot with the address.
     new StoreInst(GCRoots[i]->getOperand(1), RootPtrPtr, GCRoots[i]);
   }
 





More information about the llvm-commits mailing list