Skip to content

Commit 9a07804

Browse files
committed
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.
1 parent 699fdd4 commit 9a07804

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,13 @@ CollectLangItems::visit (AST::TraitItemType &item)
8282
DefaultASTVisitor::visit (item);
8383
}
8484

85+
void
86+
CollectLangItems::visit (AST::Function &item)
87+
{
88+
maybe_add_lang_item (item);
89+
90+
DefaultASTVisitor::visit (item);
91+
}
92+
8593
} // namespace AST
8694
} // namespace Rust

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

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class CollectLangItems : public DefaultASTVisitor
4747

4848
void visit (AST::Trait &item) override;
4949
void visit (AST::TraitItemType &item) override;
50+
void visit (AST::Function &item) override;
5051

5152
private:
5253
template <typename T> void maybe_add_lang_item (const T &item);

0 commit comments

Comments
 (0)