summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--codegen.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/codegen.hs b/codegen.hs
index 34a757c..cda6239 100644
--- a/codegen.hs
+++ b/codegen.hs
@@ -126,14 +126,14 @@ variableOperand name = get >>= (maybe getGlobal getLocal . Map.lookup name . var
where
getLocal :: (Type, LLName) -> CGMonad A.Operand
getLocal (t, nm) = do
- let loadoper = A.LocalReference (toLLVMType t) (A.Name nm)
+ let loadoper = A.LocalReference (A.ptr (toLLVMType t)) (A.Name nm)
label <- addInstr $ A.Load False loadoper Nothing 0 []
return $ A.LocalReference (toLLVMType t) (A.Name label)
getGlobal :: CGMonad A.Operand
getGlobal = do
(t, nm) <- lookupGlobalVar name
- let loadoper = A.ConstantOperand $ A.C.GlobalReference (toLLVMType t) (A.Name nm)
+ let loadoper = A.ConstantOperand $ A.C.GlobalReference (A.ptr (toLLVMType t)) (A.Name nm)
label <- addInstr $ A.Load False loadoper Nothing 0 []
return $ A.LocalReference (toLLVMType t) (A.Name label)