From 3571e997473c87dcdb2ca590951acbd698382a33 Mon Sep 17 00:00:00 2001 From: SimplyTheOther Date: Sat, 6 Feb 2021 16:25:10 +0800 Subject: Added more debug for cfg predicate checking --- gcc/rust/expand/rust-macro-expand.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc index cd37673..e9f2e2a 100644 --- a/gcc/rust/expand/rust-macro-expand.cc +++ b/gcc/rust/expand/rust-macro-expand.cc @@ -3282,12 +3282,19 @@ MacroExpander::fails_cfg_with_expand (std::vector &attrs) const if (!attr.is_parsed_to_meta_item ()) attr.parse_attr_to_meta_item (); + // DEBUG + if (!attr.is_parsed_to_meta_item ()) + fprintf (stderr, "failed to parse attr to meta item, right before cfg predicate check\n"); + if (!attr.check_cfg_predicate (session)) { // DEBUG fprintf (stderr, "cfg predicate failed for attribute: \033[0;31m'%s'\033[0m\n", attr.as_string ().c_str ()); return true; + } else { + // DEBUG + fprintf (stderr, "cfg predicate succeeded for attribute: \033[0;31m'%s'\033[0m\n", attr.as_string ().c_str ()); } } } -- cgit v1.1