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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
diff -r 3797df921988 configure.ac
--- a/configure.ac Wed Apr 29 17:09:24 2015 -0700
+++ b/configure.ac Sun May 03 22:48:56 2015 +0200
@@ -815,8 +815,13 @@
AC_MSG_NOTICE([using -isystem for LLVM headers])])
dnl Use -isystem so we don't get warnings from llvm headers
- LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
- LLVM_CXXFLAGS=
+ AX_CHECK_COMPILE_FLAG([-std=c++11],[
+ LLVM_CPPFLAGS="-std=c++11 $LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
+ LLVM_CXXFLAGS="-std=c++11"
+ ],[
+ LLVM_CPPFLAGS="$LLVM_INCLUDE_FLAG `$LLVM_CONFIG --includedir`"
+ LLVM_CXXFLAGS=
+ ])
LLVM_LDFLAGS="-L`$LLVM_CONFIG --libdir`"
@@ -860,6 +865,8 @@
OCTAVE_LLVM_CALLINST_ADDATTRIBUTE_API
OCTAVE_LLVM_RAW_FD_OSTREAM_API
OCTAVE_LLVM_LEGACY_PASSMANAGER_API
+ OCTAVE_LLVM_DATALAYOUTPASS_API
+
AC_LANG_POP(C++)
CPPFLAGS="$save_CPPFLAGS"
CXXFLAGS="$save_CXXFLAGS"
diff -r 3797df921988 libinterp/corefcn/jit-typeinfo.cc
--- a/libinterp/corefcn/jit-typeinfo.cc Wed Apr 29 17:09:24 2015 -0700
+++ b/libinterp/corefcn/jit-typeinfo.cc Sun May 03 22:48:56 2015 +0200
@@ -1208,7 +1208,7 @@
for (int op = 0; op < octave_value::num_binary_ops; ++op)
{
llvm::Twine fn_name ("octave_jit_binary_any_any_");
- fn_name = fn_name + llvm::Twine (op);
+ fn_name.concat( llvm::Twine (op) );
fn = create_internal (fn_name, any, any, any);
fn.mark_can_error ();
diff -r 3797df921988 libinterp/corefcn/pt-jit.cc
--- a/libinterp/corefcn/pt-jit.cc Wed Apr 29 17:09:24 2015 -0700
+++ b/libinterp/corefcn/pt-jit.cc Sun May 03 22:48:56 2015 +0200
@@ -59,6 +59,7 @@
#include <llvm/Bitcode/ReaderWriter.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
+#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/ExecutionEngine/JIT.h>
#ifdef LEGACY_PASSMANAGER
@@ -83,6 +84,7 @@
#include <llvm/IRBuilder.h>
#endif
+#include <llvm/Support/FileSystem.h>
#include <llvm/Support/raw_os_ostream.h>
#include <llvm/Support/TargetSelect.h>
@@ -2077,7 +2079,11 @@
module_pass_manager->add (llvm::createAlwaysInlinerPass ());
#ifdef HAVE_LLVM_DATALAYOUT
+#ifdef HAVE_LLVM_DATALAYOUTPASS
+ pass_manager->add (new llvm::DataLayoutPass (*engine->getDataLayout ()));
+#else
pass_manager->add (new llvm::DataLayout (*engine->getDataLayout ()));
+#endif
#else
pass_manager->add (new llvm::TargetData (*engine->getTargetData ()));
#endif
@@ -2192,7 +2198,7 @@
std::string error;
#ifdef RAW_FD_OSTREAM_ARG_IS_LLVM_SYS_FS
llvm::raw_fd_ostream fout ("test.bc", error,
- llvm::sys::fs::F_Binary);
+ llvm::sys::fs::F_Text);
#else
llvm::raw_fd_ostream fout ("test.bc", error,
llvm::raw_fd_ostream::F_Binary);
diff -r 3797df921988 m4/acinclude.m4
--- a/m4/acinclude.m4 Wed Apr 29 17:09:24 2015 -0700
+++ b/m4/acinclude.m4 Sun May 03 22:48:56 2015 +0200
@@ -1784,10 +1784,11 @@
[AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
+ #include <llvm/Support/FileSystem.h>
#include <llvm/Support/raw_os_ostream.h>
]], [[
std::string str;
- llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Binary);
+ llvm::raw_fd_ostream fout ("", str, llvm::sys::fs::F_Text);
]])],
octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=yes,
octave_cv_raw_fd_ostream_arg_is_llvm_sys_fs=no)
@@ -1828,6 +1829,33 @@
fi
])
dnl
+dnl Check for llvm::DataLayoutPass API
+dnl
+AC_DEFUN([OCTAVE_LLVM_DATALAYOUTPASS_API], [
+ AC_CACHE_CHECK([check for LLVM::DataLayoutPass],
+ [octave_cv_datalayoutpass],
+ [AC_LANG_PUSH(C++)
+ save_LIBS="$LIBS"
+ LIBS="$LLVM_LIBS $LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <llvm/IR/DataLayout.h>
+ ]], [[
+ llvm::Module *module;
+ llvm::DataLayoutPass *datalayoutpass;
+ datalayoutpass = new llvm::DataLayoutPass (module)
+ ]])],
+ octave_cv_datalayoutpass=yes,
+ octave_cv_datalayoutpass=no)
+ LIBS="$save_LIBS"
+ AC_LANG_POP(C++)
+ ])
+ if test $octave_cv_datalayoutpass = yes; then
+ AC_DEFINE(HAVE_LLVM_DATALAYOUTPASS, 1,
+ [Define to 1 if LLVM::DataLayoutPass exists.])
+ fi
+])
+dnl
dnl Check for ar.
dnl
AC_DEFUN([OCTAVE_PROG_AR], [
|