diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-01-28 10:08:44 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-01-28 10:08:44 +0000 |
commit | ebfbdf962fb3e65e17ad8a0477558549e924dd22 (patch) | |
tree | ab049e20f1637ab091367922befeeafcc6d539d1 /gcc/rust/resolve | |
parent | 1fc2b540800d25af1c70e90439e8a9077c7d07f8 (diff) | |
download | gcc-ebfbdf962fb3e65e17ad8a0477558549e924dd22.zip gcc-ebfbdf962fb3e65e17ad8a0477558549e924dd22.tar.gz gcc-ebfbdf962fb3e65e17ad8a0477558549e924dd22.tar.bz2 |
Add -frust-cfg=value option for adding config options
This adds the initial support for config expansion on custom config values
it need support for parsing options such as feature=test with apropriate
error handling withing Session::handle_cfg_option(const std::string&).
This also applies the mark_for_strip checks only on AST::Functions and
will need applied to the rest of the crate in #872.
Addresses #889
Diffstat (limited to 'gcc/rust/resolve')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-item.h | 3 | ||||
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-toplevel.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.h b/gcc/rust/resolve/rust-ast-resolve-item.h index b92dc96..200c5ff 100644 --- a/gcc/rust/resolve/rust-ast-resolve-item.h +++ b/gcc/rust/resolve/rust-ast-resolve-item.h @@ -362,6 +362,9 @@ public: void visit (AST::Function &function) override { + if (function.is_marked_for_strip ()) + return; + NodeId scope_node_id = function.get_node_id (); resolver->get_name_scope ().push (scope_node_id); resolver->get_type_scope ().push (scope_node_id); diff --git a/gcc/rust/resolve/rust-ast-resolve-toplevel.h b/gcc/rust/resolve/rust-ast-resolve-toplevel.h index 16acf13..4993649 100644 --- a/gcc/rust/resolve/rust-ast-resolve-toplevel.h +++ b/gcc/rust/resolve/rust-ast-resolve-toplevel.h @@ -220,6 +220,9 @@ public: void visit (AST::Function &function) override { + if (function.is_marked_for_strip ()) + return; + auto path = prefix.append (ResolveFunctionItemToCanonicalPath::resolve (function)); resolver->get_name_scope ().insert ( |