diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-12-26 22:35:15 +0000 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-21 12:57:49 +0100 |
commit | 88aeeccaca422cd50331edb38d0a8a17e01a5fb9 (patch) | |
tree | 2a582e8d756aa3b01b46e4caf27ec2d9fafc57bb | |
parent | 01504790ad2694d546f7c400be8e9d9a3f78e18c (diff) | |
download | gcc-88aeeccaca422cd50331edb38d0a8a17e01a5fb9.zip gcc-88aeeccaca422cd50331edb38d0a8a17e01a5fb9.tar.gz gcc-88aeeccaca422cd50331edb38d0a8a17e01a5fb9.tar.bz2 |
gccrs: lang-items: Collect struct lang items.
gcc/rust/ChangeLog:
* ast/rust-collect-lang-items.cc (CollectLangItems::visit): New.
* ast/rust-collect-lang-items.h: New.
-rw-r--r-- | gcc/rust/ast/rust-collect-lang-items.cc | 9 | ||||
-rw-r--r-- | gcc/rust/ast/rust-collect-lang-items.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-collect-lang-items.cc b/gcc/rust/ast/rust-collect-lang-items.cc index 168123e..11c3297 100644 --- a/gcc/rust/ast/rust-collect-lang-items.cc +++ b/gcc/rust/ast/rust-collect-lang-items.cc @@ -23,6 +23,7 @@ #include "rust-attribute-values.h" #include "rust-attributes.h" #include "rust-hir-map.h" +#include "rust-item.h" namespace Rust { namespace AST { @@ -91,5 +92,13 @@ CollectLangItems::visit (AST::Function &item) DefaultASTVisitor::visit (item); } +void +CollectLangItems::visit (AST::StructStruct &item) +{ + maybe_add_lang_item (item); + + DefaultASTVisitor::visit (item); +} + } // namespace AST } // namespace Rust diff --git a/gcc/rust/ast/rust-collect-lang-items.h b/gcc/rust/ast/rust-collect-lang-items.h index 1d021b1..39cb4be 100644 --- a/gcc/rust/ast/rust-collect-lang-items.h +++ b/gcc/rust/ast/rust-collect-lang-items.h @@ -48,6 +48,7 @@ public: void visit (AST::Trait &item) override; void visit (AST::TraitItemType &item) override; void visit (AST::Function &item) override; + void visit (AST::StructStruct &item) override; private: template <typename T> void maybe_add_lang_item (const T &item); |