From ebd63e8de30470ccf8b65c11f0fc82705960b5cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= <omeragacan@gmail.com>
Date: Mon, 24 Jun 2019 14:24:58 +0300
Subject: [PATCH] Simplify link_caf and mkForeignLabel functions

---
 compiler/cmm/CLabel.hs         | 3 +--
 compiler/codeGen/StgCmmBind.hs | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 95f5a41a23e6..0c3dae8001bd 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -579,8 +579,7 @@ mkForeignLabel
         -> FunctionOrData
         -> CLabel
 
-mkForeignLabel str mb_sz src fod
-    = ForeignLabel str mb_sz src  fod
+mkForeignLabel = ForeignLabel
 
 
 -- | Update the label size field in a ForeignLabel
diff --git a/compiler/codeGen/StgCmmBind.hs b/compiler/codeGen/StgCmmBind.hs
index f8bdc0d37ee9..6e6e6ac79192 100644
--- a/compiler/codeGen/StgCmmBind.hs
+++ b/compiler/codeGen/StgCmmBind.hs
@@ -664,7 +664,7 @@ setupUpdate closure_info node body
 
         ; if closureUpdReqd closure_info
           then do       -- Blackhole the (updatable) CAF:
-                { upd_closure <- link_caf node True
+                { upd_closure <- link_caf node
                 ; pushUpdateFrame mkBHUpdInfoLabel upd_closure body }
           else do {tickyUpdateFrameOmitted; body}
     }
@@ -704,11 +704,10 @@ emitUpdateFrame dflags frame lbl updatee = do
 -- See Note [CAF management] in rts/sm/Storage.c
 
 link_caf :: LocalReg           -- pointer to the closure
-         -> Bool               -- True <=> updatable, False <=> single-entry
          -> FCode CmmExpr      -- Returns amode for closure to be updated
 -- This function returns the address of the black hole, so it can be
 -- updated with the new value when available.
-link_caf node _is_upd = do
+link_caf node = do
   { dflags <- getDynFlags
         -- Call the RTS function newCAF, returning the newly-allocated
         -- blackhole indirection closure
-- 
GitLab