File: 0002-llvmGen-Allow-LlvmLits-in-MetaExprs.patch

package info (click to toggle)
ghc 9.6.6-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 158,216 kB
  • sloc: haskell: 648,228; ansic: 81,656; cpp: 11,808; javascript: 8,444; sh: 5,831; fortran: 3,527; python: 3,277; asm: 2,523; makefile: 2,298; yacc: 1,570; lisp: 532; xml: 196; perl: 145; csh: 2
file content (38 lines) | stat: -rw-r--r-- 1,479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Origin: https://github.com/ghc/ghc/commit/5880fff6d353a14785c457999fded5a7100c9514
From 5880fff6d353a14785c457999fded5a7100c9514 Mon Sep 17 00:00:00 2001
From: Wang Xin <wangxin03@loongson.cn>
Date: Fri, 13 Dec 2024 03:47:29 +0000
Subject: [PATCH] llvmGen: Allow LlvmLits in MetaExprs

---
 compiler/GHC/Llvm/MetaData.hs | 1 +
 compiler/GHC/Llvm/Ppr.hs      | 1 +
 2 files changed, 2 insertions(+)

diff --git a/compiler/GHC/Llvm/MetaData.hs b/compiler/GHC/Llvm/MetaData.hs
index 8f1ba411..5d0a996c 100644
--- a/compiler/GHC/Llvm/MetaData.hs
+++ b/compiler/GHC/Llvm/MetaData.hs
@@ -77,6 +77,7 @@ instance Outputable MetaId where
 
 -- | LLVM metadata expressions
 data MetaExpr = MetaStr !LMString
+              | MetaLit !LlvmLit
               | MetaNode !MetaId
               | MetaVar !LlvmVar
               | MetaStruct [MetaExpr]
diff --git a/compiler/GHC/Llvm/Ppr.hs b/compiler/GHC/Llvm/Ppr.hs
index 787b6efc..bcb73b74 100644
--- a/compiler/GHC/Llvm/Ppr.hs
+++ b/compiler/GHC/Llvm/Ppr.hs
@@ -256,6 +256,7 @@ ppMetaExpr :: LlvmCgConfig -> MetaExpr -> SDoc
 ppMetaExpr opts = \case
   MetaVar (LMLitVar (LMNullLit _)) -> text "null"
   MetaStr    s                     -> char '!' <> doubleQuotes (ftext s)
+  MetaLit    l                     -> ppTypeLit opts l
   MetaNode   n                     -> ppr n
   MetaVar    v                     -> ppVar opts v
   MetaStruct es                    -> char '!' <> braces (ppCommaJoin (map (ppMetaExpr opts) es))
-- 
2.45.2