Hello,
DWARF 5 introduced new language enumerators. Libabigail needs to
recognize some of them, especially those related to C, C++, and Ada.
But while looking into it, I thought I'd made it recognize more than
just those languages, to prepare for the future.
* configure.ac: Detect the presence of DW_LANG_* language
enumerators that were not supported before and for new ones that
got introduced in DWARF 5.
* include/abg-ir.h (translation_unit::LANG_{C17, C23,
C_plus_plus_17, C_plus_plus_20, C_plus_plus_23, OCaml, D, Go,
Rust, Zig, Metal, Fortran18, Fortran23, Ada2005, Ada2012, Kotlin,
C_sharp, Ruby, Assembly, Crystal, HIP, Mojo, GLSL, GLSL_ES, HLSL,
OpenCL_CPP, CPP_for_OpenCL, SYCL, Odin, P4, Move, Hylo}): Add new
languages enumerators.
* src/abg-dwarf-reader.cc (dwarf_language_to_tu_language)
(get_default_array_lower_bound): Recognize & support the new
languages enumerators above.
* src/abg-ir.cc (translation_unit_language_to_string): Likewise.
(is_c_language): Recognize translation_unit::LANG_C{17,23}.
(is_cplus_plus_language): Recognize
translation_unit::LANG_C_plus_plus_{20,23}.
(is_ada_language): Recognize
translation_unit::LANG_Ada{95,2005,2012}.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to the mainline.
---
configure.ac | 321 ++++++++++++++++++++++++++++++++++++++++
include/abg-ir.h | 39 ++++-
src/abg-dwarf-reader.cc | 252 +++++++++++++++++++++++--------
src/abg-ir.cc | 150 +++++++++++++++++--
4 files changed, 684 insertions(+), 78 deletions(-)
@@ -1177,6 +1177,327 @@ if test x$HAS_DW_LANG_Rust = xyes; then
[Define to 1 if dwarf.h has the DW_LANG_Rust enumerator])
fi
+HAS_DW_LANG_OCaml=no
+AC_CHECK_DECL([DW_LANG_OCaml],
+ [HAS_DW_LANG_OCaml=yes],
+ [HAS_DW_LANG_OCaml=no],
+ [[#include <dwarf.h>]])
+
+if test x$HAS_DW_LANG_OCaml = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_OCaml_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_OCaml enumerator])
+fi
+
+HAS_DW_LANG_Kotlin=no
+AC_CHECK_DECL([DW_LANG_Kotlin],
+ [HAS_DW_LANG_Kotlin=yes],
+ [HAS_DW_LANG_Kotlin=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Kotlin = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Kotlin_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Kotlin enumerator])
+fi
+
+HAS_DW_LANG_Zig=no
+AC_CHECK_DECL([DW_LANG_Zig],
+ [HAS_DW_LANG_Zig=yes],
+ [HAS_DW_LANG_Zig=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Zig = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Zig_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Zig enumerator])
+fi
+
+HAS_DW_LANG_Crystal=no
+AC_CHECK_DECL([DW_LANG_Crystal],
+ [HAS_DW_LANG_Crystal=yes],
+ [HAS_DW_LANG_Crystal=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Crystal = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Crystal_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Crystal enumerator])
+fi
+
+HAS_DW_LANG_C_plus_plus_17=no
+AC_CHECK_DECL([DW_LANG_C_plus_plus_17],
+ [HAS_DW_LANG_C_plus_plus_17=yes],
+ [HAS_DW_LANG_C_plus_plus_17=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_C_plus_plus_17 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_C_plus_plus_17_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_17 enumerator])
+fi
+
+HAS_DW_LANG_C_plus_plus_20=no
+AC_CHECK_DECL([DW_LANG_C_plus_plus_20],
+ [HAS_DW_LANG_C_plus_plus_20=yes],
+ [HAS_DW_LANG_C_plus_plus_20=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_C_plus_plus_20 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_C_plus_plus_20_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_20 enumerator])
+fi
+
+HAS_DW_LANG_C17=no
+AC_CHECK_DECL([DW_LANG_C17],
+ [HAS_DW_LANG_C17=yes],
+ [HAS_DW_LANG_C17=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_C17 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_C17_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_C17 enumerator])
+fi
+
+HAS_DW_LANG_Fortran18=no
+AC_CHECK_DECL([DW_LANG_Fortran18],
+ [HAS_DW_LANG_Fortran18=yes],
+ [HAS_DW_LANG_Fortran18=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Fortran18 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Fortran18_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Fortran18 enumerator])
+fi
+
+HAS_DW_LANG_Ada2005=no
+AC_CHECK_DECL([DW_LANG_Ada2005],
+ [HAS_DW_LANG_Ada2005=yes],
+ [HAS_DW_LANG_Ada2005=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Ada2005 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Ada2005_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Ada2005 enumerator])
+fi
+
+HAS_DW_LANG_Ada2012=no
+AC_CHECK_DECL([DW_LANG_Ada2012],
+ [HAS_DW_LANG_Ada2012=yes],
+ [HAS_DW_LANG_Ada2012=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Ada2012 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Ada2012_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Ada2012 enumerator])
+fi
+
+HAS_DW_LANG_HIP=no
+AC_CHECK_DECL([DW_LANG_HIP],
+ [HAS_DW_LANG_HIP=yes],
+ [HAS_DW_LANG_HIP=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_HIP = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_HIP_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_HIP enumerator])
+fi
+
+HAS_DW_LANG_Assembly=no
+AC_CHECK_DECL([DW_LANG_Assembly],
+ [HAS_DW_LANG_Assembly=yes],
+ [HAS_DW_LANG_Assembly=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Assembly = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Assembly_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Assembly enumerator])
+fi
+
+HAS_DW_LANG_C_sharp=no
+AC_CHECK_DECL([DW_LANG_C_sharp],
+ [HAS_DW_LANG_C_sharp=yes],
+ [HAS_DW_LANG_C_sharp=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_C_sharp = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_C_sharp_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_C_sharp enumerator])
+fi
+
+HAS_DW_LANG_Mojo=no
+AC_CHECK_DECL([DW_LANG_Mojo],
+ [HAS_DW_LANG_Mojo=yes],
+ [HAS_DW_LANG_Mojo=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Mojo = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Mojo_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Mojo enumerator])
+fi
+
+HAS_DW_LANG_GLSL=no
+AC_CHECK_DECL([DW_LANG_GLSL],
+ [HAS_DW_LANG_GLSL=yes],
+ [HAS_DW_LANG_GLSL=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_GLSL = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_GLSL_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_GLSL enumerator])
+fi
+
+HAS_DW_LANG_GLSL_ES=no
+AC_CHECK_DECL([DW_LANG_GLSL_ES],
+ [HAS_DW_LANG_GLSL_ES=yes],
+ [HAS_DW_LANG_GLSL_ES=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_GLSL_ES = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_GLSL_ES_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_GLSL_ES enumerator])
+fi
+
+HAS_DW_LANG_HLSL=no
+AC_CHECK_DECL([DW_LANG_HLSL],
+ [HAS_DW_LANG_HLSL=yes],
+ [HAS_DW_LANG_HLSL=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_HLSL = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_HLSL_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_HLSL enumerator])
+fi
+
+HAS_DW_LANG_OpenCL_CPP=no
+AC_CHECK_DECL([DW_LANG_OpenCL_CPP],
+ [HAS_DW_LANG_OpenCL_CPP=yes],
+ [HAS_DW_LANG_OpenCL_CPP=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_OpenCL_CPP = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_OpenCL_CPP_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_OpenCL_CPP enumerator])
+fi
+
+HAS_DW_LANG_CPP_for_OpenCL=no
+AC_CHECK_DECL([DW_LANG_CPP_for_OpenCL],
+ [HAS_DW_LANG_CPP_for_OpenCL=yes],
+ [HAS_DW_LANG_CPP_for_OpenCL=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_CPP_for_OpenCL = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_CPP_for_OpenCL_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_CPP_for_OpenCL enumerator])
+fi
+
+HAS_DW_LANG_SYCL=no
+AC_CHECK_DECL([DW_LANG_SYCL],
+ [HAS_DW_LANG_SYCL=yes],
+ [HAS_DW_LANG_SYCL=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_SYCL = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_SYCL_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_SYCL enumerator])
+fi
+
+HAS_DW_LANG_C_plus_plus_23=no
+AC_CHECK_DECL([DW_LANG_C_plus_plus_23],
+ [HAS_DW_LANG_C_plus_plus_23=yes],
+ [HAS_DW_LANG_C_plus_plus_23=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_C_plus_plus_23 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_C_plus_plus_23_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_C_plus_plus_23 enumerator])
+fi
+
+HAS_DW_LANG_Odin=no
+AC_CHECK_DECL([DW_LANG_Odin],
+ [HAS_DW_LANG_Odin=yes],
+ [HAS_DW_LANG_Odin=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Odin = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Odin_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Odin enumerator])
+fi
+
+HAS_DW_LANG_P4=no
+AC_CHECK_DECL([DW_LANG_P4],
+ [HAS_DW_LANG_P4=yes],
+ [HAS_DW_LANG_P4=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_P4 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_P4_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_P4 enumerator])
+fi
+
+HAS_DW_LANG_Metal=no
+AC_CHECK_DECL([DW_LANG_Metal],
+ [HAS_DW_LANG_Metal=yes],
+ [HAS_DW_LANG_Metal=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Metal = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Metal_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Metal enumerator])
+fi
+
+HAS_DW_LANG_C23=no
+AC_CHECK_DECL([DW_LANG_C23],
+ [HAS_DW_LANG_C23=yes],
+ [HAS_DW_LANG_C23=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_C23 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_C23_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_C23 enumerator])
+fi
+
+HAS_DW_LANG_Fortran23=no
+AC_CHECK_DECL([DW_LANG_Fortran23],
+ [HAS_DW_LANG_Fortran23=yes],
+ [HAS_DW_LANG_Fortran23=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Fortran23 = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Fortran23_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Fortran23 enumerator])
+fi
+
+HAS_DW_LANG_Ruby=no
+AC_CHECK_DECL([DW_LANG_Ruby],
+ [HAS_DW_LANG_Ruby=yes],
+ [HAS_DW_LANG_Ruby=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Ruby = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Ruby_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Ruby enumerator])
+fi
+
+HAS_DW_LANG_Move=no
+AC_CHECK_DECL([DW_LANG_Move],
+ [HAS_DW_LANG_Move=yes],
+ [HAS_DW_LANG_Move=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Move = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Move_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Move enumerator])
+fi
+
+HAS_DW_LANG_Hylo=no
+AC_CHECK_DECL([DW_LANG_Hylo],
+ [HAS_DW_LANG_Hylo=yes],
+ [HAS_DW_LANG_Hylo=no],
+ [[#include <dwarf.h>]])
+if test x$HAS_DW_LANG_Hylo = xyes; then
+ AC_DEFINE([HAVE_DW_LANG_Hylo_enumerator],
+ 1,
+ [Define to 1 if dwarf.h has the DW_LANG_Hylo enumerator])
+
+fi
+
HAS_DW_FORM_strx1=no
HAS_DW_FORM_strx2=no
HAS_DW_FORM_strx3=no
@@ -712,28 +712,57 @@ public:
LANG_C89,
LANG_C99,
LANG_C11,
+ LANG_C17,
+ LANG_C23,
LANG_C,
LANG_C_plus_plus_03,
LANG_C_plus_plus_11,
LANG_C_plus_plus_14,
+ LANG_C_plus_plus_17,
+ LANG_C_plus_plus_20,
+ LANG_C_plus_plus_23,
LANG_C_plus_plus,
LANG_ObjC,
LANG_ObjC_plus_plus,
+ LANG_OCaml,
+ LANG_D,
+ LANG_Go,
+ LANG_Rust,
+ LANG_Zig,
+ LANG_Metal,
LANG_Fortran77,
LANG_Fortran90,
LANG_Fortran95,
+ LANG_Fortran18,
+ LANG_Fortran23,
LANG_Ada83,
LANG_Ada95,
+ LANG_Ada2005,
+ LANG_Ada2012,
LANG_Pascal83,
LANG_Modula2,
LANG_Java,
+ LANG_Kotlin,
+ LANG_C_sharp,
+ LANG_Python,
+ LANG_Ruby,
LANG_PLI,
LANG_UPC,
- LANG_D,
- LANG_Python,
- LANG_Go,
- LANG_Rust,
- LANG_Mips_Assembler
+ LANG_Mips_Assembler,
+ LANG_Assembly,
+ LANG_Crystal,
+ LANG_HIP,
+ LANG_Mojo,
+ LANG_GLSL,
+ LANG_GLSL_ES,
+ LANG_HLSL,
+ LANG_OpenCL_CPP,
+ LANG_CPP_for_OpenCL,
+ LANG_SYCL,
+ LANG_Odin,
+ LANG_P4,
+ LANG_Move,
+ LANG_Hylo
};
public:
@@ -13321,12 +13321,88 @@ dwarf_language_to_tu_language(size_t l)
{
case DW_LANG_C89:
return translation_unit::LANG_C89;
+ case DW_LANG_C99:
+ return translation_unit::LANG_C99;
+#ifdef HAVE_DW_LANG_C11_enumerator
+ case DW_LANG_C11:
+ return translation_unit::LANG_C11;
+#endif
+#ifdef HAVE_DW_LANG_C17
+ case DW_LANG_C17:
+ return translation_unit::LANG_C17;
+#endif
+#ifdef HAVE_DW_LANG_C23
+ case DW_LANG_C23:
+ return translation_unit::LANG_C23;
+#endif
case DW_LANG_C:
return translation_unit::LANG_C;
- case DW_LANG_Ada83:
- return translation_unit::LANG_Ada83;
+#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 HAVE_DW_LANG_C_plus_plus_17
+ case DW_LANG_C_plus_plus_17:
+ return translation_unit::LANG_C_plus_plus_17;
+#endif
+
+#ifdef HAVE_DW_LANG_C_plus_plus_20
+ case DW_LANG_C_plus_plus_20:
+ return translation_unit::LANG_C_plus_plus_20;
+#endif
+#ifdef HAVE_DW_LANG_C_plus_plus_23
+ case DW_LANG_C_plus_plus_23:
+ return translation_unit::LANG_C_plus_plus_23;
+#endif
case DW_LANG_C_plus_plus:
return translation_unit::LANG_C_plus_plus;
+#ifdef HAVE_DW_LANG_D_enumerator
+ case DW_LANG_D:
+ return translation_unit::LANG_D;
+#endif
+#ifdef HAVE_DW_LANG_OCaml_enumerator
+ case DW_LANG_OCaml:
+ return translation_unit::LANG_OCaml;
+#endif
+#ifdef HAVE_DW_LANG_Go_enumerator
+ case DW_LANG_Go:
+ return translation_unit::LANG_Go;
+#endif
+#ifdef HAVE_DW_LANG_Rust_enumerator
+ case DW_LANG_Rust:
+ return translation_unit::LANG_Rust;
+#endif
+#ifdef HAVE_DW_LANG_Zig
+ case DW_LANG_Zig:
+ return translation_unit::LANG_Zig;
+#endif
+#ifdef HAVE_DW_LANG_Metal
+ case DW_LANG_Metal:
+ return translation_unit::LANG_Metal;
+#endif
+ case DW_LANG_Ada83:
+ return translation_unit::LANG_Ada83;
+ case DW_LANG_Ada95:
+ return translation_unit::LANG_Ada95;
+#ifdef HAVE_DW_LANG_Ada2005
+ case DW_LANG_Ada2005:
+ return translation_unit::LANG_Ada2005;
+#endif
+
+#ifdef HAVE_DW_LANG_Ada2012
+ case DW_LANG_Ada2012:
+ return translation_unit::LANG_Ada2012;
+#endif
case DW_LANG_Cobol74:
return translation_unit::LANG_Cobol74;
case DW_LANG_Cobol85:
@@ -13335,18 +13411,26 @@ dwarf_language_to_tu_language(size_t l)
return translation_unit::LANG_Fortran77;
case DW_LANG_Fortran90:
return translation_unit::LANG_Fortran90;
+ case DW_LANG_Fortran95:
+ return translation_unit::LANG_Fortran95;
+#ifdef HAVE_DW_LANG_Fortran18
+ case DW_LANG_Fortran18:
+ return translation_unit::LANG_Fortran18;
+#endif
+#ifdef HAVE_DW_LANG_Fortran23
+ case DW_LANG_Fortran23:
+ return translation_unit::LANG_Fortran23;
+#endif
case DW_LANG_Pascal83:
return translation_unit::LANG_Pascal83;
case DW_LANG_Modula2:
return translation_unit::LANG_Modula2;
case DW_LANG_Java:
return translation_unit::LANG_Java;
- case DW_LANG_C99:
- return translation_unit::LANG_C99;
- case DW_LANG_Ada95:
- return translation_unit::LANG_Ada95;
- case DW_LANG_Fortran95:
- return translation_unit::LANG_Fortran95;
+#ifdef HAVE_DW_LANG_Kotlin
+ case DW_LANG_Kotlin:
+ return translation_unit::LANG_Kotlin;
+#endif
case DW_LANG_PLI:
return translation_unit::LANG_PLI;
case DW_LANG_ObjC:
@@ -13354,54 +13438,81 @@ dwarf_language_to_tu_language(size_t l)
case DW_LANG_ObjC_plus_plus:
return translation_unit::LANG_ObjC_plus_plus;
-#ifdef HAVE_DW_LANG_Rust_enumerator
- case DW_LANG_Rust:
- return translation_unit::LANG_Rust;
-#endif
-
#ifdef HAVE_DW_LANG_UPC_enumerator
case DW_LANG_UPC:
return translation_unit::LANG_UPC;
#endif
-
-#ifdef HAVE_DW_LANG_D_enumerator
- case DW_LANG_D:
- return translation_unit::LANG_D;
-#endif
-
#ifdef HAVE_DW_LANG_Python_enumerator
case DW_LANG_Python:
return translation_unit::LANG_Python;
#endif
-
-#ifdef HAVE_DW_LANG_Go_enumerator
- case DW_LANG_Go:
- return translation_unit::LANG_Go;
+#ifdef HAVE_DW_LANG_Ruby
+ case DW_LANG_Ruby:
+ return translation_unit::LANG_Ruby;
#endif
-
-#ifdef HAVE_DW_LANG_C11_enumerator
- case DW_LANG_C11:
- return translation_unit::LANG_C11;
+#ifdef HAVE_DW_LANG_Mips_Assembler_enumerator
+ case DW_LANG_Mips_Assembler:
+ return translation_unit::LANG_Mips_Assembler;
#endif
-
-#ifdef HAVE_DW_LANG_C_plus_plus_03_enumerator
- case DW_LANG_C_plus_plus_03:
- return translation_unit::LANG_C_plus_plus_03;
+#ifdef HAVE_DW_LANG_Assembly
+ case DW_LANG_Assembly:
+ return translation_unit::LANG_Assembly;
#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;
+#ifdef HAVE_DW_LANG_Crystal
+ case DW_LANG_Crystal:
+ return translation_unit::LANG_Crystal;
#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;
+#ifdef HAVE_DW_LANG_HIP
+ case DW_LANG_HIP:
+ return translation_unit::LANG_HIP;
#endif
-
-#ifdef HAVE_DW_LANG_Mips_Assembler_enumerator
- case DW_LANG_Mips_Assembler:
- return translation_unit::LANG_Mips_Assembler;
+#ifdef HAVE_DW_LANG_C_sharp
+ case DW_LANG_C_sharp:
+ return translation_unit::LANG_C_sharp;
+#endif
+#ifdef HAVE_DW_LANG_Mojo
+ case DW_LANG_Mojo:
+ return translation_unit::LANG_Mojo;
+#endif
+#ifdef HAVE_DW_LANG_GLSL
+ case DW_LANG_GLSL:
+ return translation_unit::LANG_GLSL;
+#endif
+#ifdef HAVE_DW_LANG_GLSL_ES
+ case DW_LANG_GLSL_ES:
+ return translation_unit::LANG_GLSL_ES;
+#endif
+#ifdef HAVE_DW_LANG_HLSL
+ case DW_LANG_HLSL:
+ return translation_unit::LANG_HLSL;
+#endif
+#ifdef HAVE_DW_LANG_OpenCL_CPP
+ case DW_LANG_OpenCL_CPP:
+ return translation_unit::LANG_OpenCL_CPP;
+#endif
+#ifdef HAVE_DW_LANG_CPP_for_OpenCL
+ case DW_LANG_CPP_for_OpenCL:
+ return translation_unit::LANG_CPP_for_OpenCL;
+#endif
+#ifdef HAVE_DW_LANG_SYCL
+ case DW_LANG_SYCL:
+ return translation_unit::LANG_SYCL;
+#endif
+#ifdef HAVE_DW_LANG_Odin
+ case DW_LANG_Odin:
+ return translation_unit::LANG_Odin;
+#endif
+#ifdef HAVE_DW_LANG_P4
+ case DW_LANG_P4:
+ return translation_unit::LANG_P4;
+#endif
+#ifdef HAVE_DW_LANG_Move
+ case DW_LANG_Move:
+ return translation_unit::LANG_Move;
+#endif
+#ifdef HAVE_DW_LANG_Hylo
+ case DW_LANG_Hylo:
+ return translation_unit::LANG_Hylo;
#endif
default:
@@ -13423,47 +13534,66 @@ get_default_array_lower_bound(translation_unit::language l)
switch (l)
{
case translation_unit::LANG_UNKNOWN:
- value = 0;
- break;
- case translation_unit::LANG_Cobol74:
- case translation_unit::LANG_Cobol85:
- value = 1;
- break;
case translation_unit::LANG_C89:
case translation_unit::LANG_C99:
case translation_unit::LANG_C11:
+ case translation_unit::LANG_C17:
+ case translation_unit::LANG_C23:
case translation_unit::LANG_C:
case translation_unit::LANG_C_plus_plus_03:
case translation_unit::LANG_C_plus_plus_11:
case translation_unit::LANG_C_plus_plus_14:
+ case translation_unit::LANG_C_plus_plus_17:
+ case translation_unit::LANG_C_plus_plus_20:
+ case translation_unit::LANG_C_plus_plus_23:
case translation_unit::LANG_C_plus_plus:
+ case translation_unit::LANG_OCaml:
case translation_unit::LANG_ObjC:
case translation_unit::LANG_ObjC_plus_plus:
+ case translation_unit::LANG_D:
case translation_unit::LANG_Rust:
+ case translation_unit::LANG_Go:
+ case translation_unit::LANG_Zig:
+ case translation_unit::LANG_Metal:
+ case translation_unit::LANG_Java:
+ case translation_unit::LANG_Kotlin:
+ case translation_unit::LANG_Python:
+ case translation_unit::LANG_Ruby:
+ case translation_unit::LANG_UPC:
+ case translation_unit::LANG_Mips_Assembler:
+ case translation_unit::LANG_Assembly:
+ case translation_unit::LANG_Crystal:
+ case translation_unit::LANG_HIP:
+ case translation_unit::LANG_C_sharp:
+ case translation_unit::LANG_Mojo:
+ case translation_unit::LANG_GLSL:
+ case translation_unit::LANG_GLSL_ES:
+ case translation_unit::LANG_HLSL:
+ case translation_unit::LANG_Odin:
+ case translation_unit::LANG_P4:
+ case translation_unit::LANG_OpenCL_CPP:
+ case translation_unit::LANG_CPP_for_OpenCL:
+ case translation_unit::LANG_SYCL:
+ case translation_unit::LANG_Move:
+ case translation_unit::LANG_Hylo:
value = 0;
break;
+ case translation_unit::LANG_Cobol74:
+ case translation_unit::LANG_Cobol85:
case translation_unit::LANG_Fortran77:
case translation_unit::LANG_Fortran90:
case translation_unit::LANG_Fortran95:
+ case translation_unit::LANG_Fortran18:
+ case translation_unit::LANG_Fortran23:
case translation_unit::LANG_Ada83:
case translation_unit::LANG_Ada95:
+ case translation_unit::LANG_Ada2005:
+ case translation_unit::LANG_Ada2012:
case translation_unit::LANG_Pascal83:
case translation_unit::LANG_Modula2:
- value = 1;
- break;
- case translation_unit::LANG_Java:
- value = 0;
- break;
case translation_unit::LANG_PLI:
value = 1;
break;
- case translation_unit::LANG_UPC:
- case translation_unit::LANG_D:
- case translation_unit::LANG_Python:
- case translation_unit::LANG_Go:
- case translation_unit::LANG_Mips_Assembler:
- value = 0;
- break;
}
return value;
@@ -1553,48 +1553,108 @@ translation_unit_language_to_string(translation_unit::language l)
return "LANG_C99";
case translation_unit::LANG_C11:
return "LANG_C11";
+ case translation_unit::LANG_C17:
+ return "LANG_C17";
+ case translation_unit::LANG_C23:
+ return "LANG_C23";
case translation_unit::LANG_C:
return "LANG_C";
+ case translation_unit::LANG_C_plus_plus_03:
+ return "LANG_C_plus_plus_03";
case translation_unit::LANG_C_plus_plus_11:
return "LANG_C_plus_plus_11";
case translation_unit::LANG_C_plus_plus_14:
return "LANG_C_plus_plus_14";
+ case translation_unit::LANG_C_plus_plus_17:
+ return "LANG_C_plus_plus_17";
+ case translation_unit::LANG_C_plus_plus_20:
+ return "LANG_C_plus_plus_20";
+ case translation_unit::LANG_C_plus_plus_23:
+ return "LANG_C_plus_plus_23";
case translation_unit::LANG_C_plus_plus:
return "LANG_C_plus_plus";
+ case translation_unit::LANG_OCaml:
+ return "LANG_OCaml";
+ case translation_unit::LANG_Zig:
+ return "LANG_Zig";
case translation_unit::LANG_ObjC:
return "LANG_ObjC";
case translation_unit::LANG_ObjC_plus_plus:
return "LANG_ObjC_plus_plus";
+ case translation_unit::LANG_D:
+ return "LANG_D";
+ case translation_unit::LANG_Go:
+ return "LANG_Go";
+ case translation_unit::LANG_Rust:
+ return "LANG_Rust";
case translation_unit::LANG_Fortran77:
return "LANG_Fortran77";
case translation_unit::LANG_Fortran90:
return "LANG_Fortran90";
case translation_unit::LANG_Fortran95:
return "LANG_Fortran95";
+ case translation_unit::LANG_Fortran18:
+ return "LANG_Fortran18";
+ case translation_unit::LANG_Fortran23:
+ return "LANG_Fortran23";
case translation_unit::LANG_Ada83:
return "LANG_Ada83";
case translation_unit::LANG_Ada95:
return "LANG_Ada95";
+ case translation_unit::LANG_Ada2005:
+ return "LANG_Ada2005";
+ case translation_unit::LANG_Ada2012:
+ return "LANG_Ada2012";
case translation_unit::LANG_Pascal83:
return "LANG_Pascal83";
case translation_unit::LANG_Modula2:
return "LANG_Modula2";
case translation_unit::LANG_Java:
return "LANG_Java";
+ case translation_unit::LANG_Kotlin:
+ return "LANG_Kotlin";
+ case translation_unit::LANG_C_sharp:
+ return "LANG_C_sharp";
+ case translation_unit::LANG_Python:
+ return "LANG_Python";
+ case translation_unit::LANG_Ruby:
+ return "LANG_Ruby";
case translation_unit::LANG_PLI:
return "LANG_PLI";
case translation_unit::LANG_UPC:
return "LANG_UPC";
- case translation_unit::LANG_D:
- return "LANG_D";
- case translation_unit::LANG_Python:
- return "LANG_Python";
- case translation_unit::LANG_Go:
- return "LANG_Go";
case translation_unit::LANG_Mips_Assembler:
return "LANG_Mips_Assembler";
- default:
- return "LANG_UNKNOWN";
+ case translation_unit::LANG_Assembly:
+ return "LANG_Assembly";
+ case translation_unit::LANG_Crystal:
+ return "LANG_Crystal";
+ case translation_unit::LANG_HIP:
+ return "LANG_HIP";
+ case translation_unit::LANG_Mojo:
+ return "LANG_Mojo";
+ case translation_unit::LANG_GLSL:
+ return "LANG_GLSL";
+ case translation_unit::LANG_GLSL_ES:
+ return "LANG_GLSL_ES";
+ case translation_unit::LANG_HLSL:
+ return "LANG_HLSL";
+ case translation_unit::LANG_OpenCL_CPP:
+ return "LANG_OpenCL_CPP";
+ case translation_unit::LANG_CPP_for_OpenCL:
+ return "LANG_CPP_for_OpenCL";
+ case translation_unit::LANG_SYCL:
+ return "LANG_SYCL";
+ case translation_unit::LANG_Odin:
+ return "LANG_Odin";
+ case translation_unit::LANG_P4:
+ return "LANG_P4";
+ case translation_unit::LANG_Metal:
+ return "LANG_Metal";
+ case translation_unit::LANG_Move:
+ return "LANG_Move";
+ case translation_unit::LANG_Hylo:
+ return "LANG_Hylo";
}
return "LANG_UNKNOWN";
@@ -1619,46 +1679,106 @@ string_to_translation_unit_language(const string& l)
return translation_unit::LANG_C99;
else if (l == "LANG_C11")
return translation_unit::LANG_C11;
+ else if (l == "LANG_C17")
+ return translation_unit::LANG_C17;
+ else if (l == "LANG_C23")
+ return translation_unit::LANG_C23;
else if (l == "LANG_C")
return translation_unit::LANG_C;
+ else if (l == "LANG_C_plus_plus_03")
+ return translation_unit::LANG_C_plus_plus_03;
else if (l == "LANG_C_plus_plus_11")
return translation_unit::LANG_C_plus_plus_11;
else if (l == "LANG_C_plus_plus_14")
return translation_unit::LANG_C_plus_plus_14;
+ else if (l == "LANG_C_plus_plus_17")
+ return translation_unit::LANG_C_plus_plus_17;
+ else if (l == "LANG_C_plus_plus_20")
+ return translation_unit::LANG_C_plus_plus_20;
+ else if (l == "LANG_C_plus_plus_23")
+ return translation_unit::LANG_C_plus_plus_23;
else if (l == "LANG_C_plus_plus")
return translation_unit::LANG_C_plus_plus;
+ else if (l == "LANG_OCaml")
+ return translation_unit::LANG_OCaml;
else if (l == "LANG_ObjC")
return translation_unit::LANG_ObjC;
else if (l == "LANG_ObjC_plus_plus")
return translation_unit::LANG_ObjC_plus_plus;
+ else if (l == "LANG_Zig")
+ return translation_unit::LANG_Zig;
+ else if (l == "LANG_Metal")
+ return translation_unit::LANG_Metal;
else if (l == "LANG_Fortran77")
return translation_unit::LANG_Fortran77;
else if (l == "LANG_Fortran90")
return translation_unit::LANG_Fortran90;
- else if (l == "LANG_Fortran95")
+ else if (l == "LANG_Fortran95")
return translation_unit::LANG_Fortran95;
+ else if (l == "LANG_Fortran18")
+ return translation_unit::LANG_Fortran23;
else if (l == "LANG_Ada83")
return translation_unit::LANG_Ada83;
else if (l == "LANG_Ada95")
return translation_unit::LANG_Ada95;
+ else if (l == "LANG_Ada2005")
+ return translation_unit::LANG_Ada2005;
+ else if (l == "LANG_Ada2012")
+ return translation_unit::LANG_Ada2012;
else if (l == "LANG_Pascal83")
return translation_unit::LANG_Pascal83;
else if (l == "LANG_Modula2")
return translation_unit::LANG_Modula2;
else if (l == "LANG_Java")
return translation_unit::LANG_Java;
+ else if (l == "LANG_Kotlin")
+ return translation_unit::LANG_Kotlin;
else if (l == "LANG_PLI")
return translation_unit::LANG_PLI;
else if (l == "LANG_UPC")
return translation_unit::LANG_UPC;
else if (l == "LANG_D")
return translation_unit::LANG_D;
- else if (l == "LANG_Python")
- return translation_unit::LANG_Python;
else if (l == "LANG_Go")
return translation_unit::LANG_Go;
+ else if (l == "LANG_Rust")
+ return translation_unit::LANG_Rust;
+ else if (l == "LANG_Python")
+ return translation_unit::LANG_Python;
+ else if (l == "LANG_Ruby")
+ return translation_unit::LANG_Ruby;
else if (l == "LANG_Mips_Assembler")
return translation_unit::LANG_Mips_Assembler;
+ else if (l == "LANG_Assembly")
+ return translation_unit::LANG_Assembly;
+ else if (l == "LANG_Crystal")
+ return translation_unit::LANG_Crystal;
+ else if (l == "LANG_HIP")
+ return translation_unit::LANG_HIP;
+ else if (l == "LANG_C_sharp")
+ return translation_unit::LANG_C_sharp;
+ else if (l == "LANG_Mojo")
+ return translation_unit::LANG_Mojo;
+ else if (l == "LANG_GLSL")
+ return translation_unit::LANG_GLSL;
+ else if (l == "LANG_GLSL_ES")
+ return translation_unit::LANG_GLSL_ES;
+ else if (l == "LANG_HLSL")
+ return translation_unit::LANG_HLSL;
+ else if (l == "LANG_OpenCL_CPP")
+ return translation_unit::LANG_OpenCL_CPP;
+ else if (l == "LANG_CPP_for_OpenCL")
+ return translation_unit::LANG_CPP_for_OpenCL;
+ else if (l == "LANG_SYCL")
+ return translation_unit::LANG_SYCL;
+ else if (l == "LANG_Odin")
+ return translation_unit::LANG_Odin;
+ else if (l == "LANG_P4")
+ return translation_unit::LANG_P4;
+ else if (l == "LANG_Move")
+ return translation_unit::LANG_Move;
+ else if (l == "LANG_Hylo")
+ return translation_unit::LANG_Hylo;
return translation_unit::LANG_UNKNOWN;
}
@@ -1674,6 +1794,8 @@ is_c_language(translation_unit::language l)
return (l == translation_unit::LANG_C89
|| l == translation_unit::LANG_C99
|| l == translation_unit::LANG_C11
+ || l == translation_unit::LANG_C17
+ || l == translation_unit::LANG_C23
|| l == translation_unit::LANG_C);
}
@@ -1688,6 +1810,8 @@ is_cplus_plus_language(translation_unit::language l)
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_20
+ || l == translation_unit::LANG_C_plus_plus_23
|| l == translation_unit::LANG_C_plus_plus);
}
@@ -1709,7 +1833,9 @@ bool
is_ada_language(translation_unit::language l)
{
return (l == translation_unit::LANG_Ada83
- || l == translation_unit::LANG_Ada95);
+ || l == translation_unit::LANG_Ada95
+ || l == translation_unit::LANG_Ada2005
+ || l == translation_unit::LANG_Ada2012);
}
/// A deep comparison operator for pointers to translation units.