compiler: permit inlining references to global variables
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 3 Jun 2019 23:04:23 +0000 (23:04 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 3 Jun 2019 23:04:23 +0000 (23:04 +0000)
commit3e6f8fe1bc4c60859113bca7970b0b8db56eb442
tree1686da7767547bc1f870d738b861f924b8e50645
parenta920eb0cb08da30f4d7d4345f42067fdf8ce7b9b
compiler: permit inlining references to global variables

    This requires tracking all references to unexported variables, so that
    we can make them global symbols in the object file, and can export
    them so that other compilations can see the right definition for their
    own inline bodies.

    This introduces a syntax for referencing names defined in other
    packages: a <pNN> prefix, where NN is the package index.  This will
    need to be added to gccgoimporter, but I didn't do it yet since it
    isn't yet possible to create an object for which gccgoimporter will
    see a <pNN> prefix.

    This increases the number of inlinable functions in the standard
    library from 181 to 215, adding functions like context.Background.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/177920

From-SVN: r271891
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/export.cc
gcc/go/gofrontend/export.h
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/import.cc
gcc/go/gofrontend/import.h