Well, an llvm::APSInt represents an arbitrary-width signed or unsigned integer, and a char32_t (generally) represents a UCS-4 code unit / Unicode code point. How do you want to interpret the APSInt, such that it can be converted to a Unicode code point? If the APSInt represents the Unicode code point value, then Val.getLimitedValue() is probably reasonable, but you’ll also need to check for Val.isNegative() to avoid the possibility of a narrow negative APSInt getting confused for a small positive integer. (Generally you should also beware of getZExtValue() because it has a precondition that the value fits in 64 bits; it’s also questionable to call getZExtValue on an APSInt because it assumes the APSInt represents an unsigned integer.)