diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-12-18 12:20:27 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-21 12:55:44 +0100 |
commit | 2c883bb004c08cef9bf01f90cf39108e14dd98b5 (patch) | |
tree | 0d660005c48faa2a483f2bc3e27dd6af7d31bbf1 | |
parent | f8aa5ececd42ad2cefa837a99756300f41bc4d5a (diff) | |
download | gcc-2c883bb004c08cef9bf01f90cf39108e14dd98b5.zip gcc-2c883bb004c08cef9bf01f90cf39108e14dd98b5.tar.gz gcc-2c883bb004c08cef9bf01f90cf39108e14dd98b5.tar.bz2 |
gccrs: lang-items: Collect trait functions that are lang items
gcc/rust/ChangeLog:
* ast/rust-collect-lang-items.cc (CollectLangItems::visit): Add visitor for collecting
functions that might be lang items.
* ast/rust-collect-lang-items.h: Likewise.
-rw-r--r-- | gcc/rust/ast/rust-collect-lang-items.cc | 8 | ||||
-rw-r--r-- | gcc/rust/ast/rust-collect-lang-items.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-collect-lang-items.cc b/gcc/rust/ast/rust-collect-lang-items.cc index 308720a..50d134a 100644 --- a/gcc/rust/ast/rust-collect-lang-items.cc +++ b/gcc/rust/ast/rust-collect-lang-items.cc @@ -82,5 +82,13 @@ CollectLangItems::visit (AST::TraitItemType &item) DefaultASTVisitor::visit (item); } +void +CollectLangItems::visit (AST::Function &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 552648f..1d021b1 100644 --- a/gcc/rust/ast/rust-collect-lang-items.h +++ b/gcc/rust/ast/rust-collect-lang-items.h @@ -47,6 +47,7 @@ public: void visit (AST::Trait &item) override; void visit (AST::TraitItemType &item) override; + void visit (AST::Function &item) override; private: template <typename T> void maybe_add_lang_item (const T &item); |