[pypy-svn] r23864 - pypy/dist/pypy/translator/llvm

rxe at codespeak.net rxe at codespeak.net
Wed Mar 1 22:28:41 CET 2006


Author: rxe
Date: Wed Mar  1 22:28:39 2006
New Revision: 23864

Modified:
   pypy/dist/pypy/translator/llvm/codewriter.py
Log:
(mwh, rxe)

I (rxe) keep forgetting why we need this... hence the comment.



Modified: pypy/dist/pypy/translator/llvm/codewriter.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/codewriter.py	(original)
+++ pypy/dist/pypy/translator/llvm/codewriter.py	Wed Mar  1 22:28:39 2006
@@ -135,7 +135,12 @@
                      "%(fromvar)s to %(targettype)s" % locals())
 
     def getelementptr(self, targetvar, type, typevar, indices, getptr=True):
-        # XXX comment getptr
+        # getelementptr gives you back a value for the last thing indexed
+
+        # what is getptr?
+        # ---------------
+        # All global variables in LLVM are pointers, and pointers must also be
+        # dereferenced with the getelementptr instruction (hence the uint 0)
         if getptr:
             indices = [(self.word_repr, 0)] + list(indices)
         res = "%(targetvar)s = getelementptr %(type)s %(typevar)s, " % locals()



More information about the Pypy-commit mailing list