Add some utils in BasicBlockUtils.h

This commit is contained in:
Siu Kwan Lam 2013-03-24 14:57:58 -05:00
commit b6c1e7a961

View file

@ -0,0 +1,16 @@
from binding import *
from src.namespace import llvm
from src.Value import MDNode
from src.Instruction import Instruction, TerminatorInst
llvm.includes.add('llvm/Transforms/Utils/BasicBlockUtils.h')
SplitBlockAndInsertIfThen = llvm.Function('SplitBlockAndInsertIfThen',
ptr(TerminatorInst),
ptr(Instruction), # cmp
cast(bool, Bool), # unreachable
ptr(MDNode)) # branchweights
ReplaceInstWithInst = llvm.Function('ReplaceInstWithInst',
Void,
ptr(Instruction), # from
ptr(Instruction)) # to