0011-Adjust-to-changes-in-GCC-10.patch 3.2 KB

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