summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorUbuntu <davidt@davidt-vm-32.scs.stanford.edu>2012-01-18 01:22:35 +0000
committerDavid Terei <davidterei@gmail.com>2012-01-18 01:40:21 +0000
commite86a7c7c75df3377ce961dc240f75abc845847bf (patch)
tree8cbf89fb3b4c454086183678231e5523fc9f2025 /compiler/llvmGen
parent51ba3c27b88ba9bec175342d22e17fe0bfc547d2 (diff)
downloadhaskell-e86a7c7c75df3377ce961dc240f75abc845847bf.tar.gz
Incorrect type conversion in LLVM backend (#5785).
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/Llvm/Types.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs
index 07e53fb731..35de40bdc4 100644
--- a/compiler/llvmGen/Llvm/Types.hs
+++ b/compiler/llvmGen/Llvm/Types.hs
@@ -7,6 +7,7 @@ module Llvm.Types where
#include "HsVersions.h"
import Data.Char
+import Data.Int
import Data.List (intercalate)
import Numeric
@@ -223,7 +224,9 @@ getPlainName (LMLitVar x ) = getLit x
-- | Print a literal value. No type.
getLit :: LlvmLit -> String
-getLit (LMIntLit i _ ) = show ((fromInteger i)::Int)
+getLit (LMIntLit i (LMInt 32)) = show (fromInteger i :: Int32)
+getLit (LMIntLit i (LMInt 64)) = show (fromInteger i :: Int64)
+getLit (LMIntLit i _ ) = show (fromInteger i :: Int)
getLit (LMFloatLit r LMFloat ) = fToStr $ realToFrac r
getLit (LMFloatLit r LMDouble) = dToStr r
getLit f@(LMFloatLit _ _) = error $ "Can't print this float literal!" ++ show f