From 69b35f396ceb22e2e04b4228a6811291621808c1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 4 Oct 2019 18:14:30 +0000 Subject: 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 --- gcc/go/gofrontend/expressions.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/go/gofrontend/expressions.h') 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 -- cgit v1.1