Hi,
this patch tries to fix a problem with the API for TargetCustom PseudoSourceValue types that is currently exhibiting UB if you try to use it in the intended way with more than 1 PseudoSourceValue custom kind.
How the API is intended to be used (by looking at getTargetCustom() or the printCustom() method) is that passing a value >= PSVKind::TargetCustom as the "Kind" parameter of the PseudoSourceValue constructor is a way to specify that our PSV is of a custom kind. So, if you have 2 different custom PSV types you should pass as the Kind parameter for the first one PSVKind::TargetCustom and for the second on "PSVKind::TargetCustom+1"
getTargetCustom() will return 0 if the PSV is not custom, 1 if it is the first custom PSV, 2 if it is the second
The problem is that PSVKind::TargetCustom+1 is not an entry of the PSVKind enum and passing that as a value to the constructor is theoretically undefined behavior and is reported as such by the UB sanitizer.
This results in the fact that having more than 1 PSV custom kind is actually not possible without triggering UB.
This patch tries to address it to use "unsigned" (the underlying value of the enum) to store and pass around the Kind instead of the PSVKind enum type.
This patch is NFC otherwise