summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-01-27 13:13:06 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-04 16:14:47 -0500
commitb79206f1add1c9e9a88f1cc9e2d2c47be9bfea3e (patch)
treebba42401596cc079360c99839db74bb760b62a5c
parentde6d7692af8efdf92d75647ad3734594cfd1e588 (diff)
downloadhaskell-b79206f1add1c9e9a88f1cc9e2d2c47be9bfea3e.tar.gz
Add comments
-rw-r--r--compiler/GHC/StgToCmm/Utils.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs
index 4e061ad168..67fb8c621e 100644
--- a/compiler/GHC/StgToCmm/Utils.hs
+++ b/compiler/GHC/StgToCmm/Utils.hs
@@ -102,12 +102,14 @@ addToMemLbl rep lbl = addToMem rep (CmmLit (CmmLabel lbl))
addToMemLblE :: CmmType -> CLabel -> CmmExpr -> CmmAGraph
addToMemLblE rep lbl = addToMemE rep (CmmLit (CmmLabel lbl))
+-- | @addToMem rep ptr n@ adds @n@ to the integer pointed-to by @ptr@.
addToMem :: CmmType -- rep of the counter
-> CmmExpr -- Address
-> Int -- What to add (a word)
-> CmmAGraph
addToMem rep ptr n = addToMemE rep ptr (CmmLit (CmmInt (toInteger n) (typeWidth rep)))
+-- | @addToMemE rep ptr n@ adds @n@ to the integer pointed-to by @ptr@.
addToMemE :: CmmType -- rep of the counter
-> CmmExpr -- Address
-> CmmExpr -- What to add (a word-typed expression)