aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-01-28 10:08:44 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-01-28 10:08:44 +0000
commitebfbdf962fb3e65e17ad8a0477558549e924dd22 (patch)
treeab049e20f1637ab091367922befeeafcc6d539d1 /gcc/rust/hir
parent1fc2b540800d25af1c70e90439e8a9077c7d07f8 (diff)
downloadgcc-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/hir')
-rw-r--r--gcc/rust/hir/rust-ast-lower-item.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-item.h b/gcc/rust/hir/rust-ast-lower-item.h
index 23ff5b2..b67016c 100644
--- a/gcc/rust/hir/rust-ast-lower-item.h
+++ b/gcc/rust/hir/rust-ast-lower-item.h
@@ -44,15 +44,6 @@ public:
{
ASTLoweringItem resolver;
item->accept_vis (resolver);
-
- // this is useful for debugging
- // if (resolver.translated == nullptr)
- // {
- // rust_fatal_error (item->get_locus (), "failed to lower: %s",
- // item->as_string ().c_str ());
- // return nullptr;
- // }
-
return resolver.translated;
}
@@ -419,6 +410,9 @@ public:
void visit (AST::Function &function) override
{
+ if (function.is_marked_for_strip ())
+ return;
+
std::vector<std::unique_ptr<HIR::WhereClauseItem>> where_clause_items;
for (auto &item : function.get_where_clause ().get_items ())
{