aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/rust-ast-lower-base.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-10-14 16:06:33 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:35 +0100
commit8f0b1526e04c80fd3cc30f692f482df14939088b (patch)
tree6f073fd86bca5240d90db3144eccf3ecdb24f32d /gcc/rust/hir/rust-ast-lower-base.cc
parentacbaadfa46d0833a28b935e5cfab1bc2b30467a6 (diff)
downloadgcc-8f0b1526e04c80fd3cc30f692f482df14939088b.zip
gcc-8f0b1526e04c80fd3cc30f692f482df14939088b.tar.gz
gcc-8f0b1526e04c80fd3cc30f692f482df14939088b.tar.bz2
gccrs: Support outer attribute handling on trait items just like normal items
gcc/rust/ChangeLog: * hir/rust-ast-lower-base.h (class ItemWrapper): New class. * hir/rust-ast-lower-base.cc (ASTLoweringBase::handle_outer_attributes): Use `ItemWrapper` class. (ASTLoweringBase::handle_doc_item_attribute): Likewise. (ASTLoweringBase::handle_lang_item_attribute): Likewise. * hir/rust-ast-lower-implitem.h: Check outer attributes on items. * hir/tree/rust-hir-item.h: Add `get_trait_locus` methods. * hir/tree/rust-hir.h: Likewise. * util/rust-hir-map.h: Add defId mappings and associated functions. * util/rust-hir-map.cc (Mappings::insert_defid_mapping): Implement insertion to said mappings. (Mappings::lookup_trait_item_defid): And looking up said mappings.
Diffstat (limited to 'gcc/rust/hir/rust-ast-lower-base.cc')
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index a4bcfd6..098014f 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -824,7 +824,7 @@ ASTLoweringBase::lower_qualifiers (const AST::FunctionQualifiers &qualifiers)
}
void
-ASTLoweringBase::handle_outer_attributes (const HIR::Item &item)
+ASTLoweringBase::handle_outer_attributes (const ItemWrapper &item)
{
for (const auto &attr : item.get_outer_attrs ())
{
@@ -855,7 +855,7 @@ ASTLoweringBase::handle_outer_attributes (const HIR::Item &item)
}
void
-ASTLoweringBase::handle_doc_item_attribute (const HIR::Item &item,
+ASTLoweringBase::handle_doc_item_attribute (const ItemWrapper &item,
const AST::Attribute &attr)
{
auto simple_doc_comment = attr.has_attr_input ()
@@ -878,7 +878,7 @@ ASTLoweringBase::handle_doc_item_attribute (const HIR::Item &item,
}
void
-ASTLoweringBase::handle_lang_item_attribute (const HIR::Item &item,
+ASTLoweringBase::handle_lang_item_attribute (const ItemWrapper &item,
const AST::Attribute &attr)
{
auto &literal = static_cast<AST::AttrInputLiteral &> (attr.get_attr_input ());