27 #if !defined (octave_jit_util_h)
28 #define octave_jit_util_h 1
34 #if defined(HAVE_LLVM_IR_DATALAYOUT_H) || defined(HAVE_LLVM_DATALAYOUT_H)
35 #define HAVE_LLVM_DATALAYOUT
45 class FunctionPassManager;
47 class ExecutionEngine;
60 template <
bool preserveNames>
61 class IRBuilderDefaultInserter;
63 template <
bool preserveNames,
typename T,
typename Inserter>
66 typedef IRBuilder<true, ConstantFolder, IRBuilderDefaultInserter<true> >
91 std::ostream&
operator<< (std::ostream& os,
const llvm::Value& v);
93 template <
typename HOLDER_T,
typename SUB_T>
99 template <
typename LIST_T,
typename NODE_T>
110 use_head->stash_value (0);
123 template <
typename LIST_T,
typename NODE_T>
144 jit_ilist *ilist =
mvalue;
145 NODE_T *sthis =
static_cast<NODE_T *
> (
this);
167 jit_ilist *ilist =
mvalue;
193 template <
typename T,
typename U>
196 return dynamic_cast<T *
> (
value);
199 #define JIT_ASSIGN_ARG(i) the_args[i] = arg ## i;
200 #define JIT_EXPAND(ret, fname, type, isconst, N) \
201 ret fname (JIT_PARAM_ARGS OCT_MAKE_DECL_LIST (type, arg, N)) isconst \
203 std::vector<type> the_args (N); \
204 OCT_ITERATE_MACRO (JIT_ASSIGN_ARG, N); \
205 return fname (JIT_PARAMS the_args); \