From: Arthur Cohen <arthur.co...@embecosm.com> gcc/rust/ChangeLog:
* ast/rust-collect-lang-items.h: Declare visitor. * ast/rust-collect-lang-items.cc (CollectLangItems::visit): New. --- gcc/rust/ast/rust-collect-lang-items.cc | 9 +++++++++ gcc/rust/ast/rust-collect-lang-items.h | 1 + 2 files changed, 10 insertions(+) diff --git a/gcc/rust/ast/rust-collect-lang-items.cc b/gcc/rust/ast/rust-collect-lang-items.cc index 11c3297d2a9..cd6be7fbeb9 100644 --- a/gcc/rust/ast/rust-collect-lang-items.cc +++ b/gcc/rust/ast/rust-collect-lang-items.cc @@ -19,6 +19,7 @@ #include "rust-collect-lang-items.h" #include "optional.h" #include "rust-ast-collector.h" +#include "rust-ast-visitor.h" #include "rust-ast.h" #include "rust-attribute-values.h" #include "rust-attributes.h" @@ -100,5 +101,13 @@ CollectLangItems::visit (AST::StructStruct &item) DefaultASTVisitor::visit (item); } +void +CollectLangItems::visit (AST::EnumItem &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 39cb4be31a0..ddb34a914ed 100644 --- a/gcc/rust/ast/rust-collect-lang-items.h +++ b/gcc/rust/ast/rust-collect-lang-items.h @@ -49,6 +49,7 @@ public: void visit (AST::TraitItemType &item) override; void visit (AST::Function &item) override; void visit (AST::StructStruct &item) override; + void visit (AST::EnumItem &item) override; private: template <typename T> void maybe_add_lang_item (const T &item); -- 2.45.2