diff options
author | Nirmal Patel <npate012@gmail.com> | 2021-10-29 14:27:50 -0400 |
---|---|---|
committer | Nirmal Patel <npate012@gmail.com> | 2021-10-29 14:27:50 -0400 |
commit | a66dd96413432095ef13e6429f7acb3cb06f4f0f (patch) | |
tree | e20c3965e480c2ce76ee5276a2b8a3b96fd3ba9a /gcc/rust/ast | |
parent | cba61d8dcbe1ac0fb23a96b2974541b201292465 (diff) | |
download | gcc-a66dd96413432095ef13e6429f7acb3cb06f4f0f.zip gcc-a66dd96413432095ef13e6429f7acb3cb06f4f0f.tar.gz gcc-a66dd96413432095ef13e6429f7acb3cb06f4f0f.tar.bz2 |
Add location info in AST::TypeBoundWhereClauseItem and HIR::TypeBoundWhereClauseItem
Location info has been added to AST::TypeBoundWhereClauseItem and
HIR::TypeBoundWhereClauseItem. parse_type_bound_where_clause_item () has been
modified to fetch location info and store it in AST::TypeBoundWhereClauseItem
Fixes #766
Signed-off-by: Nirmal Patel <npate012@gmail.com>
Diffstat (limited to 'gcc/rust/ast')
-rw-r--r-- | gcc/rust/ast/rust-item.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 323548a..39411f8 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -228,6 +228,7 @@ class TypeBoundWhereClauseItem : public WhereClauseItem std::unique_ptr<Type> bound_type; std::vector<std::unique_ptr<TypeParamBound>> type_param_bounds; NodeId node_id; + Location locus; public: // Returns whether the item has ForLifetimes @@ -238,11 +239,12 @@ public: TypeBoundWhereClauseItem ( std::vector<LifetimeParam> for_lifetimes, std::unique_ptr<Type> bound_type, - std::vector<std::unique_ptr<TypeParamBound>> type_param_bounds) + std::vector<std::unique_ptr<TypeParamBound>> type_param_bounds, + Location locus) : for_lifetimes (std::move (for_lifetimes)), bound_type (std::move (bound_type)), type_param_bounds (std::move (type_param_bounds)), - node_id (Analysis::Mappings::get ()->get_next_node_id ()) + node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus) {} // Copy constructor requires clone @@ -298,6 +300,8 @@ public: NodeId get_node_id () const override final { return node_id; } + Location get_locus () const { return locus; } + protected: // Clone function implementation as (not pure) virtual method TypeBoundWhereClauseItem *clone_where_clause_item_impl () const override |