on master help sign in
Merge branch 'ITChar' into JavaRepairs
fff6b19Jan Bessai
src/Core/Execute.hs−1
@@ -469,7 +469,6 @@ getFTy (EApp (EP _ (UN "FIntT") _) (EP _ (UN intTy) _)) =
469getFTy (EP _ (UN t) _) =
469getFTy (EP _ (UN t) _) =
470 case t of
470 case t of
471 "FFloat" -> Just (FArith ATFloat)
471 "FFloat" -> Just (FArith ATFloat)
472− "FChar" -> Just FChar
473 "FString" -> Just FString
472 "FString" -> Just FString
474 "FPtr" -> Just FPtr
473 "FPtr" -> Just FPtr
475 "FUnit" -> Just FUnit
474 "FUnit" -> Just FUnit
src/IRTS/CodegenC.hs−2
@@ -233,7 +233,6 @@ c_irts (FArith (ATInt ITNative)) l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
233c_irts (FArith (ATInt ITChar)) l x = c_irts (FArith (ATInt ITNative)) l x
233c_irts (FArith (ATInt ITChar)) l x = c_irts (FArith (ATInt ITNative)) l x
234c_irts (FArith (ATInt (ITFixed ity))) l x
234c_irts (FArith (ATInt (ITFixed ity))) l x
235 = l ++ "idris_b" ++ show (nativeTyWidth ity) ++ "const(vm, " ++ x ++ ")"
235 = l ++ "idris_b" ++ show (nativeTyWidth ity) ++ "const(vm, " ++ x ++ ")"
236−c_irts FChar l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
237c_irts FString l x = l ++ "MKSTR(vm, " ++ x ++ ")"
236c_irts FString l x = l ++ "MKSTR(vm, " ++ x ++ ")"
238c_irts FUnit l x = x
237c_irts FUnit l x = x
239c_irts FPtr l x = l ++ "MKPTR(vm, " ++ x ++ ")"
238c_irts FPtr l x = l ++ "MKPTR(vm, " ++ x ++ ")"
@@ -244,7 +243,6 @@ irts_c (FArith (ATInt ITNative)) x = "GETINT(" ++ x ++ ")"
244irts_c (FArith (ATInt ITChar)) x = irts_c (FArith (ATInt ITNative)) x
243irts_c (FArith (ATInt ITChar)) x = irts_c (FArith (ATInt ITNative)) x
245irts_c (FArith (ATInt (ITFixed ity))) x
244irts_c (FArith (ATInt (ITFixed ity))) x
246 = "(" ++ x ++ "->info.bits" ++ show (nativeTyWidth ity) ++ ")"
245 = "(" ++ x ++ "->info.bits" ++ show (nativeTyWidth ity) ++ ")"
247−irts_c FChar x = "GETINT(" ++ x ++ ")"
248irts_c FString x = "GETSTR(" ++ x ++ ")"
246irts_c FString x = "GETSTR(" ++ x ++ ")"
249irts_c FUnit x = x
247irts_c FUnit x = x
250irts_c FPtr x = "GETPTR(" ++ x ++ ")"
248irts_c FPtr x = "GETPTR(" ++ x ++ ")"
src/IRTS/CodegenLLVM.hs+4−4
@@ -732,7 +732,7 @@ cgConst c@(TT.B16V v) = box (FArith (ATInt (ITVec IT16 (V.length v)))) (Constant
732cgConst c@(TT.B32V v) = box (FArith (ATInt (ITVec IT32 (V.length v)))) (ConstantOperand $ cgConst' c)
732cgConst c@(TT.B32V v) = box (FArith (ATInt (ITVec IT32 (V.length v)))) (ConstantOperand $ cgConst' c)
733cgConst c@(TT.B64V v) = box (FArith (ATInt (ITVec IT64 (V.length v)))) (ConstantOperand $ cgConst' c)
733cgConst c@(TT.B64V v) = box (FArith (ATInt (ITVec IT64 (V.length v)))) (ConstantOperand $ cgConst' c)
734cgConst c@(TT.Fl _) = box (FArith ATFloat) (ConstantOperand $ cgConst' c)
734cgConst c@(TT.Fl _) = box (FArith ATFloat) (ConstantOperand $ cgConst' c)
735−cgConst c@(TT.Ch _) = box FChar (ConstantOperand $ cgConst' c)
735+cgConst c@(TT.Ch _) = box (FArith (ATInt ITChar)) (ConstantOperand $ cgConst' c)
736cgConst c@(TT.Str s) = do
736cgConst c@(TT.Str s) = do
737 str <- addGlobal' (ArrayType (1 + fromIntegral (length s)) (IntegerType 8)) (cgConst' c)
737 str <- addGlobal' (ArrayType (1 + fromIntegral (length s)) (IntegerType 8)) (cgConst' c)
738 box FString (ConstantOperand $ C.GetElementPtr True str [C.Int 32 0, C.Int 32 0])
738 box FString (ConstantOperand $ C.GetElementPtr True str [C.Int 32 0, C.Int 32 0])
@@ -947,7 +947,7 @@ cgOp (LStrInt ity) [s] = do
947cgOp LStrConcat [x,y] = cgStrCat x y
947cgOp LStrConcat [x,y] = cgStrCat x y
948
948
949cgOp LStrCons [c,s] = do
949cgOp LStrCons [c,s] = do
950− nc <- unbox FChar c
950+ nc <- unbox (FArith (ATInt ITChar)) c
951 ns <- unbox FString s
951 ns <- unbox FString s
952 nc' <- inst $ Trunc nc (IntegerType 8) []
952 nc' <- inst $ Trunc nc (IntegerType 8) []
953 r <- inst $ simpleCall "__idris_strCons" [nc', ns]
953 r <- inst $ simpleCall "__idris_strCons" [nc', ns]
@@ -957,7 +957,7 @@ cgOp LStrHead [c] = do
957 s <- unbox FString c
957 s <- unbox FString c
958 c <- inst $ Load False s Nothing 0 []
958 c <- inst $ Load False s Nothing 0 []
959 c' <- inst $ ZExt c (IntegerType 32) []
959 c' <- inst $ ZExt c (IntegerType 32) []
960− box FChar c'
960+ box (FArith (ATInt ITChar)) c'
961
961
962cgOp LStrIndex [s, i] = do
962cgOp LStrIndex [s, i] = do
963 ns <- unbox FString s
963 ns <- unbox FString s
@@ -965,7 +965,7 @@ cgOp LStrIndex [s, i] = do
965 p <- inst $ GetElementPtr True ns [ni] []
965 p <- inst $ GetElementPtr True ns [ni] []
966 c <- inst $ Load False p Nothing 0 []
966 c <- inst $ Load False p Nothing 0 []
967 c' <- inst $ ZExt c (IntegerType 32) []
967 c' <- inst $ ZExt c (IntegerType 32) []
968− box FChar c'
968+ box (FArith (ATInt ITChar)) c'
969
969
970cgOp LStrTail [c] = do
970cgOp LStrTail [c] = do
971 s <- unbox FString c
971 s <- unbox FString c
src/IRTS/Lang.hs−1
@@ -66,7 +66,6 @@ data FLang = LANG_C | LANG_JAVA FCallType
66data FType = FArith ArithTy
66data FType = FArith ArithTy
67 | FFunction
67 | FFunction
68 | FFunctionIO
68 | FFunctionIO
69− | FChar
70 | FString
69 | FString
71 | FUnit
70 | FUnit
72 | FPtr
71 | FPtr