diff options
-rw-r--r-- | codegen.hs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |