aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-11-27 19:57:45 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-11-27 19:57:45 +0000
commit593570593e0401d2c8cb34ced3efd0cd50e2638e (patch)
tree109a9c14cba0febe54dba78fdd2da46e4427cea9 /gcc/go/gofrontend/expressions.h
parent98f33efc5a533f66abfb0e263be60e719baf5879 (diff)
downloadgcc-593570593e0401d2c8cb34ced3efd0cd50e2638e.zip
gcc-593570593e0401d2c8cb34ced3efd0cd50e2638e.tar.gz
gcc-593570593e0401d2c8cb34ced3efd0cd50e2638e.tar.bz2
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
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r--gcc/go/gofrontend/expressions.h14
1 files changed, 8 insertions, 6 deletions
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.