comparison libinterp/corefcn/jit-util.h @ 20654:b65888ec820e draft default tip gccjit

dmalcom gcc jit import
author Stefan Mahr <dac922@gmx.de>
date Fri, 27 Feb 2015 16:59:36 +0100
parents 4197fc428c7d
children
comparison
equal deleted inserted replaced
20653:9cef0a1207e4 20654:b65888ec820e
25 // Some utility classes and functions used throughout jit 25 // Some utility classes and functions used throughout jit
26 26
27 #if !defined (octave_jit_util_h) 27 #if !defined (octave_jit_util_h)
28 #define octave_jit_util_h 1 28 #define octave_jit_util_h 1
29 29
30 #ifdef HAVE_LLVM 30 #ifdef HAVE_JIT
31 31
32 #include <stdexcept> 32 #include <stdexcept>
33 33
34 #ifdef HAVE_GCCJIT
35 #include "libgccjit++.h"
36 #endif
37
38 #if HAVE_LLVM
34 #if defined(HAVE_LLVM_IR_DATALAYOUT_H) || defined(HAVE_LLVM_DATALAYOUT_H) 39 #if defined(HAVE_LLVM_IR_DATALAYOUT_H) || defined(HAVE_LLVM_DATALAYOUT_H)
35 #define HAVE_LLVM_DATALAYOUT 40 #define HAVE_LLVM_DATALAYOUT
36 #endif 41 #endif
37 42
38 // we don't want to include llvm headers here, as they require 43 // we don't want to include llvm headers here, as they require
71 class IRBuilder; 76 class IRBuilder;
72 77
73 typedef IRBuilder<true, ConstantFolder, IRBuilderDefaultInserter<true> > 78 typedef IRBuilder<true, ConstantFolder, IRBuilderDefaultInserter<true> >
74 IRBuilderD; 79 IRBuilderD;
75 } 80 }
81 #endif /* if HAVE_LLVM */
76 82
77 class octave_base_value; 83 class octave_base_value;
78 class octave_builtin; 84 class octave_builtin;
79 class octave_value; 85 class octave_value;
80 class tree; 86 class tree;
93 private: 99 private:
94 bool mknown; 100 bool mknown;
95 }; 101 };
96 102
97 // llvm doesn't provide this, and it's really useful for debugging 103 // llvm doesn't provide this, and it's really useful for debugging
104 #if HAVE_LLVM
98 std::ostream& operator<< (std::ostream& os, const llvm::Value& v); 105 std::ostream& operator<< (std::ostream& os, const llvm::Value& v);
106 #endif
99 107
100 template <typename HOLDER_T, typename SUB_T> 108 template <typename HOLDER_T, typename SUB_T>
101 class jit_internal_node; 109 class jit_internal_node;
102 110
103 // jit_internal_list and jit_internal_node implement generic embedded doubly 111 // jit_internal_list and jit_internal_node implement generic embedded doubly
210 std::vector<type> the_args (N); \ 218 std::vector<type> the_args (N); \
211 OCT_ITERATE_MACRO (JIT_ASSIGN_ARG, N); \ 219 OCT_ITERATE_MACRO (JIT_ASSIGN_ARG, N); \
212 return fname (JIT_PARAMS the_args); \ 220 return fname (JIT_PARAMS the_args); \
213 } 221 }
214 222
215 #endif 223 #endif /* ifdef HAVE_JIT */
216 #endif 224 #endif