/
0002-Switch-to-LLVM-version-3.9.patch
70 lines (59 loc) · 2.36 KB
/
0002-Switch-to-LLVM-version-3.9.patch
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 672314cbeb8ac386a58f17dc4650dbdf4c55d8b5 Mon Sep 17 00:00:00 2001
From: Erik de Castro Lopo <erikd@mega-nerd.com>
Date: Thu, 7 Jul 2016 05:38:14 +1000
Subject: [PATCH] Switch to LLVM version 3.8
LLVM 3.8 was released a couple of months ago.
Test Plan: Build and test on x86_64/linux (perf-llvm) and armhf/linux.
Reviewers: austin, hvr, rwbarton, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2382
---
compiler/llvmGen/Llvm/PpLlvm.hs | 2 +-
compiler/llvmGen/Llvm/Types.hs | 8 ++++++++
configure.ac | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs
index 47e26ab..c9c1f95 100644
--- a/compiler/llvmGen/Llvm/PpLlvm.hs
+++ b/compiler/llvmGen/Llvm/PpLlvm.hs
@@ -73,7 +73,7 @@ ppLlvmGlobal (LMGlobal var@(LMGlobalVar _ _ link x a c) dat) =
Nothing -> empty
rhs = case dat of
- Just stat -> ppr stat
+ Just stat -> pprSpecialStatic stat
Nothing -> ppr (pLower $ getVarType var)
-- Position of linkage is different for aliases.
diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs
index 5c2ce5e..d2cab44 100644
--- a/compiler/llvmGen/Llvm/Types.hs
+++ b/compiler/llvmGen/Llvm/Types.hs
@@ -175,6 +175,14 @@ instance Outputable LlvmStatic where
ppr (LMSub s1 s2)
= pprStaticArith s1 s2 (sLit "sub") (sLit "fsub") "LMSub"
+
+pprSpecialStatic :: LlvmStatic -> SDoc
+pprSpecialStatic (LMBitc v t) =
+ ppr (pLower t) <> text ", bitcast (" <> ppr v <> text " to " <> ppr t
+ <> char ')'
+pprSpecialStatic stat = ppr stat
+
+
pprStaticArith :: LlvmStatic -> LlvmStatic -> LitString -> LitString -> String -> SDoc
pprStaticArith s1 s2 int_op float_op op_name =
let ty1 = getStatType s1
diff --git a/configure.ac b/configure.ac
index 664deb4..f4b839e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -519,7 +519,7 @@ esac
# tools we are looking for. In the past, GHC supported a number of
# versions of LLVM simultaneously, but that stopped working around
# 3.5/3.6 release of LLVM.
-LlvmVersion=3.7
+LlvmVersion=3.9
AC_SUBST([LlvmVersion])
sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/')
AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION], ${sUPPORTED_LLVM_VERSION}, [The supported LLVM version number])
--
2.9.1