From 593570593e0401d2c8cb34ced3efd0cd50e2638e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 27 Nov 2018 19:57:45 +0000 Subject: compiler: pass a Location to import_expression Separate the Location that import_expression uses when creating a new Expression from the Location used to report an error. This is a step toward importing expressions for inlined functions. This is a pure refactoring that does not affect compiler behavior. Reviewed-on: https://go-review.googlesource.com/c/150064 From-SVN: r266525 --- gcc/go/gofrontend/expressions.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gcc/go/gofrontend/expressions.h') diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 9c3122a..3641b03 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1014,9 +1014,11 @@ class Expression export_expression(Export_function_body* efb) const { this->do_export(efb); } - // Import an expression. + // Import an expression. The location should be used for the + // returned expression. Errors should be reported using the + // Import's location method. static Expression* - import_expression(Import*); + import_expression(Import*, Location); // Return an expression which checks that VAL, of arbitrary integer type, // is non-negative and is not more than the maximum integer value. @@ -1565,7 +1567,7 @@ class String_expression : public Expression { return this->val_; } static Expression* - do_import(Import*); + do_import(Import*, Location); protected: bool @@ -1644,7 +1646,7 @@ class Type_conversion_expression : public Expression // Import a type conversion expression. static Expression* - do_import(Import*); + do_import(Import*, Location); protected: int @@ -1815,7 +1817,7 @@ class Unary_expression : public Expression Location, Numeric_constant* nc, bool *issued_error); static Expression* - do_import(Import*); + do_import(Import*, Location); // Declare that this deref does or does not require an explicit nil check. void @@ -1964,7 +1966,7 @@ class Binary_expression : public Expression bool* result); static Expression* - do_import(Import*); + do_import(Import*, Location); // Report an error if OP can not be applied to TYPE. Return whether // it can. OTYPE is the type of the other operand. -- cgit v1.1