LLVM 23.0.0git

Functions in this group only apply to instructions for which LLVMIsATerminatorInst returns true. More...

Collaboration diagram for Terminators:

Functions

LLVM_C_ABI unsigned LLVMGetNumSuccessors (LLVMValueRef Term)
 Return the number of successors that this terminator has.
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSuccessor (LLVMValueRef Term, unsigned i)
 Return the specified successor.
LLVM_C_ABI void LLVMSetSuccessor (LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block)
 Update the specified successor to point at the provided block.
LLVM_C_ABI LLVMBool LLVMIsConditional (LLVMValueRef Branch)
 Return if an instruction is a conditional branch.
LLVM_C_ABI LLVMValueRef LLVMGetCondition (LLVMValueRef Branch)
 Return the condition of a branch instruction.
LLVM_C_ABI void LLVMSetCondition (LLVMValueRef Branch, LLVMValueRef Cond)
 Set the condition of a branch instruction.
LLVM_C_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest (LLVMValueRef SwitchInstr)
 Obtain the default destination basic block of a switch instruction.
LLVM_C_ABI LLVMValueRef LLVMGetSwitchCaseValue (LLVMValueRef SwitchInstr, unsigned i)
 Obtain the case value for a successor of a switch instruction.
LLVM_C_ABI void LLVMSetSwitchCaseValue (LLVMValueRef SwitchInstr, unsigned i, LLVMValueRef CaseValue)
 Set the case value for a successor of a switch instruction.

Detailed Description

Functions in this group only apply to instructions for which LLVMIsATerminatorInst returns true.

Function Documentation

◆ LLVMGetCondition()

LLVM_C_ABI LLVMValueRef LLVMGetCondition ( LLVMValueRef Branch)

Return the condition of a branch instruction.

This only works on llvm::CondBrInst instructions.

See also
llvm::CondBrInst::getCondition

Definition at line 3308 of file Core.cpp.

References getCondition(), llvm::unwrap(), and llvm::wrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMGetNumSuccessors()

LLVM_C_ABI unsigned LLVMGetNumSuccessors ( LLVMValueRef Term)

Return the number of successors that this terminator has.

See also
llvm::Instruction::getNumSuccessors

Definition at line 3290 of file Core.cpp.

References llvm::unwrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMGetSuccessor()

LLVM_C_ABI LLVMBasicBlockRef LLVMGetSuccessor ( LLVMValueRef Term,
unsigned i )

Return the specified successor.

See also
llvm::Instruction::getSuccessor

Definition at line 3294 of file Core.cpp.

References llvm::unwrap(), and llvm::wrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMGetSwitchCaseValue()

LLVM_C_ABI LLVMValueRef LLVMGetSwitchCaseValue ( LLVMValueRef SwitchInstr,
unsigned i )

Obtain the case value for a successor of a switch instruction.

i corresponds to the successor index. The first successor is the default destination, so i must be greater than zero.

This only works on llvm::SwitchInst instructions.

See also
llvm::SwitchInst::CaseHandle::getCaseValue()

Definition at line 3322 of file Core.cpp.

References assert(), llvm::unwrap(), and llvm::wrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMGetSwitchDefaultDest()

LLVM_C_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest ( LLVMValueRef SwitchInstr)

Obtain the default destination basic block of a switch instruction.

This only works on llvm::SwitchInst instructions.

See also
llvm::SwitchInst::getDefaultDest()

Definition at line 3318 of file Core.cpp.

References llvm::unwrap(), and llvm::wrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMIsConditional()

LLVM_C_ABI LLVMBool LLVMIsConditional ( LLVMValueRef Branch)

Return if an instruction is a conditional branch.

Deprecated: Use LLVMIsACondBrInst instead.

Definition at line 3304 of file Core.cpp.

References llvm::isa(), and llvm::unwrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMSetCondition()

LLVM_C_ABI void LLVMSetCondition ( LLVMValueRef Branch,
LLVMValueRef Cond )

Set the condition of a branch instruction.

This only works on llvm::CondBrInst instructions.

See also
llvm::CondBrInst::setCondition

Definition at line 3312 of file Core.cpp.

References Cond, and llvm::unwrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMSetSuccessor()

LLVM_C_ABI void LLVMSetSuccessor ( LLVMValueRef Term,
unsigned i,
LLVMBasicBlockRef block )

Update the specified successor to point at the provided block.

See also
llvm::Instruction::setSuccessor

Definition at line 3298 of file Core.cpp.

References block, and llvm::unwrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().

◆ LLVMSetSwitchCaseValue()

LLVM_C_ABI void LLVMSetSwitchCaseValue ( LLVMValueRef SwitchInstr,
unsigned i,
LLVMValueRef CaseValue )

Set the case value for a successor of a switch instruction.

i corresponds to the successor index. The first successor is the default destination, so i must be greater than zero.

This only works on llvm::SwitchInst instructions.

See also
llvm::SwitchInst::CaseHandle::setValue()

Definition at line 3328 of file Core.cpp.

References assert(), and llvm::unwrap().

Referenced by LLVM_ATTRIBUTE_C_DEPRECATED().