diff options
author | SimplyTheOther <simplytheother@gmail.com> | 2021-02-06 18:10:57 +0800 |
---|---|---|
committer | SimplyTheOther <simplytheother@gmail.com> | 2021-02-06 18:10:57 +0800 |
commit | feaa2074d8cece0510c49c45a2456a3f56b02381 (patch) | |
tree | a7d9ef0754e55372bcfba938772febac8d1511e8 /gcc | |
parent | 3571e997473c87dcdb2ca590951acbd698382a33 (diff) | |
download | gcc-feaa2074d8cece0510c49c45a2456a3f56b02381.zip gcc-feaa2074d8cece0510c49c45a2456a3f56b02381.tar.gz gcc-feaa2074d8cece0510c49c45a2456a3f56b02381.tar.bz2 |
Added even more debug for cfg predicate checking
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-ast-full-test.cc | 6 | ||||
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 1 | ||||
-rw-r--r-- | gcc/rust/expand/rust-macro-expand.cc | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc index 53007e7..aa17d60 100644 --- a/gcc/rust/ast/rust-ast-full-test.cc +++ b/gcc/rust/ast/rust-ast-full-test.cc @@ -5359,8 +5359,12 @@ Attribute::check_cfg_predicate (const Session &session) const /* assume that cfg predicate actually can exist, i.e. attribute has cfg or * cfg_attr path */ if (!has_attr_input () - || (path.as_string () != "cfg" && path.as_string () != "cfg_attr")) + || (path.as_string () != "cfg" && path.as_string () != "cfg_attr")) { + // DEBUG message + fprintf (stderr, "tried to check cfg predicate on attr that either has no input or invalid path. attr: '%s'\n", as_string ().c_str ()); + return false; + } // assume that it has already been parsed if (!is_parsed_to_meta_item ()) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index faecfba..0922045 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -733,6 +733,7 @@ public: bool check_cfg_predicate (const Session &) const override { // this should never be called - should be converted first + rust_assert (false); return false; } diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc index e9f2e2a..df99d75 100644 --- a/gcc/rust/expand/rust-macro-expand.cc +++ b/gcc/rust/expand/rust-macro-expand.cc @@ -3285,6 +3285,8 @@ MacroExpander::fails_cfg_with_expand (std::vector<AST::Attribute> &attrs) const // DEBUG if (!attr.is_parsed_to_meta_item ()) fprintf (stderr, "failed to parse attr to meta item, right before cfg predicate check\n"); + else + fprintf(stderr, "attr has been successfully parsed to meta item, right before cfg predicate check\n"); if (!attr.check_cfg_predicate (session)) { |