Example #1
0
 switch_instruction switch_(value const & cond, label const & default_)
 {
   llvm::IRBuilder<> & bldr = current_builder();
   llvm::SwitchInst * rv = SPRITE_APICALL(
       bldr.CreateSwitch(cond.ptr(), default_.ptr())
     );
   return switch_instruction(rv);
 }
Example #2
0
 /// Appends an indirect branch instruction to the active label scope.
 instruction goto_(value const & target, array_ref<label> const & labels)
 {
   // Note: no update to the current label.
   llvm::IRBuilder<> & bldr = current_builder();
   llvm::IndirectBrInst * rv = SPRITE_APICALL(
       bldr.CreateIndirectBr(target.ptr(), labels.size())
     );
   for(label const & l : labels)
     rv->addDestination(l.ptr());
   return instruction(rv);
 }