28 #if ! defined (octave_jit_util_h)
29 #define octave_jit_util_h 1
31 #include "octave-config.h"
33 #if defined (HAVE_LLVM)
37 #if defined (HAVE_LLVM_IR_DATALAYOUT_H) || defined (HAVE_LLVM_DATALAYOUT_H)
38 # define HAVE_LLVM_DATALAYOUT
48 class ExecutionEngine;
64 #if defined LLVM_IRBUILDER_HAS_TWO_TEMPLATE_ARGS
68 template <
typename T,
typename Inserter>
76 template <
bool preserveNames>
79 template <
bool preserveNames,
typename T,
typename Inserter>
93 class tree_expression;
103 : std::runtime_error (
"unknown"),
m_known (false)
107 : std::runtime_error (reason),
m_known (true)
118 std::ostream&
operator<< (std::ostream& os,
const llvm::Value& v);
120 template <
typename HOLDER_T,
typename SUB_T>
127 template <
typename LIST_T,
typename NODE_T>
136 : m_use_head (0), m_use_tail (0), m_use_count (0)
142 m_use_head->stash_value (0);
157 template <
typename LIST_T,
typename NODE_T>
166 : m_value (nullptr), m_next (nullptr), m_prev (nullptr)
171 LIST_T *
value (
void)
const {
return m_value; }
182 NODE_T *sthis =
static_cast<NODE_T *
> (
this);
196 NODE_T *
next (
void)
const {
return m_next; }
198 NODE_T *
prev (
void)
const {
return m_prev; }
208 m_prev->m_next = m_next;
214 m_next->m_prev = m_prev;
232 template <
typename T,
typename U>
235 return dynamic_cast<T *
> (value);
jit_fail_exception(const std::string &reason)
virtual ~jit_internal_list(void)
NODE_T * first_use(void) const
size_t use_count(void) const
LIST_T * value(void) const
NODE_T * next(void) const
void stash_value(LIST_T *avalue)
jit_internal_list< LIST_T, NODE_T > jit_ilist
NODE_T * prev(void) const
IRBuilder< true, ConstantFolder, IRBuilderDefaultInserter< true > > IRBuilderD
std::ostream & operator<<(std::ostream &os, const jit_block_list &blocks)