llvm::ConstantFoldCastInstruction

Attempt to constant fold a cast instruction with the specified operand.

Synopsis

Declared in <llvm/IR/ConstantFold.h>

Constant*
ConstantFoldCastInstruction(
    unsigned int opcode,
    Constant* V,
    Type* DestTy);

Description

The constant result is returned if successful; if not, null is returned.

Return Value

The folded constant, or null if the cast cannot be folded.

Parameters

NameDescription
opcodeThe opcode of the cast.
VThe source constant.
DestTyThe destination type.