#include "dwarf2/read.h"
#include "objfiles.h"
#include "filenames.h"
+#include "producer.h"
#include "gdbsupport/pathstuff.h"
/* Initialize dwarf2_cu to read PER_CU, in the context of PER_OBJFILE. */
per_objfile (per_objfile),
m_mark (false),
has_loclist (false),
- checked_producer (false),
- producer_is_gxx_lt_4_6 (false),
- producer_is_gcc_lt_4_3 (false),
- producer_is_gcc_11 (false),
- producer_is_icc (false),
- producer_is_icc_lt_14 (false),
- producer_is_codewarrior (false),
- producer_is_clang (false),
- producer_is_gas_lt_2_38 (false),
- producer_is_gas_2_39 (false),
- producer_is_gas_ge_2_40 (false),
+ m_checked_producer (false),
+ m_producer_is_gxx_lt_4_6 (false),
+ m_producer_is_gcc_lt_4_5 (false),
+ m_producer_is_gcc_lt_4_3 (false),
+ m_producer_is_gcc_ge_4 (false),
+ m_producer_is_gcc_11 (false),
+ m_producer_is_gcc (false),
+ m_producer_is_icc (false),
+ m_producer_is_icc_lt_14 (false),
+ m_producer_is_codewarrior (false),
+ m_producer_is_clang (false),
+ m_producer_is_gas_lt_2_38 (false),
+ m_producer_is_gas_2_39 (false),
+ m_producer_is_gas_ge_2_40 (false),
+ m_producer_is_realview (false),
+ m_producer_is_xlc (false),
+ m_producer_is_xlc_opencl (false),
+ m_producer_is_gf77 (false),
+ m_producer_is_ggo (false),
processing_has_namespace_info (false)
{
}
const char *debugformat = debugformat_strings[this->header.version - 2];
get_builder ()->record_debugformat (debugformat);
- get_builder ()->record_producer (producer);
+ get_builder ()->record_producer (m_producer);
processing_has_namespace_info = false;
gdb_assert_not_reached ("");
}
+
+/* See dwarf2/cu.h. */
+
+void
+dwarf2_cu::set_producer (const char *producer)
+{
+ gdb_assert (m_producer == nullptr || strcmp (producer, m_producer) == 0);
+ m_producer = producer;
+
+ int major, minor;
+
+ if (m_producer == nullptr)
+ {
+ /* For unknown compilers expect their behavior is DWARF version
+ compliant.
+
+ GCC started to support .debug_types sections by -gdwarf-4 since
+ gcc-4.5.x. As the .debug_types sections are missing DW_AT_producer
+ for their space efficiency GDB cannot workaround gcc-4.5.x -gdwarf-4
+ combination. gcc-4.5.x -gdwarf-4 binaries have DW_AT_accessibility
+ interpreted incorrectly by GDB now - GCC PR debug/48229. */
+ }
+ else if (::producer_is_gcc (m_producer, &major, &minor))
+ {
+ m_producer_is_gxx_lt_4_6 = major < 4 || (major == 4 && minor < 6);
+ m_producer_is_gcc_lt_4_5 = major < 4 || (major == 4 && minor < 5);
+ m_producer_is_gcc_lt_4_3 = major < 4 || (major == 4 && minor < 3);
+ m_producer_is_gcc_ge_4 = major >= 4;
+ m_producer_is_gcc_11 = major == 11;
+ m_producer_is_gcc = true;
+ }
+ else if (::producer_is_icc (m_producer, &major, &minor))
+ {
+ m_producer_is_icc = true;
+ m_producer_is_icc_lt_14 = major < 14;
+ }
+ else if (startswith (m_producer, "CodeWarrior S12/L-ISA"))
+ m_producer_is_codewarrior = true;
+ else if (::producer_is_clang (m_producer, &major, &minor))
+ m_producer_is_clang = true;
+ else if (::producer_is_gas (m_producer, &major, &minor))
+ {
+ m_producer_is_gas_lt_2_38 = major < 2 || (major == 2 && minor < 38);
+ m_producer_is_gas_2_39 = major == 2 && minor == 39;
+ m_producer_is_gas_ge_2_40 = major > 2 || (major == 2 && minor >= 40);
+ }
+ else if (::producer_is_realview (m_producer))
+ m_producer_is_realview = true;
+ else if (startswith (m_producer, "IBM(R) XL C/C++ Advanced Edition"))
+ m_producer_is_xlc = true;
+ else if (strstr (m_producer, "IBM XL C for OpenCL") != nullptr)
+ m_producer_is_xlc_opencl = true;
+ else
+ {
+ /* For other non-GCC compilers, expect their behavior is DWARF version
+ compliant. */
+ }
+
+ if (m_producer != nullptr)
+ {
+ if (strstr (m_producer, "GNU F77") != nullptr)
+ m_producer_is_gf77 = true;
+ else if (strstr (m_producer, "GNU Go ") != nullptr)
+ m_producer_is_ggo = true;
+ }
+
+ m_checked_producer = true;
+}
return language_defn->la_language;
}
- const char *producer = nullptr;
+ /* Set the producer string and check various properties of it. */
+ void set_producer (const char *producer);
+
+ /* Check for GCC PR debug/45124 fix which is not present in any G++
+ version up to 4.5.any while it is present already in G++ 4.6.0 -
+ the PR has been fixed during 4.6.0 experimental. */
+ bool producer_is_gxx_lt_4_6 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gxx_lt_4_6;
+ }
+
+ /* Check for GCC < 4.5.x. */
+ bool producer_is_gcc_lt_4_5 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gcc_lt_4_5;
+ }
+
+ /* Codewarrior (at least as of version 5.0.40) generates dwarf line
+ information with incorrect is_stmt attributes. */
+ bool producer_is_codewarrior () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_codewarrior;
+ }
+
+ bool producer_is_gas_lt_2_38 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gas_lt_2_38;
+ }
+
+ bool producer_is_gas_2_39 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gas_2_39;
+ }
+
+ /* Return true if CU is produced by GAS 2.39 or later. */
+ bool producer_is_gas_ge_2_39 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gas_2_39 || m_producer_is_gas_ge_2_40;
+ }
+
+ /* ICC<14 does not output the required DW_AT_declaration on
+ incomplete types, but gives them a size of zero. Starting with
+ version 14, ICC is compatible with GCC. */
+ bool producer_is_icc_lt_14 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_icc_lt_14;
+ }
+
+ /* ICC generates a DW_AT_type for C void functions. This was
+ observed on ICC 14.0.5.212, and appears to be against the DWARF
+ spec (V5 3.3.2) which says that void functions should not have a
+ DW_AT_type. */
+ bool producer_is_icc () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_icc;
+ }
+
+ /* Check for possibly missing DW_AT_comp_dir with relative
+ .debug_line directory paths. GCC SVN r127613 (new option
+ -fdebug-prefix-map) fixed this, it was first present in GCC
+ release 4.3.0. */
+ bool producer_is_gcc_lt_4_3 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gcc_lt_4_3;
+ }
+
+ /* Check for GCC 4 or later. */
+ bool producer_is_gcc_ge_4 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gcc_ge_4;
+ }
+
+ /* Check for GCC 11 exactly. */
+ bool producer_is_gcc_11 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gcc_11;
+ }
+
+ /* Check for any version of GCC. */
+ bool producer_is_gcc () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gcc;
+ }
+
+ /* Return true if the producer of the inferior is clang. */
+ bool producer_is_clang () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_clang;
+ }
+
+ /* Return true if the producer is RealView. */
+ bool producer_is_realview () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_realview;
+ }
+
+ /* Return true if the producer is IBM XLC. */
+ bool producer_is_xlc () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_xlc;
+ }
+
+ /* Return true if the producer is IBM XLC for OpenCL. */
+ bool producer_is_xlc_opencl () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_xlc_opencl;
+ }
+
+ /* Return true if the producer is GNU F77. */
+ bool producer_is_gf77 () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_gf77;
+ }
+
+ /* Return true if the producer is GNU Go. */
+ bool producer_is_ggo () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer_is_ggo;
+ }
+
+ /* Return the producer. In general this should not be used and
+ instead new checks should be added to set_producer. */
+ const char *get_producer () const
+ {
+ gdb_assert (m_checked_producer);
+ return m_producer;
+ }
private:
+ const char *m_producer = nullptr;
+
/* The symtab builder for this CU. This is only non-NULL when full
symbols are being read. */
buildsym_compunit_up m_builder;
if all the producer_is_* fields are valid. This information is cached
because profiling CU expansion showed excessive time spent in
producer_is_gxx_lt_4_6. */
- bool checked_producer : 1;
- bool producer_is_gxx_lt_4_6 : 1;
- bool producer_is_gcc_lt_4_3 : 1;
- bool producer_is_gcc_11 : 1;
- bool producer_is_icc : 1;
- bool producer_is_icc_lt_14 : 1;
- bool producer_is_codewarrior : 1;
- bool producer_is_clang : 1;
- bool producer_is_gas_lt_2_38 : 1;
- bool producer_is_gas_2_39 : 1;
- bool producer_is_gas_ge_2_40 : 1;
+ bool m_checked_producer : 1;
+ bool m_producer_is_gxx_lt_4_6 : 1;
+ bool m_producer_is_gcc_lt_4_5 : 1;
+ bool m_producer_is_gcc_lt_4_3 : 1;
+ bool m_producer_is_gcc_ge_4 : 1;
+ bool m_producer_is_gcc_11 : 1;
+ bool m_producer_is_gcc : 1;
+ bool m_producer_is_icc : 1;
+ bool m_producer_is_icc_lt_14 : 1;
+ bool m_producer_is_codewarrior : 1;
+ bool m_producer_is_clang : 1;
+ bool m_producer_is_gas_lt_2_38 : 1;
+ bool m_producer_is_gas_2_39 : 1;
+ bool m_producer_is_gas_ge_2_40 : 1;
+ bool m_producer_is_realview : 1;
+ bool m_producer_is_xlc : 1;
+ bool m_producer_is_xlc_opencl : 1;
+ bool m_producer_is_gf77 : 1;
+ bool m_producer_is_ggo : 1;
/* When true, the file that we're processing is known to have
debugging info for C++ namespaces. GCC 3.3.x did not produce
static int dwarf2_loclist_block_index;
static int ada_block_index;
-static bool producer_is_gas_lt_2_38 (struct dwarf2_cu *cu);
-static bool producer_is_gas_ge_2_39 (struct dwarf2_cu *cu);
-
/* Size of .debug_loclists section header for 32-bit DWARF format. */
#define LOCLIST_HEADER_SIZE32 12
static void process_cu_includes (dwarf2_per_objfile *per_objfile);
-static void check_producer (struct dwarf2_cu *cu);
\f
/* Various complaints about symbol reading that don't abort the process. */
if (cust != NULL)
{
- int gcc_4_minor = producer_is_gcc_ge_4 (cu->producer);
-
/* Set symtab language to language from DW_AT_language. If the
compilation is from a C file generated by language preprocessors, do
not set the language if it was already deduced by start_subfile. */
Still one can confuse GDB by using non-standard GCC compilation
options - this waits on GCC PR other/32998 (-frecord-gcc-switches).
*/
- if (cu->has_loclist && gcc_4_minor >= 5)
+ /* Note that this code traditionally did not accept non-GCC
+ compilers; that is preserved but seems potentially wrong. */
+ if (cu->has_loclist && cu->producer_is_gcc ()
+ && !cu->producer_is_gcc_lt_4_5 ())
cust->set_locations_valid (true);
- int major, minor;
- if (cu->producer != nullptr
- && producer_is_gcc (cu->producer, &major, &minor)
- && (major < 4 || (major == 4 && minor < 5)))
+ if (cu->producer_is_gcc_lt_4_5 ())
/* Don't trust gcc < 4.5.x. */
cust->set_epilogue_unwind_valid (false);
else
&objfile->objfile_obstack);
}
-/* ICC<14 does not output the required DW_AT_declaration on incomplete
- types, but gives them a size of zero. Starting with version 14,
- ICC is compatible with GCC. */
-
-static bool
-producer_is_icc_lt_14 (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_icc_lt_14;
-}
-
-/* ICC generates a DW_AT_type for C void functions. This was observed on
- ICC 14.0.5.212, and appears to be against the DWARF spec (V5 3.3.2)
- which says that void functions should not have a DW_AT_type. */
-
-static bool
-producer_is_icc (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_icc;
-}
-
-/* Check for possibly missing DW_AT_comp_dir with relative .debug_line
- directory paths. GCC SVN r127613 (new option -fdebug-prefix-map) fixed
- this, it was first present in GCC release 4.3.0. */
-
-static bool
-producer_is_gcc_lt_4_3 (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_gcc_lt_4_3;
-}
-
-/* See dwarf2/read.h. */
-bool
-producer_is_clang (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_clang;
-}
-
static file_and_directory &
find_file_and_directory (struct die_info *die, struct dwarf2_cu *cu)
{
dwarf2_string_attr (die, DW_AT_comp_dir, cu));
if (res.get_comp_dir () == nullptr
- && producer_is_gcc_lt_4_3 (cu)
+ && cu->producer_is_gcc_lt_4_3 ()
&& res.get_name () != nullptr
&& IS_ABSOLUTE_PATH (res.get_name ()))
{
implicitly prefixing it with the compilation dir. Work around this by
prefixing it with the source dir instead. */
if (cu->header.version == 5 && !IS_ABSOLUTE_PATH (fnd.get_name ())
- && producer_is_gas_lt_2_38 (cu))
+ && cu->producer_is_gas_lt_2_38 ())
{
attr = dwarf2_attr (die, DW_AT_stmt_list, cu);
if (attr != nullptr && attr->form_is_unsigned ())
struct gdbarch *gdbarch = objfile->arch ();
if (gdbarch_bfd_arch_info (gdbarch)->arch == bfd_arch_arm
- && producer_is_gas_ge_2_39 (cu))
+ && cu->producer_is_gas_ge_2_39 ())
{
/* Gas version 2.39 produces DWARF for a Thumb subprogram with a low_pc
attribute with the thumb bit set (PR gas/31115). Work around this. */
dwarf2_record_block_entry_pc (die, block, cu);
}
-/* Check whether the producer field indicates either of GCC < 4.6, or the
- Intel C/C++ compiler, and cache the result in CU. */
-
-static void
-check_producer (struct dwarf2_cu *cu)
-{
- int major, minor;
-
- if (cu->producer == NULL)
- {
- /* For unknown compilers expect their behavior is DWARF version
- compliant.
-
- GCC started to support .debug_types sections by -gdwarf-4 since
- gcc-4.5.x. As the .debug_types sections are missing DW_AT_producer
- for their space efficiency GDB cannot workaround gcc-4.5.x -gdwarf-4
- combination. gcc-4.5.x -gdwarf-4 binaries have DW_AT_accessibility
- interpreted incorrectly by GDB now - GCC PR debug/48229. */
- }
- else if (producer_is_gcc (cu->producer, &major, &minor))
- {
- cu->producer_is_gxx_lt_4_6 = major < 4 || (major == 4 && minor < 6);
- cu->producer_is_gcc_lt_4_3 = major < 4 || (major == 4 && minor < 3);
- cu->producer_is_gcc_11 = major == 11;
- }
- else if (producer_is_icc (cu->producer, &major, &minor))
- {
- cu->producer_is_icc = true;
- cu->producer_is_icc_lt_14 = major < 14;
- }
- else if (startswith (cu->producer, "CodeWarrior S12/L-ISA"))
- cu->producer_is_codewarrior = true;
- else if (producer_is_clang (cu->producer, &major, &minor))
- cu->producer_is_clang = true;
- else if (producer_is_gas (cu->producer, &major, &minor))
- {
- cu->producer_is_gas_lt_2_38 = major < 2 || (major == 2 && minor < 38);
- cu->producer_is_gas_2_39 = major == 2 && minor == 39;
- cu->producer_is_gas_ge_2_40 = major > 2 || (major == 2 && minor >= 40);
- }
- else
- {
- /* For other non-GCC compilers, expect their behavior is DWARF version
- compliant. */
- }
-
- cu->checked_producer = true;
-}
-
-/* Check for GCC PR debug/45124 fix which is not present in any G++ version up
- to 4.5.any while it is present already in G++ 4.6.0 - the PR has been fixed
- during 4.6.0 experimental. */
-
-static bool
-producer_is_gxx_lt_4_6 (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_gxx_lt_4_6;
-}
-
-
-/* Codewarrior (at least as of version 5.0.40) generates dwarf line information
- with incorrect is_stmt attributes. */
-
-static bool
-producer_is_codewarrior (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_codewarrior;
-}
-
-static bool
-producer_is_gas_lt_2_38 (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_gas_lt_2_38;
-}
-
-static bool
-producer_is_gas_2_39 (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_gas_2_39;
-}
-
-/* Return true if CU is produced by GAS 2.39 or later. */
-
-static bool
-producer_is_gas_ge_2_39 (struct dwarf2_cu *cu)
-{
- if (!cu->checked_producer)
- check_producer (cu);
-
- return cu->producer_is_gas_2_39 || cu->producer_is_gas_ge_2_40;
-}
-
/* Return the accessibility of DIE, as given by DW_AT_accessibility.
If that attribute is not available, return the appropriate
default. */
plongest (value));
}
- if (cu->header.version < 3 || producer_is_gxx_lt_4_6 (cu))
+ if (cu->header.version < 3 || cu->producer_is_gxx_lt_4_6 ())
{
/* The default DWARF 2 accessibility for members is public, the default
accessibility for inheritance is private. */
Negative DW_AT_data_member_location
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101378
*/
- if (offset == -1 && cu->producer_is_gcc_11)
+ if (offset == -1 && cu->producer_is_gcc_11 ())
{
complaint (_("DW_AT_data_member_location value of -1, assuming 0"));
offset = 0;
maybe_set_alignment (cu, die, type);
- if (producer_is_icc_lt_14 (cu) && (type->length () == 0))
+ if (cu->producer_is_icc_lt_14 () && type->length () == 0)
{
/* ICC<14 does not output the required DW_AT_declaration on
incomplete types, but gives them a size of zero. */
if (die_is_declaration (die, cu))
type->set_is_stub (true);
else if (attr == NULL && die->child == NULL
- && producer_is_realview (cu->producer))
+ && cu->producer_is_realview ())
/* RealView does not output the required DW_AT_declaration
on incomplete types. */
type->set_is_stub (true);
set_type_vptr_fieldno (type, TYPE_VPTR_FIELDNO (t));
}
}
- else if (cu->producer
- && startswith (cu->producer, "IBM(R) XL C/C++ Advanced Edition"))
+ else if (cu->producer_is_xlc ())
{
/* The IBM XLC compiler does not provide direct indication
of the containing type, but the vtable pointer is
FIXME: dsl/2004-8-20: If G77 is ever fixed, this will also need
version checking. */
- if (cu->lang () == language_fortran
- && cu->producer && strstr (cu->producer, "GNU F77"))
+ if (cu->lang () == language_fortran && cu->producer_is_gf77 ())
{
return DW_ORD_row_major;
}
prototyped and unprototyped functions; default to prototyped,
since that is more common in modern code (and RealView warns
about unprototyped functions). */
- if (producer_is_realview (cu->producer))
+ if (cu->producer_is_realview ())
return 1;
return 0;
&& !type->is_stub ()
&& die->child == nullptr
&& (cu->per_cu->version () == 2
- || producer_is_gas_2_39 (cu)))
+ || cu->producer_is_gas_2_39 ()))
{
/* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type
return type. */
&& is_valid_DW_AT_calling_convention_for_subroutine (attr->constant_value (0)))
TYPE_CALLING_CONVENTION (ftype)
= (enum dwarf_calling_convention) attr->constant_value (0);
- else if (cu->producer && strstr (cu->producer, "IBM XL C for OpenCL"))
+ else if (cu->producer_is_xlc_opencl ())
TYPE_CALLING_CONVENTION (ftype) = DW_CC_GDB_IBM_OpenCL;
else
TYPE_CALLING_CONVENTION (ftype) = DW_CC_normal;
struct gdbarch *gdbarch = objfile->arch ();
struct type *target_type = die_type (die, cu);
- if (gdbarch_dwarf2_omit_typedef_p (gdbarch, target_type, cu->producer, name))
+ if (gdbarch_dwarf2_omit_typedef_p (gdbarch, target_type,
+ cu->get_producer (), name))
{
/* The long double is defined as a base type in C. GCC creates a long
double typedef with target-type _Float128 for the long double to
/* Versions of Intel's C Compiler generate an integer type called "void"
instead of using DW_TAG_unspecified_type. This has been seen on
at least versions 14, 17, and 18. */
- if (bits == 0 && producer_is_icc (cu) && name != nullptr
+ if (bits == 0 && cu->producer_is_icc () && name != nullptr
&& strcmp (name, "void") == 0)
type = builtin_type (objfile)->builtin_void;
else
if (!end_sequence && !ignore_this_line)
{
linetable_entry_flags lte_flags = m_flags;
- if (producer_is_codewarrior (m_cu))
+ if (m_cu->producer_is_codewarrior ())
lte_flags |= LEF_IS_STMT;
if (dwarf_record_line_p (m_cu, m_line, m_last_line,
if (comp_unit_die == nullptr)
{
+ cu->set_producer (nullptr);
cu->language_defn = language_def (pretend_language);
cu->per_cu->set_unit_type (DW_UT_compile);
cu->per_cu->set_lang (pretend_language, (dwarf_source_language) 0);
return;
}
- cu->producer = dwarf2_string_attr (comp_unit_die, DW_AT_producer, cu);
- /* Re-check if needed. */
- cu->checked_producer = false;
+ cu->set_producer (dwarf2_string_attr (comp_unit_die, DW_AT_producer, cu));
/* Set the language we're debugging. */
attr = dwarf2_attr (comp_unit_die, DW_AT_language, cu);
enum language lang;
dwarf_source_language dw_lang = (dwarf_source_language) 0;
- if (cu->producer != nullptr
- && strstr (cu->producer, "IBM XL C for OpenCL") != NULL)
+ if (cu->producer_is_xlc_opencl ())
{
/* The XLCL doesn't generate DW_LANG_OpenCL because this
attribute is not standardised yet. As a workaround for the
lang = language_opencl;
dw_lang = DW_LANG_OpenCL;
}
- else if (cu->producer != nullptr
- && strstr (cu->producer, "GNU Go ") != NULL)
+ else if (cu->producer_is_ggo ())
{
/* Similar hack for Go. */
lang = language_go;
/* Initialize the lto_artificial field. */
attr = dwarf2_attr (comp_unit_die, DW_AT_name, cu);
if (attr != nullptr
- && cu->producer != nullptr
+ && cu->producer_is_gcc ()
&& attr->as_string () != nullptr
- && strcmp (attr->as_string (), "<artificial>") == 0
- && producer_is_gcc (cu->producer, nullptr, nullptr))
+ && strcmp (attr->as_string (), "<artificial>") == 0)
cu->per_cu->lto_artificial = true;
switch (comp_unit_die->tag)