Create a bitcast, pointer-to-integer, or integer-to-pointer cast.
Declared in <llvm/IR/InstrTypes.h>
static
CastInst*
CreateBitOrPointerCast(
Value* S,
Type* Ty,
Twine const& Name = "",
InsertPosition InsertBefore = nullptr);
If the value is a pointer type and the destination an integer type, creates a PtrToInt cast. If the value is an integer type and the destination a pointer type, creates an IntToPtr cast. Otherwise, creates a bitcast.
The newly created cast instruction.
| Name | Description |
|---|---|
| S | The value to cast (operand 0). |
| Ty | The destination type of the cast. |
| Name | Optional name for the instruction. |
| InsertBefore | Optional insertion position. |