LLVM: Use getelementptr instruction for a lot of situations
authorDavid Terei <davidterei@gmail.com>
Wed, 30 Jun 2010 18:11:57 +0000 (18:11 +0000)
committerDavid Terei <davidterei@gmail.com>
Wed, 30 Jun 2010 18:11:57 +0000 (18:11 +0000)
commita42400e6c9074cf22d0c2dac791345840e3d9419
tree3826be9af086b77163480840a398f3d86e864fa2
parent95240c4420e47d06c03ec5d36784102386fae445
LLVM: Use getelementptr instruction for a lot of situations

LLVM supports creating pointers in two ways, firstly through
pointer arithmetic (by casting between pointers and ints)
and secondly using the getelementptr instruction. The second way
is preferable as it gives LLVM more information to work with.

This patch changes a lot of pointer related code from the first
method to the getelementptr method.
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/llvmGen/LlvmCodeGen/Regs.hs