compiler: support go:noescape cross package

Programming / Compilers / GCC - ian [138bc75d-0d04-0410-961f-82ee72b054a4] - 9 January 2018 23:26 EST

CL 83876 added support of go:noescape pragma, but it only works for functions called from the same package. The pragma did not take effect for exported functions that are not called from the same package. The reason is that top level function declarations are not traversed, and only reached from calls from other functions. This CL adds this support. The Traverse class is extended with a mode to traverse function declarations.

Reviewed-on: https://go-review.googlesource.com/85637

58abbf7964f compiler: support go:noescape cross package
gcc/go/gofrontend/MERGE | 2 +-
gcc/go/gofrontend/escape.cc | 12 +++++++++++-
gcc/go/gofrontend/gogo.cc | 21 +++++++++++++++++++++
gcc/go/gofrontend/gogo.h | 20 +++++++++++++-------
4 files changed, 46 insertions(+), 9 deletions(-)

Upstream: gcc.gnu.org


  • Share