Skip to content

Commit

Permalink
Remove dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Dec 3, 2023
1 parent 58f035c commit a9d4b34
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
10 changes: 0 additions & 10 deletions src/Futhark/CodeGen/Backends/GenericC/Code.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
module Futhark.CodeGen.Backends.GenericC.Code
( compilePrimExp,
compileExp,
compileExpToName,
compileCode,
compileDest,
compileArg,
Expand Down Expand Up @@ -45,15 +44,6 @@ errorMsgString (ErrorMsg parts) = do
(formatstrs, formatargs) <- mapAndUnzipM onPart parts
pure (mconcat formatstrs, formatargs)

compileExpToName :: String -> PrimType -> Exp -> CompilerM op s VName
compileExpToName _ _ (LeafExp v _) =
pure v
compileExpToName desc t e = do
desc' <- newVName desc
e' <- compileExp e
decl [C.cdecl|$ty:(primTypeToCType t) $id:desc' = $e';|]
pure desc'

compileExp :: Exp -> CompilerM op s C.Exp
compileExp = compilePrimExp $ \v -> pure [C.cexp|$id:v|]

Expand Down
19 changes: 0 additions & 19 deletions src/Futhark/CodeGen/Backends/GenericPython.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module Futhark.CodeGen.Backends.GenericPython
compileCode,
compilePrimValue,
compilePrimType,
compilePrimTypeExt,
compilePrimToNp,
compilePrimToExtNp,
fromStorage,
Expand Down Expand Up @@ -1027,24 +1026,6 @@ compilePrimType t =
Imp.Bool -> "ct.c_bool"
Unit -> "ct.c_bool"

-- | The ctypes type corresponding to a 'PrimType', taking sign into account.
compilePrimTypeExt :: PrimType -> Imp.Signedness -> String
compilePrimTypeExt t ept =
case (t, ept) of
(IntType Int8, Imp.Unsigned) -> "ct.c_uint8"
(IntType Int16, Imp.Unsigned) -> "ct.c_uint16"
(IntType Int32, Imp.Unsigned) -> "ct.c_uint32"
(IntType Int64, Imp.Unsigned) -> "ct.c_uint64"
(IntType Int8, _) -> "ct.c_int8"
(IntType Int16, _) -> "ct.c_int16"
(IntType Int32, _) -> "ct.c_int32"
(IntType Int64, _) -> "ct.c_int64"
(FloatType Float16, _) -> "ct.c_uint16"
(FloatType Float32, _) -> "ct.c_float"
(FloatType Float64, _) -> "ct.c_double"
(Imp.Bool, _) -> "ct.c_bool"
(Unit, _) -> "ct.c_byte"

-- | The Numpy type corresponding to a 'PrimType'.
compilePrimToNp :: Imp.PrimType -> String
compilePrimToNp bt =
Expand Down

0 comments on commit a9d4b34

Please sign in to comment.