aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-toplevel.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-02-02 15:05:19 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-02-02 16:47:19 +0000
commit4d1ca35582e69e8677bd96775edbf03b6eec6ab8 (patch)
tree4baa7da3f520efec9d02c4d0c44a8b07268a6f5d /gcc/rust/resolve/rust-ast-resolve-toplevel.h
parentf7f14de056eb3887e70f29b0f29da4025f746559 (diff)
downloadgcc-4d1ca35582e69e8677bd96775edbf03b6eec6ab8.zip
gcc-4d1ca35582e69e8677bd96775edbf03b6eec6ab8.tar.gz
gcc-4d1ca35582e69e8677bd96775edbf03b6eec6ab8.tar.bz2
Apply the is_marked_for_strip check to the rest of the crate
We need to apply this to all levels of the crate: Item impl-item trait-item Stmt
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-toplevel.h')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-toplevel.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-toplevel.h b/gcc/rust/resolve/rust-ast-resolve-toplevel.h
index 56962f6..7aba67f 100644
--- a/gcc/rust/resolve/rust-ast-resolve-toplevel.h
+++ b/gcc/rust/resolve/rust-ast-resolve-toplevel.h
@@ -36,6 +36,9 @@ public:
static void go (AST::Item *item, const CanonicalPath &prefix,
const CanonicalPath &canonical_prefix)
{
+ if (item->is_marked_for_strip ())
+ return;
+
ResolveTopLevel resolver (prefix, canonical_prefix);
item->accept_vis (resolver);
};
@@ -286,9 +289,6 @@ public:
void visit (AST::Function &function) override
{
- if (function.is_marked_for_strip ())
- return;
-
auto decl = ResolveFunctionItemToCanonicalPath::resolve (function);
auto path = prefix.append (decl);
auto cpath = canonical_prefix.append (decl);