[commit: ghc] wip/kavon-nosplit-llvm: adding alignment to info tables (323a27f)

git at git.haskell.org git at git.haskell.org
Tue Jun 27 09:16:41 UTC 2017


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

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

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

commit 323a27f594a6d2bcd254487a84e29483d89fde83
Author: Kavon Farvardin <kavon at farvard.in>
Date:   Wed Jun 7 17:44:34 2017 +0100

    adding alignment to info tables


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

323a27f594a6d2bcd254487a84e29483d89fde83
 compiler/llvmGen/LlvmCodeGen/Data.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs
index 7bf4d45..c3dfc49 100644
--- a/compiler/llvmGen/LlvmCodeGen/Data.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Data.hs
@@ -156,8 +156,10 @@ genStaticLit (CmmHighStackMark)
 -- The mangler will insert the ManglerStr representations of the
 -- CmmStatic at return points of a cpscall.
 cvtForMangler :: CmmStatics -> LlvmM ManglerStr
-cvtForMangler (Statics _ datum) =
-        mapM cvtStatic datum
+cvtForMangler (Statics _ datum) = do
+        let header = just align
+        body <- mapM cvtStatic datum
+        return $ header : body
     where
         cvtStatic :: CmmStatic -> LlvmM (B.ByteString -> B.ByteString)
         cvtStatic (CmmStaticLit lit) = cvtLit lit
@@ -213,6 +215,7 @@ cvtForMangler (Statics _ datum) =
         szName _ = error "szName -- invalid CmmInt width"
         
         eol = B.pack "\n"
+        align = B.pack "\t.p2align\t4, 0x90\n"
         just bstr _ = bstr
         
         -- eol = "\n"



More information about the ghc-commits mailing list