llvm::ConstantFoldUnaryOpOperand

Attempt to constant fold a unary operation with the specified operand. Returns null on failure.

Synopsis

Declared in <llvm/Analysis/ConstantFolding.h>

Constant*
ConstantFoldUnaryOpOperand(
    unsigned int Opcode,
    Constant* Op,
    DataLayout const& DL);

Return Value

The folded constant on success, or null on failure.

Parameters

NameDescription
OpcodeUnary opcode to fold.
OpConstant operand of the unary operation.
DLData layout used for type sizes and pointer widths.