Commit d7b86136 authored by dterei's avatar dterei

LLVM: Use packed structure type instead of structure type

The regular structure type adds padding to conform to the platform ABI,
which causes problems with structures storing doubles under windows since
we don't conform to the platform ABI there. So we use packed structures
instead now that don't do any padding.
parent b017f34b
......@@ -55,7 +55,7 @@ instance Show LlvmType where
show (LMArray nr tp ) = "[" ++ show nr ++ " x " ++ show tp ++ "]"
show (LMLabel ) = "label"
show (LMVoid ) = "void"
show (LMStruct tys ) = "{" ++ (commaCat tys) ++ "}"
show (LMStruct tys ) = "<{" ++ (commaCat tys) ++ "}>"
show (LMFunction (LlvmFunctionDecl _ _ _ r varg p _))
= let args = ((drop 1).concat) $ -- use drop since it can handle empty lists
......@@ -144,9 +144,9 @@ instance Show LlvmStatic where
show (LMStaticStruc d t)
= let struc = case d of
[] -> "{}"
ts -> "{" ++ show (head ts) ++
concat (map (\x -> "," ++ show x) (tail ts)) ++ "}"
[] -> "<{}>"
ts -> "<{" ++ show (head ts) ++
concat (map (\x -> "," ++ show x) (tail ts)) ++ "}>"
in show t ++ " " ++ struc
show (LMStaticPointer v) = show v
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment