[commit: ghc] wip/kavon-nosplit-llvm: need to clean up but info tables are being emitted now (fc6f1f2)

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


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

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

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

commit fc6f1f2360cfda978a0e74f34c6544a62a69f306
Author: Kavon Farvardin <kavon at farvard.in>
Date:   Wed Jun 7 17:14:41 2017 +0100

    need to clean up but info tables are being emitted now


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

fc6f1f2360cfda978a0e74f34c6544a62a69f306
 compiler/llvmGen/LlvmCodeGen/Data.hs | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs
index 8e03d74..7bf4d45 100644
--- a/compiler/llvmGen/LlvmCodeGen/Data.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Data.hs
@@ -178,13 +178,31 @@ cvtForMangler (Statics _ datum) =
         --  then a == b. We rely on this property when creating
         --  its corresponding byte string.
         cvtLit (CmmLabelDiffOff srt _ off) = do
-            var <- getGlobalPtr =<< strCLabel_llvm srt
-            return $ dbg (B.pack "## diffOff -- get name of var ")
+            srtVar <- getGlobalPtr =<< strCLabel_llvm srt
+            let srtLab = asmNameOf srtVar
+            return $ mkDiffOff srtLab off
             
         cvtLit _ = return $ dbg (B.pack "## some other lit for ")
         
+        mkDiffOff srt off mine = B.concat [
+                szName W64,
+                srt,
+                B.pack "-",
+                mine,
+                B.pack ("+" ++ show off),
+                eol
+            ]
         
-        just bstr _ = bstr
+        -- TODO(kavon): consult dflags to put the right number of underscores on the name
+        asmNameOf (LMGlobalVar fs _ _ _ _ _) = let
+                llName = "_" ++ unpackFS fs
+            in
+                B.pack llName
+        
+        
+        
+        
+        -- XXX delete me later
         dbg bstr lab = B.concat [bstr, lab, eol]
             
         szName :: Width -> B.ByteString
@@ -195,6 +213,7 @@ cvtForMangler (Statics _ datum) =
         szName _ = error "szName -- invalid CmmInt width"
         
         eol = B.pack "\n"
+        just bstr _ = bstr
         
         -- eol = "\n"
         -- 



More information about the ghc-commits mailing list