Peter Rong 55968109d1 [APInt] provide a safe API for zext value and sext value.
Currently, APInt::getSExtValue and getZExtValue crashes on values with more than 64 bits.
Users may accidently crash the compiler with this setting when the integer may be i128.
As shown in https://github.com/llvm/llvm-project/issues/59316

In this patch we provide a trySExtValue and tryZExtValue to return an Optional, the user
needs to explictly unwrap it and condsier the possibility where there my no value in it.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D139683
2022-12-15 10:06:26 -08:00
..
2022-12-04 21:36:08 +00:00
2022-11-26 13:47:32 -08:00
2022-11-26 13:47:32 -08:00