]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: ast: Add outer attribute getter to Expr class
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 30 Mar 2023 18:05:14 +0000 (20:05 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:44 +0000 (18:28 +0100)
commit36bca0cc1bbdb9da64a58cd1a7afaad30634e456
tree29e657800ff613a31a49d0711bd6e0b2d365f408
parent0c985f7d309d321482833d409df8864820c778eb
gccrs: ast: Add outer attribute getter to Expr class

We need to retrieve outer attributes from some Expressions depending on
their context. This means this should be retrieved from their parent
node. But expr did not have a getter for outer attributes since some
expr can't have any outer attribute.

gcc/rust/ChangeLog:

* ast/rust-ast.h: Add getter to Expr class.
* ast/rust-expr.h: Add override attribute to existing getters.
Also implement it for RangeExpr, attempting to retrieve outer
attributes on those types will crash the compiler.
* ast/rust-macro.h: Add override attribute to existing getters.
* ast/rust-path.h: Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast.h
gcc/rust/ast/rust-expr.h
gcc/rust/ast/rust-macro.h
gcc/rust/ast/rust-path.h