diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-08-21 17:44:38 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-08-21 17:44:38 +0100 |
commit | 75700644a7430612b40ba94476a5749594010671 (patch) | |
tree | 4f1717e39ef576a35cbd65706582067b56d14487 /compiler/llvmGen/LlvmCodeGen/Base.hs | |
parent | 07295e96981b29cc6fb88b334d8ebd4b1b807516 (diff) | |
download | haskell-75700644a7430612b40ba94476a5749594010671.tar.gz |
Move activeStgRegs into CodeGen.Platform
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/Base.hs')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/Base.hs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 77eb8451ab..d9a43fb249 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -99,17 +99,20 @@ llvmFunSig env lbl link llvmFunSig' :: DynFlags -> LMString -> LlvmLinkageType -> LlvmFunctionDecl llvmFunSig' dflags lbl link - = let toParams x | isPointer x = (x, [NoAlias, NoCapture]) + = let platform = targetPlatform dflags + toParams x | isPointer x = (x, [NoAlias, NoCapture]) | otherwise = (x, []) in LlvmFunctionDecl lbl link (llvmGhcCC dflags) LMVoid FixedArgs - (map (toParams . getVarType) llvmFunArgs) llvmFunAlign + (map (toParams . getVarType) (llvmFunArgs platform)) + llvmFunAlign -- | Create a Haskell function in LLVM. mkLlvmFunc :: LlvmEnv -> CLabel -> LlvmLinkageType -> LMSection -> LlvmBlocks -> LlvmFunction mkLlvmFunc env lbl link sec blks - = let funDec = llvmFunSig env lbl link - funArgs = map (fsLit . getPlainName) llvmFunArgs + = let platform = targetPlatform $ getDflags env + funDec = llvmFunSig env lbl link + funArgs = map (fsLit . getPlainName) (llvmFunArgs platform) in LlvmFunction funDec funArgs llvmStdFunAttrs sec blks -- | Alignment to use for functions @@ -121,8 +124,8 @@ llvmInfAlign :: LMAlign llvmInfAlign = Just wORD_SIZE -- | A Function's arguments -llvmFunArgs :: [LlvmVar] -llvmFunArgs = map lmGlobalRegArg activeStgRegs +llvmFunArgs :: Platform -> [LlvmVar] +llvmFunArgs platform = map lmGlobalRegArg (activeStgRegs platform) -- | Llvm standard fun attributes llvmStdFunAttrs :: [LlvmFuncAttr] |