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.

Change-Id: If21e548e635be1c5b0df64fa072bc7b209f08f73
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/177920
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
8 files changed