llvm::CastInst::isBitOrNoopPointerCastable

Check whether a no-op bitcast or pointer cast is valid.

Synopsis

Declared in <llvm/IR/InstrTypes.h>

static
bool
isBitOrNoopPointerCastable(
    Type* SrcTy,
    Type* DestTy,
    DataLayout const& DL);

Description

This ensures that any pointer<->integer cast has enough bits in the integer and any other cast is a bitcast.

Return Value

True if the cast is valid and changes no bits.

Parameters

NameDescription
SrcTyThe source type.
DestTyThe destination type.
DLThe data layout used to size pointer types.