]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: lang-items: Collect trait functions that are lang items
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 18 Dec 2024 11:20:27 +0000 (12:20 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Fri, 21 Mar 2025 11:55:44 +0000 (12:55 +0100)
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.

gcc/rust/ast/rust-collect-lang-items.cc
gcc/rust/ast/rust-collect-lang-items.h

index 308720ae69ab0e811fa132f5bd60958534d7a365..50d134a429f514171f0845cce8d8919adf7dd0c7 100644 (file)
@@ -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
index 552648f04edabc9ddaaf224c39b8f1d61ece37c8..1d021b1d9c50a60cc732658a3bfc89e4fb9df9ee 100644 (file)
@@ -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);