compiler: revise exportdata fix for processing constant types

This patch is an addendum to the fix for issue 34577, which was not
sufficiently general. During export data processing, when looking at
the types of constants mentioned in inlinable function bodies, include
both locally defined constants and constant imported from other
packages.

Testcase for this bug is in CL 201017.

Fixes golang/go#34852.

Change-Id: I92d0413b26b168ac7300d577918094fcc40d71e8
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/201018
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/go/export.cc b/go/export.cc
index 5aaa207..b27d2fa 100644
--- a/go/export.cc
+++ b/go/export.cc
@@ -250,7 +250,7 @@
     }
 
   const Named_object* nco = expr->named_constant();
-  if (nco != 0 && nco->package() == NULL)
+  if (nco != 0)
     {
       const Named_constant *nc = nco->const_value();
       Type::traverse(nc->type(), this);