Constant fold a zext, sext or trunc, depending on IsSigned and whether the DestTy is wider or narrower than C. Returns nullptr on failure.
Declared in <llvm/Analysis/ConstantFolding.h>
Constant*
ConstantFoldIntegerCast(
Constant* C,
Type* DestTy,
bool IsSigned,
DataLayout const& DL);
The folded integer cast result, or null on failure.
| Name | Description |
|---|---|
| C | Integer constant to cast. |
| DestTy | Destination integer type. |
| IsSigned | Whether to treat the value as signed (sext vs zext). |
| DL | Data layout used for type sizes and pointer widths. |