Add some methods to llvm_wrap

This commit is contained in:
greg 2017-01-11 20:25:40 -08:00
parent 77297c7e06
commit d9ab5a58cf

View File

@ -147,6 +147,21 @@ pub fn BuildBr(builder: LLVMBuilderRef,
unsafe { core::LLVMBuildBr(builder, dest) } unsafe { core::LLVMBuildBr(builder, dest) }
} }
pub fn GetInsertBlock(builder: LLVMBuilderRef) -> LLVMBasicBlockRef {
unsafe { core::LLVMGetInsertBlock(builder) }
}
pub fn BuildPhi(builder: LLVMBuilderRef, ty: LLVMTypeRef, name: &str) -> LLVMValueRef {
let name = CString::new(name).unwrap();
unsafe { core::LLVMBuildPhi(builder, ty, name.as_ptr()) }
}
pub fn AddIncoming(phi: LLVMValueRef, incoming_values: *mut LLVMValueRef, incoming_blocks: *mut LLVMBasicBlockRef,
count: u32) {
unsafe { core::LLVMAddIncoming(phi, incoming_values, incoming_blocks, count) }
}
pub fn BuildICmp(builder: LLVMBuilderRef, pub fn BuildICmp(builder: LLVMBuilderRef,
op: LLVMIntPredicate, op: LLVMIntPredicate,
lhs: LLVMValueRef, lhs: LLVMValueRef,