diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-10-04 18:14:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-10-04 18:14:30 +0000 |
commit | 69b35f396ceb22e2e04b4228a6811291621808c1 (patch) | |
tree | e5b8c8a1488b30e41d0039391145aeb734ef6f6f /gcc/go/gofrontend/expressions.h | |
parent | 432bbcbb1e9d4a2b2bd946a0120c2be52c4ec01d (diff) | |
download | gcc-69b35f396ceb22e2e04b4228a6811291621808c1.zip gcc-69b35f396ceb22e2e04b4228a6811291621808c1.tar.gz gcc-69b35f396ceb22e2e04b4228a6811291621808c1.tar.bz2 |
compiler: include selected constant types during export processing
The machinery that collects types referenced by expressions that are
part of inlinable function bodies was missing the types of local named
constants in certain cases. This patch updates the
Collect_export_references::expression() hook to look for references to
local named constants and include their types in the exported set.
Fixes golang/go#34577.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198017
From-SVN: r276594
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r-- | gcc/go/gofrontend/expressions.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 2e3d1e0..a0370e1 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -587,6 +587,11 @@ class Expression boolean_constant_value(bool* val) const { return this->do_boolean_constant_value(val); } + // If this is a const reference expression, return the named + // object to which the expression refers, otherwise return NULL. + const Named_object* + named_constant() const; + // This is called if the value of this expression is being // discarded. This issues warnings about computed values being // unused. This returns true if all is well, false if it issued an |