on master help sign in
Remove redundant enName function

It's just the show instance for Endianness

commita47adaacdcb7f74157ec23e3a42419ba2ad80ce7 authorShea Levy <shea@shealevy.com> dateThu 30 Jan 2014, 16:27 (13 years ago) parenta2332b0
3 files changed+4−9
src/IRTS/CodegenC.hs+2−2 src/IRTS/Lang.hs−5 src/Idris/Primitives.hs+2−2
src/IRTS/CodegenC.hs+2−2
@@ -461,8 +461,8 @@ doOp v LAllocate [x] = v ++ "idris_allocate(vm, " ++ creg x ++ ")"
461461doOp v LCopy [x, y] = v ++ "idris_copy(vm, " ++ creg x ++ "," ++ creg y ++ ")"
462462doOp v LAppendBuffer [a, b, c, d, e] = v ++ "idris_appendBuffer(vm, " ++ creg a ++ "," ++ creg b ++ "," ++ creg c ++ "," ++ creg d ++ "," ++ creg e ++ ")"
463463doOp v LPeekBuffer [x, y] = v ++ "idris_peekBuffer(vm, " ++ creg x ++ "," ++ creg y ++ ")"
464−doOp v (LAppend ity en) [a, b, c, d] = v ++ "idris_append" ++ intTyName ity ++ enName en ++ "(vm, " ++ creg a ++ "," ++ creg b ++ "," ++ creg c ++ "," ++ creg d ++ ")"
465−doOp v (LPeek ity en) [x, y] = v ++ "idris_peek" ++ intTyName ity ++ enName en ++ "(vm, " ++ creg x ++ "," ++ creg y ++ ")"
464+doOp v (LAppend ity en) [a, b, c, d] = v ++ "idris_append" ++ intTyName ity ++ show en ++ "(vm, " ++ creg a ++ "," ++ creg b ++ "," ++ creg c ++ "," ++ creg d ++ ")"
465+doOp v (LPeek ity en) [x, y] = v ++ "idris_peek" ++ intTyName ity ++ show en ++ "(vm, " ++ creg x ++ "," ++ creg y ++ ")"
466466
467467doOp v LStdIn [] = v ++ "MKPTR(vm, stdin)"
468468doOp v LStdOut [] = v ++ "MKPTR(vm, stdout)"
src/IRTS/Lang.hs−5
@@ -7,11 +7,6 @@ import Debug.Trace
77
88data Endianness = Native | BE | LE deriving (Show, Eq)
99
10−enName :: Endianness -> String
11−enName Native = "Native"
12−enName BE = "BE"
13−enName LE = "LE"
14−
1510data LVar = Loc Int | Glob Name
1611 deriving (Show, Eq)
1712
src/Idris/Primitives.hs+2−2
@@ -287,10 +287,10 @@ fixedOps ity@(ITFixed _) =
287287 tyName = intTyName ity
288288 b64 = AType (ATInt (ITFixed IT64))
289289 thisTy = AType $ ATInt ity
290− appendFun en = Prim (sUN $ "prim__append" ++ tyName ++ enName en)
290+ appendFun en = Prim (sUN $ "prim__append" ++ tyName ++ show en)
291291 (ty [BufferType, b64, b64, thisTy] BufferType)
292292 4 (p_cantreduce) (4, LAppend ity en) partial
293− peekFun en = Prim (sUN $ "prim__peek" ++ tyName ++ enName en)
293+ peekFun en = Prim (sUN $ "prim__peek" ++ tyName ++ show en)
294294 (ty [BufferType, b64] thisTy)
295295 2 (p_cantreduce) (2, LPeek ity en) partial
296296