Types for data types are now created.

This commit is contained in:
Samuel Hammersberg 2023-02-24 16:05:49 +01:00
parent 272fbe3504
commit 262543931c
3 changed files with 94 additions and 60 deletions

View file

@ -44,7 +44,7 @@ instance Show LLVMType where
Ref ty -> show ty <> "*"
Function t xs -> show t <> " (" <> intercalate ", " (map show xs) <> ")*"
Array n ty -> concat ["[", show n, " x ", show ty, "]"]
CustomType (Ident ty) -> ty
CustomType (Ident ty) -> "%" <> ty
data LLVMComp
= LLEq
@ -146,9 +146,9 @@ llvmIrToString = go 0
replicate i '\t' <> case l of
(Type (Ident n) types) ->
concat
[ "%", n, " = {"
, intercalate " , " (map show types)
, "}"
[ "%", n, " = type { "
, intercalate ", " (map show types)
, " }\n"
]
(Define c t (Ident i) params) ->
concat