Removed some unused code.

This commit is contained in:
Samuel Hammersberg 2023-02-24 09:29:55 +01:00
parent 5d004f4286
commit 272fbe3504

View file

@ -98,7 +98,8 @@ type Args = [(LLVMType, LLVMValue)]
-- | A datatype which represents different instructions in LLVM -- | A datatype which represents different instructions in LLVM
data LLVMIr data LLVMIr
= Define CallingConvention LLVMType Ident Params = Type Ident [LLVMType]
| Define CallingConvention LLVMType Ident Params
| DefineEnd | DefineEnd
| Declare LLVMType Ident Params | Declare LLVMType Ident Params
| SetVariable Ident LLVMIr | SetVariable Ident LLVMIr
@ -143,6 +144,12 @@ llvmIrToString = go 0
insToString :: Int -> LLVMIr -> String insToString :: Int -> LLVMIr -> String
insToString i l = insToString i l =
replicate i '\t' <> case l of replicate i '\t' <> case l of
(Type (Ident n) types) ->
concat
[ "%", n, " = {"
, intercalate " , " (map show types)
, "}"
]
(Define c t (Ident i) params) -> (Define c t (Ident i) params) ->
concat concat
[ "define ", show c, " ", show t, " @", i [ "define ", show c, " ", show t, " @", i