[commit: ghc] wip/kavon-nosplit-llvm: set the return type to be a struct of the arg tys (e375009)

git at git.haskell.org git at git.haskell.org
Tue Jun 27 09:15:04 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/kavon-nosplit-llvm
Link       : http://ghc.haskell.org/trac/ghc/changeset/e37500967432cdf5983fa868f168acb1c3a58c22/ghc

>---------------------------------------------------------------

commit e37500967432cdf5983fa868f168acb1c3a58c22
Author: Kavon Farvardin <kavon at farvard.in>
Date:   Tue May 16 09:55:48 2017 +0100

    set the return type to be a struct of the arg tys


>---------------------------------------------------------------

e37500967432cdf5983fa868f168acb1c3a58c22
 compiler/llvmGen/LlvmCodeGen/Base.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index 8b01da8..46d01bf 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -124,9 +124,11 @@ llvmFunSig' live lbl link
   = do let toParams x | isPointer x = (x, [NoAlias, NoCapture])
                       | otherwise   = (x, [])
        dflags <- getDynFlags
-       let retTy = LMFloat -- TODO: generate the struct that we will return.
+       -- the standard set of argument types passed/returned.
+       let stdConvention = map getVarType (llvmFunArgs dflags live)
+       let retTy = LMStructU $ stdConvention
        return $ LlvmFunctionDecl lbl link (llvmGhcCC dflags) retTy FixedArgs
-                                 (map (toParams . getVarType) (llvmFunArgs dflags live))
+                                 (map toParams stdConvention)
                                  (llvmFunAlign dflags)
 
 -- | Alignment to use for functions



More information about the ghc-commits mailing list