aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.cc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-02-06 22:20:09 +0000
committerGitHub <noreply@github.com>2022-02-06 22:20:09 +0000
commit5c36d24c659d18b634629a56d547ae208b914394 (patch)
treeb018d9d93f8bcf074246ebe625d9212a190eeeff /gcc/rust/backend/rust-compile-expr.cc
parent05cfe8f9fdc363ff7db4cba2decaf22e44057c3f (diff)
parentb92a9b80faa4b6daeca3e94db8bcdebdeec0b859 (diff)
downloadgcc-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/backend/rust-compile-expr.cc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index d61a568..d49a6dc 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -274,7 +274,7 @@ CompileExpr::visit (HIR::MatchExpr &expr)
rust_assert (kase_arm.get_patterns ().size () > 0);
// generate implicit label
- Location arm_locus = kase_arm.get_patterns ().at (0)->get_locus ();
+ Location arm_locus = kase_arm.get_locus ();
tree case_label = ctx->get_backend ()->label (
fndecl, "" /* empty creates an artificial label */, arm_locus);