diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-06 22:20:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 22:20:09 +0000 |
commit | 5c36d24c659d18b634629a56d547ae208b914394 (patch) | |
tree | b018d9d93f8bcf074246ebe625d9212a190eeeff /gcc/rust/parse/rust-parse-impl.h | |
parent | 05cfe8f9fdc363ff7db4cba2decaf22e44057c3f (diff) | |
parent | b92a9b80faa4b6daeca3e94db8bcdebdeec0b859 (diff) | |
download | gcc-5c36d24c659d18b634629a56d547ae208b914394.zip gcc-5c36d24c659d18b634629a56d547ae208b914394.tar.gz gcc-5c36d24c659d18b634629a56d547ae208b914394.tar.bz2 |
Merge #888
888: Added location data to Match Arm and removed unused code r=philberty a=mvvsmk
Fixes #863
- Added location data to Match arm in gcc/rust/ast/rust-expr.h and gcc/rust/hir/tree/rust-hir-expr.h
- Updated the respective constructors and copy constructors
- Updated location info for match arm in code generation in gcc/rust/backend/eust-compile-expr.cc
- Removed unused code in the above rust-expr.h and rust-gir-expr.h files as mentioned in the issue by `@philberty.`
- Comment removed form rust-expr.h
- Changed partameterized constructor and static function in
rust-hir-expr.h
- Changed line 697 to pass expr.get_locus() in rust-ast-lower
- Changed parameterised constructor in rust-expr.h
- Changed line 8563 in rust-parse-impl.h to pass location data.
Note :
- I also added a public member funtion for the class MatchArm
`Location get_locus ( ) const { return locus; }`
Do me know if I missed anything or could improve on something.
Signed-off-by : M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
Co-authored-by: @mvvsmk <mvvsmanojkumar@gmail.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 0e39e48..6d393b0 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -8560,8 +8560,9 @@ Parser<ManagedTokenSource>::parse_match_arm () // DEBUG rust_debug ("successfully parsed match arm"); - return AST::MatchArm (std::move (match_arm_patterns), std::move (guard_expr), - std::move (outer_attrs)); + return AST::MatchArm (std::move (match_arm_patterns), + lexer.peek_token ()->get_locus (), + std::move (guard_expr), std::move (outer_attrs)); } /* Parses the patterns used in a match arm. End token id is the id of the token |