1From 060bb7eb4d008fbd4a9fa8ef7c5e33c9e483eb52 Mon Sep 17 00:00:00 2001 2From: Boris Kolpackov <boris@codesynthesis.com> 3Date: Wed, 17 Jun 2020 11:22:11 +0200 4Subject: [PATCH] Adjust to changes in GCC 10 5 6[Upstream: 060bb7eb4d008fbd4a9fa8ef7c5e33c9e483eb52] 7Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> 8--- 9 odb/gcc.hxx | 7 +++++-- 10 odb/parser.cxx | 8 ++++---- 11 odb/semantics/elements.cxx | 4 ++-- 12 3 files changed, 11 insertions(+), 8 deletions(-) 13 14diff --git a/odb/gcc.hxx b/odb/gcc.hxx 15index 9b644d7..af0e2a0 100644 16--- a/odb/gcc.hxx 17+++ b/odb/gcc.hxx 18@@ -151,10 +151,13 @@ gcc_tree_code_name (gcc_tree_code_type tc) {return tree_code_name[tc];} 19 #define DECL_CHAIN(x) TREE_CHAIN(x) 20 #endif 21 22-// In GCC 6, ANON_AGGRNAME_P became anon_aggrname_p(). 23+// In GCC 6 ANON_AGGRNAME_P became anon_aggrname_p(). 24+// In GCC 10 anon_aggrname_p() became IDENTIFIER_ANON_P. 25 // 26 #if BUILDING_GCC_MAJOR < 6 27-# define anon_aggrname_p(X) ANON_AGGRNAME_P(X) 28+# define IDENTIFIER_ANON_P(X) ANON_AGGRNAME_P(X) 29+#elif BUILDING_GCC_MAJOR < 10 30+# define IDENTIFIER_ANON_P(X) anon_aggrname_p(X) 31 #endif 32 33 // In GCC 9: 34diff --git a/odb/parser.cxx b/odb/parser.cxx 35index 69d9b28..58388c9 100644 36--- a/odb/parser.cxx 37+++ b/odb/parser.cxx 38@@ -1103,14 +1103,14 @@ emit_type_decl (tree decl) 39 // says that in typedef struct {} S; S becomes struct's 40 // name. 41 // 42- if (anon_aggrname_p (decl_name)) 43+ if (IDENTIFIER_ANON_P (decl_name)) 44 { 45 tree d (TYPE_NAME (t)); 46 47 if (d != NULL_TREE && 48 !DECL_ARTIFICIAL (d) && 49 DECL_NAME (d) != NULL_TREE && 50- !anon_aggrname_p (DECL_NAME (d))) 51+ !IDENTIFIER_ANON_P (DECL_NAME (d))) 52 { 53 decl = d; 54 decl_name = DECL_NAME (decl); 55@@ -1727,7 +1727,7 @@ create_type (tree t, 56 ts << "start anon/stub " << gcc_tree_code_name(tc) << " at " 57 << file << ":" << line << endl; 58 59- if (d == NULL_TREE || anon_aggrname_p (DECL_NAME (d))) 60+ if (d == NULL_TREE || IDENTIFIER_ANON_P (DECL_NAME (d))) 61 { 62 if (tc == RECORD_TYPE) 63 r = &emit_class<class_> (t, file, line, clmn); 64@@ -1824,7 +1824,7 @@ create_type (tree t, 65 ts << "start anon/stub " << gcc_tree_code_name(tc) << " at " 66 << file << ":" << line << endl; 67 68- if (d == NULL_TREE || anon_aggrname_p (DECL_NAME (d))) 69+ if (d == NULL_TREE || IDENTIFIER_ANON_P (DECL_NAME (d))) 70 { 71 r = &emit_enum (t, access, file, line, clmn); 72 } 73diff --git a/odb/semantics/elements.cxx b/odb/semantics/elements.cxx 74index f937f54..2d266cf 100644 75--- a/odb/semantics/elements.cxx 76+++ b/odb/semantics/elements.cxx 77@@ -75,7 +75,7 @@ namespace semantics 78 if (tree decl = TYPE_NAME (n)) 79 name = DECL_NAME (decl); 80 81- return name != 0 && anon_aggrname_p (name); 82+ return name != 0 && IDENTIFIER_ANON_P (name); 83 } 84 85 return true; 86@@ -124,7 +124,7 @@ namespace semantics 87 if (tree decl = TYPE_NAME (type)) 88 { 89 name = DECL_NAME (decl); 90- if (name != 0 && anon_aggrname_p (name)) 91+ if (name != 0 && IDENTIFIER_ANON_P (name)) 92 return true; 93 94 tree s (CP_DECL_CONTEXT (decl)); 95-- 962.26.2 97 98