@@ -188,6 +188,7 @@ initDefs tgt =
188 , exfun "__idris_gmpMalloc" ptrI8 [intPtr] False
188 , exfun "__idris_gmpMalloc" ptrI8 [intPtr] False
189 , exfun "__idris_gmpRealloc" ptrI8 [ptrI8, intPtr, intPtr] False
189 , exfun "__idris_gmpRealloc" ptrI8 [ptrI8, intPtr, intPtr] False
190 , exfun "__idris_gmpFree" VoidType [ptrI8, intPtr] False
190 , exfun "__idris_gmpFree" VoidType [ptrI8, intPtr] False
191+ , exfun "__idris_strRev" ptrI8 [ptrI8] False
191 , exfun "strtoll" (IntegerType 64) [ptrI8, PointerType ptrI8 (AddrSpace 0), IntegerType 32] False
192 , exfun "strtoll" (IntegerType 64) [ptrI8, PointerType ptrI8 (AddrSpace 0), IntegerType 32] False
192 , exVar (stdinName tgt) ptrI8
193 , exVar (stdinName tgt) ptrI8
193 , exVar (stdoutName tgt) ptrI8
194 , exVar (stdoutName tgt) ptrI8
@@ -1027,6 +1028,10 @@ cgOp LStrLen [s] = do
1027 | x < 32 -> inst $ ZExt len (IntegerType 32) []
1028 | x < 32 -> inst $ ZExt len (IntegerType 32) []
1028 box (FArith (ATInt (ITFixed IT32))) len'
1029 box (FArith (ATInt (ITFixed IT32))) len'
1031+cgOp LStrRev [s] = do
1032+ ns <- unbox FString s
1033+ box FString =<< inst (simpleCall "__idris_strRev" [ns])
1030cgOp LReadStr [p] = do
1035cgOp LReadStr [p] = do
1031 np <- unbox FPtr p
1036 np <- unbox FPtr p
1032 s <- inst $ simpleCall "__idris_readStr" [np]
1037 s <- inst $ simpleCall "__idris_readStr" [np]