aboutsummaryrefslogtreecommitdiffstats
path: root/testing/julia/0005-llvm-3.8.patch
blob: c301f964c2cde27cc264504c4244368b6a9c0d7f (plain)
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
Description: LLVM 3.8 compatibility
 These fixes come straight from upstream's git.
Origin: Upstream, https://github.com/JuliaLang/julia/commit/b67609b988febe062e6709d8972c4f869c82cfc0
Origin: Upstream, https://github.com/JuliaLang/julia/commit/3f6abadc9d12bb9d59ec775db4277b3841395d0b
Origin: Upstream, https://github.com/JuliaLang/julia/commit/caf3c74426696d43101d9607b1a2cd3a5e05bc0f
Author: Graham Inggs <ginggs@debian.org>
Last-Update: 2016-02-03
--- a/src/cgutils.cpp
+++ b/src/cgutils.cpp
@@ -219,7 +219,11 @@
         }
     }
 
+#ifdef LLVM38
+    virtual Value *materializeDeclFor(Value *V)
+#else
     virtual Value *materializeValueFor (Value *V)
+#endif
     {
         Function *F = dyn_cast<Function>(V);
         if (F) {
@@ -492,7 +496,11 @@
 
     // now copy the module, since PM.run may modify it
     ValueToValueMapTy VMap;
+#ifdef LLVM38
+    Module *clone = CloneModule(shadow_module, VMap).release();
+#else
     Module *clone = CloneModule(shadow_module, VMap);
+#endif
 #ifdef LLVM37
     // Reset the target triple to make sure it matches the new target machine
     clone->setTargetTriple(TM->getTargetTriple().str());
--- a/src/intrinsics.cpp
+++ b/src/intrinsics.cpp
@@ -780,12 +780,20 @@
              jl_options.fast_math == JL_OPTIONS_FAST_MATH_ON)) {
             FastMathFlags fmf;
             fmf.setUnsafeAlgebra();
+#ifdef LLVM38
+            builder.setFastMathFlags(fmf);
+#else
             builder.SetFastMathFlags(fmf);
+#endif
         }
     }
     IRBuilder<>& operator()() const { return builder; }
     ~math_builder() {
+#ifdef LLVM38
+        builder.setFastMathFlags(old_fmf);
+#else
         builder.SetFastMathFlags(old_fmf);
+#endif
     }
 };