Skip to content

Commit

Permalink
lang-items: Collect enum variants as lang items
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Dec 23, 2024
1 parent c964f2f commit d400bd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gcc/rust/ast/rust-collect-lang-items.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -90,5 +91,13 @@ CollectLangItems::visit (AST::Function &item)
DefaultASTVisitor::visit (item);
}

void
CollectLangItems::visit (AST::EnumItem &item)
{
maybe_add_lang_item (item);

DefaultASTVisitor::visit (item);
}

} // namespace AST
} // namespace Rust
1 change: 1 addition & 0 deletions gcc/rust/ast/rust-collect-lang-items.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class CollectLangItems : public DefaultASTVisitor
void visit (AST::Trait &item) override;
void visit (AST::TraitItemType &item) override;
void visit (AST::Function &item) override;
void visit (AST::EnumItem &item) override;

private:
template <typename T> void maybe_add_lang_item (const T &item);
Expand Down

0 comments on commit d400bd4

Please sign in to comment.