aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-12-16 14:35:21 +0000
committerGitHub <noreply@github.com>2021-12-16 14:35:21 +0000
commite8d91e9e0825b4d1a4e46531142fdc0c83c761db (patch)
treece096e98f5deb41fc92e53c5926d723d76803311 /gcc
parentde1ed2e805cc7de7ab29b5e183354bae86173669 (diff)
parentcd1814f927017dbe2618078f3574c37586831659 (diff)
downloadgcc-e8d91e9e0825b4d1a4e46531142fdc0c83c761db.zip
gcc-e8d91e9e0825b4d1a4e46531142fdc0c83c761db.tar.gz
gcc-e8d91e9e0825b4d1a4e46531142fdc0c83c761db.tar.bz2
Merge #840
840: Add missing abstract method HIR::Pattern::get_locus() const r=philberty a=philberty We have a missing locus here, there many places within the HIR where we are missing location info such as HIR::MatchCase or HIR::MatchArm come to mind. We also need to raise an issue to track CanonicalPath's and location info within the TyTy module as part of a new Identifier structure which will need to be raised in a separate PR+Issue. Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/hir/tree/rust-hir-pattern.h2
-rw-r--r--gcc/rust/hir/tree/rust-hir.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-pattern.h b/gcc/rust/hir/tree/rust-hir-pattern.h
index fd4960f..3d0dd52 100644
--- a/gcc/rust/hir/tree/rust-hir-pattern.h
+++ b/gcc/rust/hir/tree/rust-hir-pattern.h
@@ -404,6 +404,8 @@ public:
return mappings;
}
+ Location get_locus () const override final { return locus; }
+
protected:
/* Use covariance to implement clone function as returning this object rather
* than base */
diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h
index 8b5f3bb..b7abe67 100644
--- a/gcc/rust/hir/tree/rust-hir.h
+++ b/gcc/rust/hir/tree/rust-hir.h
@@ -330,6 +330,8 @@ public:
virtual Analysis::NodeMapping get_pattern_mappings () const = 0;
+ virtual Location get_locus () const = 0;
+
protected:
// Clone pattern implementation as pure virtual method
virtual Pattern *clone_pattern_impl () const = 0;