Construct any CastInst subclass from an opcode.
Declared in <llvm/IR/InstrTypes.h>
static
CastInst*
Create(
Instruction::CastOps Op,
Value* S,
Type* Ty,
Twine const& Name = "",
InsertPosition InsertBefore = nullptr);
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's constructor. The opcode must be in the CastOps category (Instruction::isCast(opcode) returns true). This constructor has insert-before-instruction semantics to automatically insert the new CastInst before InsertBefore (if it is non-null).
The newly created cast instruction.
| Name | Description |
|---|---|
| Op | The cast opcode. |
| S | The value to cast (operand 0). |
| Ty | The destination type of the cast. |
| Name | Optional name for the instruction. |
| InsertBefore | Optional insertion position. |