llvm::ConstantExpr::getTrunc

Return a truncating cast of C to type Ty.

Synopsis

Declared in <llvm/IR/Constants.h>

static
Constant*
getTrunc(
    Constant* C,
    Type* Ty,
    bool OnlyIfReduced = false);

Return Value

A truncating cast of C to type Ty.

Parameters

NameDescription
CThe constant to truncate.
TyThe destination type.
OnlyIfReducedIf true, return null unless the expression reduces.