Builder.branch will check if the basicblock has terminator when running in debug mode.

This commit is contained in:
Siu Kwan Lam 2013-01-10 16:43:14 -06:00
commit f731332360

View file

@ -1865,6 +1865,8 @@ class Builder(object):
def branch(self, bblk):
check_is_basic_block(bblk)
for instr in self.basic_block.instructions:
assert not instr.is_terminator, "BasicBlock can only have one terminator"
return _make_value(_core.LLVMBuildBr(self.ptr, bblk.ptr))
def cbranch(self, if_value, then_blk, else_blk):