diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-03 11:33:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 11:33:00 +0000 |
commit | 016db703cb0a5c2c4eb52dd8b29bbc01826c4e5c (patch) | |
tree | 4baa7da3f520efec9d02c4d0c44a8b07268a6f5d /gcc/rust/hir | |
parent | f7f14de056eb3887e70f29b0f29da4025f746559 (diff) | |
parent | 4d1ca35582e69e8677bd96775edbf03b6eec6ab8 (diff) | |
download | gcc-016db703cb0a5c2c4eb52dd8b29bbc01826c4e5c.zip gcc-016db703cb0a5c2c4eb52dd8b29bbc01826c4e5c.tar.gz gcc-016db703cb0a5c2c4eb52dd8b29bbc01826c4e5c.tar.bz2 |
Merge #904
904: Apply the is_marked_for_strip check to the rest of the crate r=philberty a=philberty
We need to apply this to all levels of the crate:
Item
types
impl-item
trait-item
Stmt
expr's
Fixes #872
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-item.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-item.h b/gcc/rust/hir/rust-ast-lower-item.h index b67016c..d4b5910 100644 --- a/gcc/rust/hir/rust-ast-lower-item.h +++ b/gcc/rust/hir/rust-ast-lower-item.h @@ -147,6 +147,9 @@ public: std::vector<HIR::TupleField> fields; for (AST::TupleField &field : struct_decl.get_fields ()) { + if (field.get_field_type ()->is_marked_for_strip ()) + continue; + HIR::Visibility vis = HIR::Visibility::create_public (); HIR::Type *type = ASTLoweringType::translate (field.get_field_type ().get ()); @@ -208,6 +211,9 @@ public: std::vector<HIR::StructField> fields; for (AST::StructField &field : struct_decl.get_fields ()) { + if (field.get_field_type ()->is_marked_for_strip ()) + continue; + HIR::Visibility vis = HIR::Visibility::create_public (); HIR::Type *type = ASTLoweringType::translate (field.get_field_type ().get ()); @@ -272,6 +278,9 @@ public: std::vector<std::unique_ptr<HIR::EnumItem>> items; for (auto &variant : enum_decl.get_variants ()) { + if (variant->is_marked_for_strip ()) + continue; + HIR::EnumItem *hir_item = ASTLoweringEnumItem::translate (variant.get ()); items.push_back (std::unique_ptr<HIR::EnumItem> (hir_item)); @@ -318,6 +327,9 @@ public: std::vector<HIR::StructField> variants; for (AST::StructField &variant : union_decl.get_variants ()) { + if (variant.get_field_type ()->is_marked_for_strip ()) + continue; + HIR::Visibility vis = HIR::Visibility::create_public (); HIR::Type *type = ASTLoweringType::translate (variant.get_field_type ().get ()); @@ -558,6 +570,9 @@ public: std::vector<HirId> impl_item_ids; for (auto &impl_item : impl_block.get_impl_items ()) { + if (impl_item->is_marked_for_strip ()) + continue; + HIR::ImplItem *lowered = ASTLowerImplItem::translate (impl_item.get (), mapping.get_hirid ()); @@ -623,6 +638,9 @@ public: std::vector<HirId> trait_item_ids; for (auto &item : trait.get_trait_items ()) { + if (item->is_marked_for_strip ()) + continue; + HIR::TraitItem *lowered = ASTLowerTraitItem::translate (item.get ()); trait_items.push_back (std::unique_ptr<HIR::TraitItem> (lowered)); trait_item_ids.push_back (lowered->get_mappings ().get_hirid ()); @@ -716,6 +734,9 @@ public: std::vector<HirId> impl_item_ids; for (auto &impl_item : impl_block.get_impl_items ()) { + if (impl_item->is_marked_for_strip ()) + continue; + HIR::ImplItem *lowered = ASTLowerImplItem::translate (impl_item.get (), mapping.get_hirid ()); @@ -754,6 +775,9 @@ public: std::vector<std::unique_ptr<HIR::ExternalItem>> extern_items; for (auto &item : extern_block.get_extern_items ()) { + if (item->is_marked_for_strip ()) + continue; + HIR::ExternalItem *lowered = ASTLoweringExternItem::translate (item.get ()); extern_items.push_back (std::unique_ptr<HIR::ExternalItem> (lowered)); |