diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2021-02-05 21:49:35 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2021-02-05 21:49:35 +0800 |
commit | 5c7dacd845ffb4b9a101308bc14241e7e9b939f8 (patch) | |
tree | 0d25f1e3f9bf7f192a06487cfb268719465df527 /gcc | |
parent | 7c7c76f27f6ab999ec8fa299bde8911911fa7d90 (diff) | |
download | gcc-5c7dacd845ffb4b9a101308bc14241e7e9b939f8.zip gcc-5c7dacd845ffb4b9a101308bc14241e7e9b939f8.tar.gz gcc-5c7dacd845ffb4b9a101308bc14241e7e9b939f8.tar.bz2 |
Added some debug for cfg stripping and improved dump messages
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/expand/rust-macro-expand.cc | 7 | ||||
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc index cfd587b..29fc58b 100644 --- a/gcc/rust/expand/rust-macro-expand.cc +++ b/gcc/rust/expand/rust-macro-expand.cc @@ -1504,7 +1504,7 @@ public: return; } - // TODO: strip sub-patterns of pattern + // strip sub-patterns of pattern auto &pattern = expr.get_pattern (); pattern->accept_vis (*this); if (pattern->is_marked_for_strip ()) @@ -3283,7 +3283,12 @@ MacroExpander::fails_cfg_with_expand (std::vector<AST::Attribute> &attrs) const attr.parse_attr_to_meta_item (); if (!attr.check_cfg_predicate (session)) + { + // DEBUG + fprintf (stderr, "cfg predicate failed for attribute: \033[0;31m'%s'\033[0m\n", attr.as_string ()); + return true; + } } } return false; diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 281049d..dcdbd49 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -363,7 +363,8 @@ Session::enable_dump (std::string arg) rust_error_at ( Location (), "dumping all is not supported as of now. choose %<lex%>, %<parse%>, " - "or %<target_options%>"); + "%<register_plugins%>, %<injection%>, %<expansion%>, %<resolution%>," + " %<target_options%>, or %<hir%>"); return false; } else if (arg == "lex") @@ -406,15 +407,17 @@ Session::enable_dump (std::string arg) else if (arg == "") { rust_error_at (Location (), "dump option was not given a name. choose " - "%<lex%>, %<parse%>, or %<target_options%>"); + "%<lex%>, %<parse%>, %<register_plugins%>, %<injection%>, " + "%<expansion%>, %<resolution%>, %<target_options%>, or %<hir%>"); return false; } else { rust_error_at ( Location (), - "dump option %qs was unrecognised. choose %<lex%>, %<parse%>, or " - "%<target_options%>", + "dump option %qs was unrecognised. choose %<lex%>, %<parse%>, " + "%<register_plugins%>, %<injection%>, %<expansion%>, %<resolution%>," + " %<target_options%>, or %<hir%>", arg.c_str ()); return false; } |