We convert APSInts to Z3 Bitvectors in an inefficient way for most cases.
We should not serialize to std::string just to pass an int64 integer.
For the vast majority of cases, we use at most 64-bit width integers (at least
in the Clang Static Analyzer). We should simply call the Z3_mk_unsigned_int64
and Z3_mk_int64 instead of the Z3_mk_numeral as stated in the Z3 docs.
Which says:
It (Z3_mk_unsigned_int64, etc.) is slightly faster than Z3_mk_numeral since
it is not necessary to parse a string.
If the APSInt is wider than 64 bits, we will use the Z3_mk_numeral with a
SmallString instead of a heap-allocated std::string.
I am not sure if the unlikely is justified. The likelihood might depend on the analyzed code and it is possible to write code where this is the frequent case.