コード例 #1
0
ファイル: operations.cpp プロジェクト: andyjost/Sprite-3
 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);
 }
コード例 #2
0
ファイル: operations.cpp プロジェクト: andyjost/Sprite-3
 /// 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);
 }