Return true if a cast changes no bits.
Declared in <llvm/IR/InstrTypes.h>
static
bool
isNoopCast(
Instruction::CastOps Opcode,
Type* SrcTy,
Type* DstTy,
DataLayout const& DL);
A no-op cast is one that can be effected without changing any bits. It implies that the source and destination types are the same size. The DataLayout argument is to determine the pointer size when examining casts involving Integer and Pointer types. They are no-op casts if the integer is the same size as the pointer. However, pointer size varies with platform. Note that a precondition of this method is that the cast is legal - i.e. the instruction formed with these operands would verify.
True if the cast changes no bits.
| Name | Description |
|---|---|
| Opcode | The cast opcode. |
| SrcTy | The source type. |
| DstTy | The destination type. |
| DL | The data layout used to size pointer types. |