Conditionalize the use of DW_LANG_C_plus_plus_03 and DW_LANG_Rust

Older elfutils (pre-0.170) don't define these constants in dwarf.h so
don't use them in that case.

	* include/abg-ir.h (LANG_C_plus_plus_03): Add this new language
	enum to "enum translation_unit::language".
	* src/abg-dwarf-reader.cc (dwarf_language_to_tu_language): Do not
	use DW_LANG_Rust or DW_LANG_C_plus_plus_03 if these are not
	defined.
	(get_default_array_lower_bound): Handle the new
	translation_unit::LANG_C_plus_plus_03 enumerator.

Signed-off-by: Mark Wielaard <mark@klomp.org>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Mark Wielaard 2019-01-17 11:19:02 +01:00 committed by Dodji Seketeli
parent 7caaaa9f3d
commit 2366dca947
2 changed files with 9 additions and 3 deletions

View File

@ -537,6 +537,7 @@ public:
LANG_C99, LANG_C99,
LANG_C11, LANG_C11,
LANG_C, LANG_C,
LANG_C_plus_plus_03,
LANG_C_plus_plus_11, LANG_C_plus_plus_11,
LANG_C_plus_plus_14, LANG_C_plus_plus_14,
LANG_C_plus_plus, LANG_C_plus_plus,

View File

@ -12199,9 +12199,6 @@ dwarf_language_to_tu_language(size_t l)
case DW_LANG_Ada83: case DW_LANG_Ada83:
return translation_unit::LANG_Ada83; return translation_unit::LANG_Ada83;
case DW_LANG_C_plus_plus: case DW_LANG_C_plus_plus:
case DW_LANG_C_plus_plus_03:
case DW_LANG_C_plus_plus_11:
case DW_LANG_C_plus_plus_14:
return translation_unit::LANG_C_plus_plus; return translation_unit::LANG_C_plus_plus;
case DW_LANG_Cobol74: case DW_LANG_Cobol74:
return translation_unit::LANG_Cobol74; return translation_unit::LANG_Cobol74;
@ -12229,7 +12226,9 @@ dwarf_language_to_tu_language(size_t l)
return translation_unit::LANG_ObjC; return translation_unit::LANG_ObjC;
case DW_LANG_ObjC_plus_plus: case DW_LANG_ObjC_plus_plus:
return translation_unit::LANG_ObjC_plus_plus; return translation_unit::LANG_ObjC_plus_plus;
#ifdef DW_LANG_Rust
case DW_LANG_Rust: case DW_LANG_Rust:
#endif
return translation_unit::LANG_Rust; return translation_unit::LANG_Rust;
#ifdef DW_LANG_UPC #ifdef DW_LANG_UPC
case DW_LANG_UPC: case DW_LANG_UPC:
@ -12251,6 +12250,11 @@ dwarf_language_to_tu_language(size_t l)
return translation_unit::LANG_Go; return translation_unit::LANG_Go;
#endif #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 #ifdef DW_LANG_C_plus_plus_11
case DW_LANG_C_plus_plus_11: case DW_LANG_C_plus_plus_11:
return translation_unit::LANG_C_plus_plus_11; return translation_unit::LANG_C_plus_plus_11;
@ -12300,6 +12304,7 @@ get_default_array_lower_bound(translation_unit::language l)
case translation_unit::LANG_C99: case translation_unit::LANG_C99:
case translation_unit::LANG_C11: case translation_unit::LANG_C11:
case translation_unit::LANG_C: 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_11:
case translation_unit::LANG_C_plus_plus_14: case translation_unit::LANG_C_plus_plus_14:
case translation_unit::LANG_C_plus_plus: case translation_unit::LANG_C_plus_plus: