Construct any CastInst subclass from an opcode.

Synopsis

Declared in <llvm/IR/InstrTypes.h>

static
CastInst*
Create(
    Instruction::CastOps Op,
    Value* S,
    Type* Ty,
    Twine const& Name = "",
    InsertPosition InsertBefore = nullptr);

Description

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).

Return Value

The newly created cast instruction.

Parameters

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.

Created with MrDocs