diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-06-14 17:59:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-06-14 17:59:48 +0000 |
commit | 51b08adabf40a7922771ff4e0c36c8680c082825 (patch) | |
tree | 0578244ff530b3ebc00aed42fca943c03feb3d58 /gcc/go/gofrontend/expressions.h | |
parent | 24244e4debd3261c8237d15d940fd10df5b0005a (diff) | |
download | gcc-51b08adabf40a7922771ff4e0c36c8680c082825.zip gcc-51b08adabf40a7922771ff4e0c36c8680c082825.tar.gz gcc-51b08adabf40a7922771ff4e0c36c8680c082825.tar.bz2 |
compiler: fix computation of Offsetof.
The implied offsets must be taken into account
when the selector involves anonymous fields.
From-SVN: r200098
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r-- | gcc/go/gofrontend/expressions.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index af178de..36f4c0d 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1860,6 +1860,15 @@ class Field_reference_expression : public Expression field_index() const { return this->field_index_; } + // Return whether this node was implied by an anonymous field. + bool + implicit() const + { return this->implicit_; } + + void + set_implicit(bool implicit) + { this->implicit_ = implicit; } + // Set the struct expression. This is used when parsing. void set_struct_expression(Expression* expr) @@ -1914,6 +1923,9 @@ class Field_reference_expression : public Expression Expression* expr_; // The zero-based index of the field we are retrieving. unsigned int field_index_; + // Whether this node was emitted implicitly for an embedded field, + // that is, expr_ is not the expr_ of the original user node. + bool implicit_; // Whether we have already emitted a fieldtrack call. bool called_fieldtrack_; }; |