diff --git a/configure.ac b/configure.ac index af06eed1..671eab50 100644 --- a/configure.ac +++ b/configure.ac @@ -585,6 +585,8 @@ if test x$ABIGAIL_DEVEL != x; then CXXFLAGS="-g -Wall -Wextra -Werror" fi +dnl Check if several decls and constant are defined in dependant +dnl libraries HAS_EM_AARCH64=no AC_CHECK_DECL([EM_AARCH64], [HAS_EM_AARCH64=yes], @@ -621,6 +623,117 @@ if test x$HAS_EM_TILEGX = xyes; then [Defined to 1 if elf.h has EM_TILEGX macro defined]) fi +HAS_DW_LANG_UPC=no +AC_CHECK_DECL([DW_LANG_UPC], + [HAS_DW_LANG_UPC=yes], + [HAS_DW_LANG_UPC=no], + [[#include ]]) +if test x$HAS_DW_LANG_UPC = xyes; then + AC_DEFINE([HAVE_DW_LANG_UPC_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_UPC enumerator]) +fi + +HAS_DW_LANG_D=no +AC_CHECK_DECL([DW_LANG_D], + [HAS_DW_LANG_D=yes], + [HAS_DW_LANG_D=no], + [[#include ]]) +if test x$HAS_DW_LANG_D = xyes; then + AC_DEFINE([HAVE_DW_LANG_D_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_D enumerator]) +fi + +HAS_DW_LANG_Python=no +AC_CHECK_DECL([DW_LANG_Python], + [HAS_DW_LANG_Python=yes], + [HAS_DW_LANG_Python=no], + [[#include ]]) +if test x$HAS_DW_LANG_Python = xyes; then + AC_DEFINE([HAVE_DW_LANG_Python_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_Python enumerator]) +fi + +HAS_DW_LANG_Go=no +AC_CHECK_DECL([DW_LANG_Go], + [HAS_DW_LANG_Go=yes], + [HAS_DW_LANG_Go=no], + [[#include ]]) +if test x$HAS_DW_LANG_Go = xyes; then + AC_DEFINE([HAVE_DW_LANG_Go_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_Go enumerator]) +fi + +HAS_DW_LANG_C11=no +AC_CHECK_DECL([DW_LANG_C11], + [HAS_DW_LANG_C11=yes], + [HAS_DW_LANG_C11=no], + [[#include ]]) +if test x$HAS_DW_LANG_C11 = xyes; then + AC_DEFINE([HAVE_DW_LANG_C11_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_C11 enumerator]) +fi + +HAS_DW_LANG_C_plus_plus_03=no +AC_CHECK_DECL([DW_LANG_C_plus_plus_03], + [HAS_DW_LANG_C_plus_plus_03=yes], + [HAS_DW_LANG_C_plus_plus_03=no], + [[#include ]]) +if test x$HAS_DW_LANG_C_plus_plus_03 = xyes; then + AC_DEFINE([HAVE_DW_LANG_C_plus_plus_03_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_03 enumerator]) +fi + +HAS_DW_LANG_C_plus_plus_11=no +AC_CHECK_DECL([DW_LANG_C_plus_plus_11], + [HAS_DW_LANG_C_plus_plus_11=yes], + [HAS_DW_LANG_C_plus_plus_11=no], + [[#include ]]) +if test x$HAS_DW_LANG_C_plus_plus_11 = xyes; then + AC_DEFINE([HAVE_DW_LANG_C_plus_plus_11_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_11 enumerator]) +fi + +HAS_DW_LANG_C_plus_plus_14=no +AC_CHECK_DECL([DW_LANG_C_plus_plus_14], + [HAS_DW_LANG_C_plus_plus_14=yes], + [HAS_DW_LANG_C_plus_plus_14=no], + [[#include ]]) +if test x$HAS_DW_LANG_C_plus_plus_14 = xyes; then + AC_DEFINE([HAVE_DW_LANG_C_plus_plus_14_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_14 enumerator]) +fi + +HAS_DW_LANG_Mips_Assembler=no +AC_CHECK_DECL([DW_LANG_Mips_Assembler], + [HAS_DW_LANG_Mips_Assembler=yes], + [HAS_DW_LANG_Mips_Assembler=no], + [[#include ]]) +if test x$HAS_DW_LANG_Mips_Assembler = xyes; then + AC_DEFINE([HAVE_DW_LANG_Mips_Assembler_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_Mips_Assembler enumerator]) +fi + +HAS_DW_LANG_Rust=no +AC_CHECK_DECL([DW_LANG_Rust], + [HAS_LANG_Rust=yes], + [HAS_LANG_Rust=no], + [[#include ]]) + +if test x$HAS_DW_LANG_Rust = xyes; then + AC_DEFINE([HAVE_DW_LANG_Rust_enumerator], + 1, + [Define to 1 if dwarf.h has the DW_LANG_Rust enumerator]) +fi + dnl Set large files support AC_SYS_LARGEFILE diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index a15ff4d5..d6bb0c77 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -12194,7 +12194,6 @@ dwarf_language_to_tu_language(size_t l) case DW_LANG_C89: return translation_unit::LANG_C89; case DW_LANG_C: - case DW_LANG_C11: return translation_unit::LANG_C; case DW_LANG_Ada83: return translation_unit::LANG_Ada83; @@ -12226,51 +12225,53 @@ dwarf_language_to_tu_language(size_t l) return translation_unit::LANG_ObjC; case DW_LANG_ObjC_plus_plus: return translation_unit::LANG_ObjC_plus_plus; -#ifdef DW_LANG_Rust + +#ifdef HAVE_DW_LANG_Rust_enumerator case DW_LANG_Rust: return translation_unit::LANG_Rust; #endif -#ifdef DW_LANG_UPC + +#ifdef HAVE_DW_LANG_UPC_enumerator case DW_LANG_UPC: - return DW_LANG_UPC; + return translation_unit::LANG_UPC; #endif -#ifdef DW_LANG_D +#ifdef HAVE_DW_LANG_D_enumerator case DW_LANG_D: return translation_unit::LANG_D; #endif -#ifdef DW_LANG_Python +#ifdef HAVE_DW_LANG_Python_enumerator case DW_LANG_Python: return translation_unit::LANG_Python; #endif -#ifdef DW_LANG_Go +#ifdef HAVE_DW_LANG_Go_enumerator case DW_LANG_Go: return translation_unit::LANG_Go; #endif -#ifdef DW_LANG_C_plus_plus_03 - case DW_LANG_C_plus_plus_03: - return translation_unit::LANG_C_plus_plus_03; -#endif - -#ifdef DW_LANG_C_plus_plus_11 - case DW_LANG_C_plus_plus_11: - return translation_unit::LANG_C_plus_plus_11; -#endif - -#ifdef DW_LANG_C11 +#ifdef HAVE_DW_LANG_C11_enumerator case DW_LANG_C11: return translation_unit::LANG_C11; #endif -#ifdef DW_LANG_C_plus_plus_14 +#ifdef HAVE_DW_LANG_C_plus_plus_03_enumerator + case DW_LANG_C_plus_plus_03: + return translation_unit::LANG_C_plus_plus_03; +#endif + +#ifdef HAVE_DW_LANG_C_plus_plus_11_enumerator + case DW_LANG_C_plus_plus_11: + return translation_unit::LANG_C_plus_plus_11; +#endif + +#ifdef HAVE_DW_LANG_C_plus_plus_14_enumerator case DW_LANG_C_plus_plus_14: return translation_unit::LANG_C_plus_plus_14; #endif -#ifdef DW_LANG_Mips_Assembler +#ifdef HAVE_DW_LANG_Mips_Assembler_enumerator case DW_LANG_Mips_Assembler: return translation_unit::LANG_Mips_Assembler; #endif diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 7f773b8d..6ffa046f 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -1113,7 +1113,8 @@ is_c_language(translation_unit::language l) bool is_cplus_plus_language(translation_unit::language l) { - return (l == translation_unit::LANG_C_plus_plus_11 + return (l == translation_unit::LANG_C_plus_plus_03 + || l == translation_unit::LANG_C_plus_plus_11 || l == translation_unit::LANG_C_plus_plus_14 || l == translation_unit::LANG_C_plus_plus); }