compiler: record final type for numeric expressions
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 27 Nov 2018 23:29:15 +0000 (23:29 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 27 Nov 2018 23:29:15 +0000 (23:29 +0000)
commit9b4e458bd7a31b288e5c944cd27419a7f434367e
tree64a5c3a3eacb60fdeed40da0d460c6c6a27647f0
parentda29d2a36ef4bc2d6459267ce21ac932ddfbad6a
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.

    Reviewed-on: https://go-review.googlesource.com/c/150071

From-SVN: r266534
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/export.h
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/types.cc