Skip to content

Commit

Permalink
Added/Changed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tfzee committed Dec 23, 2023
1 parent bf35c78 commit ce2ebdb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/values/instruction_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,13 @@ impl<'ctx> InstructionValue<'ctx> {
unsafe { BasicBlock::new(LLVMGetInstructionParent(self.as_value_ref())) }
}

/// Returns if the instruction is a terminator
pub fn is_terminator(self) -> bool {
unsafe { !LLVMIsATerminatorInst(self.as_value_ref()).is_null() }
}

// SubTypes: Only apply to terminators
/// Returns whether a terminator is conditional or not
/// Returns if a terminator is conditional or not
pub fn is_conditional(self) -> bool {
if self.is_terminator() {
unsafe { LLVMIsConditional(self.as_value_ref()) == 1 }
Expand Down

0 comments on commit ce2ebdb

Please sign in to comment.