26 #define __STDC_LIMIT_MACROS
27 #define __STDC_CONSTANT_MACROS
37 #ifdef HAVE_LLVM_IR_FUNCTION_H
38 #include <llvm/IR/BasicBlock.h>
39 #include <llvm/IR/Instructions.h>
41 #include <llvm/BasicBlock.h>
42 #include <llvm/Instructions.h>
50 for (value_list::iterator iter =
all_values.begin ();
80 iter =
mlist.insert (iter, ablock);
103 os <<
"-------------------- " << header <<
" --------------------\n";
110 os <<
"-------------------- dom info --------------------\n";
114 (*iter)->print_dom (os);
133 iter != blocks.
end (); ++iter)
136 (*iter)->print (os, 0);
138 return os << std::endl;
158 if (! isa<jit_error_check> (use->
user ()))
178 #define JIT_METH(clname) \
180 jit_ ## clname::accept (jit_ir_walker& walker) \
182 walker.visit (*this); \
198 return avalue->
print (os);
222 return os <<
"#" <<
mid;
228 for (
size_t i = start; i < end; ++i)
241 assert (isa<jit_block> (value));
260 node = node->
next ();
289 bool was_empty =
end () ==
begin ();
296 merge_begin =
begin ();
302 for (
iterator iter = merge_begin; iter !=
end (); ++iter)
326 if (! isa<jit_phi> (temp))
394 return llvm::cast<llvm::BasicBlock> (
llvm_value);
402 os <<
" mid: " <<
mid << std::endl;
403 os <<
" predecessors: ";
405 os << *use->user_parent () <<
" ";
408 os <<
" successors: ";
425 for (
size_t i = 0; i <
dom_succ.size (); ++i)
428 return os << std::endl;
442 while (runner !=
idom)
444 runner->
mdf.insert (
this);
445 runner = runner->
idom;
460 bool changed =
false;
464 changed = pred->
update_idom (avisit_count) || changed;
471 for (; use; use = use->
next ())
479 if (
idom != new_idom)
497 pred->
label (avisit_count, number);
530 instr->
print (os, indent + 1) << std::endl;
580 while (i && j && i != j)
582 while (i && i->
id () > j->
id ())
585 while (i && j && j->
id () > i->
id ())
624 if (new_idx != argument_count ())
630 assert (argument_count () > 0);
655 if (infered !=
type ())
675 for (
size_t i = 0; i < scount; ++i)
688 bool changed =
false;
689 for (
size_t i = 0; i <
malive.size (); ++i)
700 llvm::TerminatorInst *
738 std::stringstream ss;
739 ss <<
"Missing overload in type inference for ";
744 if (infered !=
type ())
760 return "error_state";
782 size_t aindex,
size_t acount)
793 std::vector<context>::const_iterator iter;
802 for (idx = 0; idx <
contexts.size (); ++idx)
821 if (new_type !=
type ())
835 return os << *ctx.
index <<
", " << *ctx.
count <<
")";