compiler: record final type for numeric expressions

Inlinable function bodies are generated after the determine_types pass,
so we know the type for all constants.  Rather than try to determine
it again when inlining, record the type in the export data, using a
$convert expression.  Reduce the number of explicit $convert
expressions by recording a type context with the expected type in
cases where that type is known.

Change-Id: I407b4f7b932480c73e1ef8d20646a6bfe19b2ae3
Reviewed-by: Than McIntosh <>
Reviewed-by: Cherry Zhang <>
4 files changed