on master help sign in
Merge branch 'ITChar' into JavaRepairs
commitfff6b196c806dc08eac399d915efbf66ca3e4966 authorJan Bessai <Jan.Bessai@tu-dortmund.de> dateMon 8 Jul 2013, 20:44 (13 years ago) parent9991ac2a0130b9
4 files changed+4−8
src/Core/Execute.hs−1 src/IRTS/CodegenC.hs−2 src/IRTS/CodegenLLVM.hs+4−4 src/IRTS/Lang.hs−1
src/Core/Execute.hs−1
@@ -469,7 +469,6 @@ getFTy (EApp (EP _ (UN "FIntT") _) (EP _ (UN intTy) _)) =
469469getFTy (EP _ (UN t) _) =
470470 case t of
471471 "FFloat" -> Just (FArith ATFloat)
472− "FChar" -> Just FChar
473472 "FString" -> Just FString
474473 "FPtr" -> Just FPtr
475474 "FUnit" -> Just FUnit
src/IRTS/CodegenC.hs−2
@@ -233,7 +233,6 @@ c_irts (FArith (ATInt ITNative)) l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
233233c_irts (FArith (ATInt ITChar)) l x = c_irts (FArith (ATInt ITNative)) l x
234234c_irts (FArith (ATInt (ITFixed ity))) l x
235235 = l ++ "idris_b" ++ show (nativeTyWidth ity) ++ "const(vm, " ++ x ++ ")"
236−c_irts FChar l x = l ++ "MKINT((i_int)(" ++ x ++ "))"
237236c_irts FString l x = l ++ "MKSTR(vm, " ++ x ++ ")"
238237c_irts FUnit l x = x
239238c_irts FPtr l x = l ++ "MKPTR(vm, " ++ x ++ ")"
@@ -244,7 +243,6 @@ irts_c (FArith (ATInt ITNative)) x = "GETINT(" ++ x ++ ")"
244243irts_c (FArith (ATInt ITChar)) x = irts_c (FArith (ATInt ITNative)) x
245244irts_c (FArith (ATInt (ITFixed ity))) x
246245 = "(" ++ x ++ "->info.bits" ++ show (nativeTyWidth ity) ++ ")"
247−irts_c FChar x = "GETINT(" ++ x ++ ")"
248246irts_c FString x = "GETSTR(" ++ x ++ ")"
249247irts_c FUnit x = x
250248irts_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
732732cgConst c@(TT.B32V v) = box (FArith (ATInt (ITVec IT32 (V.length v)))) (ConstantOperand $ cgConst' c)
733733cgConst c@(TT.B64V v) = box (FArith (ATInt (ITVec IT64 (V.length v)))) (ConstantOperand $ cgConst' c)
734734cgConst 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)
736736cgConst c@(TT.Str s) = do
737737 str <- addGlobal' (ArrayType (1 + fromIntegral (length s)) (IntegerType 8)) (cgConst' c)
738738 box FString (ConstantOperand $ C.GetElementPtr True str [C.Int 32 0, C.Int 32 0])
@@ -947,7 +947,7 @@ cgOp (LStrInt ity) [s] = do
947947cgOp LStrConcat [x,y] = cgStrCat x y
948948
949949cgOp LStrCons [c,s] = do
950− nc <- unbox FChar c
950+ nc <- unbox (FArith (ATInt ITChar)) c
951951 ns <- unbox FString s
952952 nc' <- inst $ Trunc nc (IntegerType 8) []
953953 r <- inst $ simpleCall "__idris_strCons" [nc', ns]
@@ -957,7 +957,7 @@ cgOp LStrHead [c] = do
957957 s <- unbox FString c
958958 c <- inst $ Load False s Nothing 0 []
959959 c' <- inst $ ZExt c (IntegerType 32) []
960− box FChar c'
960+ box (FArith (ATInt ITChar)) c'
961961
962962cgOp LStrIndex [s, i] = do
963963 ns <- unbox FString s
@@ -965,7 +965,7 @@ cgOp LStrIndex [s, i] = do
965965 p <- inst $ GetElementPtr True ns [ni] []
966966 c <- inst $ Load False p Nothing 0 []
967967 c' <- inst $ ZExt c (IntegerType 32) []
968− box FChar c'
968+ box (FArith (ATInt ITChar)) c'
969969
970970cgOp LStrTail [c] = do
971971 s <- unbox FString c
src/IRTS/Lang.hs−1
@@ -66,7 +66,6 @@ data FLang = LANG_C | LANG_JAVA FCallType
6666data FType = FArith ArithTy
6767 | FFunction
6868 | FFunctionIO
69− | FChar
7069 | FString
7170 | FUnit
7271 | FPtr