Move logic from CastRetrievedVal to evalCast and replace CastRetrievedVal with evalCast. Also move guts from SimpleSValBuilder::dispatchCast inside evalCast.
OriginalTy become a default param, because evalCast intends to substitute dispatchCast, evalCastFromNonLoc and evalCastFromLoc which don't have OriginalTy param. OriginalTy provides additional information for casting, which is useful for some cases and useless for others. If OriginalTy.isNull() is true, then the cast performs based on CastTy only. Now evalCast operates in two ways. It retains all previous behavior and take over dispatchCast behavior.
From this patch use evalCast instead of dispatchCast, evalCastFromNonLoc and evalCastFromLoc functions. dispatchCast redirects to evalCast.
This patch ideally shall not change any behavior. (Should we mark it as [NFC]?)
This is an intermediate revision for D89055.
I'm not sure if this FIXME is still applicable.
I'm also confused about having two functions doing effectively the same thing.
SimpleSValBuilder::dispatchCast is a virtual function, which just invokes a non-virtual function SValBuilder::evalCast.
Why should it be virtual in the first place?