Bug Summary

File:build/gcc/dwarf2out.c
Warning:line 12098, column 16
Value stored to 'elabel' during its initialization is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name dwarf2out.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/13.0.0 -D IN_GCC -D HAVE_CONFIG_H -I . -I . -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/. -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../include/c++/11 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../include/c++/11/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../include/c++/11/backward -internal-isystem /usr/lib64/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-error=format-diag -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir=/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2021-11-20-133755-20252-1/report-cX01Y5.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c
1/* Output Dwarf2 format symbol table information from GCC.
2 Copyright (C) 1992-2021 Free Software Foundation, Inc.
3 Contributed by Gary Funck (gary@intrepid.com).
4 Derived from DWARF 1 implementation of Ron Guilmette (rfg@monkeys.com).
5 Extensively modified by Jason Merrill (jason@cygnus.com).
6
7This file is part of GCC.
8
9GCC is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free
11Software Foundation; either version 3, or (at your option) any later
12version.
13
14GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15WARRANTY; without even the implied warranty of MERCHANTABILITY or
16FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17for more details.
18
19You should have received a copy of the GNU General Public License
20along with GCC; see the file COPYING3. If not see
21<http://www.gnu.org/licenses/>. */
22
23/* TODO: Emit .debug_line header even when there are no functions, since
24 the file numbers are used by .debug_info. Alternately, leave
25 out locations for types and decls.
26 Avoid talking about ctors and op= for PODs.
27 Factor out common prologue sequences into multiple CIEs. */
28
29/* The first part of this file deals with the DWARF 2 frame unwind
30 information, which is also used by the GCC efficient exception handling
31 mechanism. The second part, controlled only by an #ifdef
32 DWARF2_DEBUGGING_INFO, deals with the other DWARF 2 debugging
33 information. */
34
35/* DWARF2 Abbreviation Glossary:
36
37 CFA = Canonical Frame Address
38 a fixed address on the stack which identifies a call frame.
39 We define it to be the value of SP just before the call insn.
40 The CFA register and offset, which may change during the course
41 of the function, are used to calculate its value at runtime.
42
43 CFI = Call Frame Instruction
44 an instruction for the DWARF2 abstract machine
45
46 CIE = Common Information Entry
47 information describing information common to one or more FDEs
48
49 DIE = Debugging Information Entry
50
51 FDE = Frame Description Entry
52 information describing the stack call frame, in particular,
53 how to restore registers
54
55 DW_CFA_... = DWARF2 CFA call frame instruction
56 DW_TAG_... = DWARF2 DIE tag */
57
58#include "config.h"
59#include "system.h"
60#include "coretypes.h"
61#include "target.h"
62#include "function.h"
63#include "rtl.h"
64#include "tree.h"
65#include "memmodel.h"
66#include "tm_p.h"
67#include "stringpool.h"
68#include "insn-config.h"
69#include "ira.h"
70#include "cgraph.h"
71#include "diagnostic.h"
72#include "fold-const.h"
73#include "stor-layout.h"
74#include "varasm.h"
75#include "version.h"
76#include "flags.h"
77#include "rtlhash.h"
78#include "reload.h"
79#include "output.h"
80#include "expr.h"
81#include "dwarf2out.h"
82#include "dwarf2ctf.h"
83#include "dwarf2asm.h"
84#include "toplev.h"
85#include "md5.h"
86#include "tree-pretty-print.h"
87#include "print-rtl.h"
88#include "debug.h"
89#include "common/common-target.h"
90#include "langhooks.h"
91#include "lra.h"
92#include "dumpfile.h"
93#include "opts.h"
94#include "tree-dfa.h"
95#include "gdb/gdb-index.h"
96#include "rtl-iter.h"
97#include "stringpool.h"
98#include "attribs.h"
99#include "file-prefix-map.h" /* remap_debug_filename() */
100
101static void dwarf2out_source_line (unsigned int, unsigned int, const char *,
102 int, bool);
103static rtx_insn *last_var_location_insn;
104static rtx_insn *cached_next_real_insn;
105static void dwarf2out_decl (tree);
106static bool is_redundant_typedef (const_tree);
107
108#ifndef XCOFF_DEBUGGING_INFO0
109#define XCOFF_DEBUGGING_INFO0 0
110#endif
111
112#ifndef HAVE_XCOFF_DWARF_EXTRAS0
113#define HAVE_XCOFF_DWARF_EXTRAS0 0
114#endif
115
116#ifdef VMS_DEBUGGING_INFO
117int vms_file_stats_name (const char *, long long *, long *, char *, int *);
118
119/* Define this macro to be a nonzero value if the directory specifications
120 which are output in the debug info should end with a separator. */
121#define DWARF2_DIR_SHOULD_END_WITH_SEPARATOR0 1
122/* Define this macro to evaluate to a nonzero value if GCC should refrain
123 from generating indirect strings in DWARF2 debug information, for instance
124 if your target is stuck with an old version of GDB that is unable to
125 process them properly or uses VMS Debug. */
126#define DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET0 1
127#else
128#define DWARF2_DIR_SHOULD_END_WITH_SEPARATOR0 0
129#define DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET0 0
130#endif
131
132/* ??? Poison these here until it can be done generically. They've been
133 totally replaced in this file; make sure it stays that way. */
134#undef DWARF2_UNWIND_INFO
135#undef DWARF2_FRAME_INFO
136#if (GCC_VERSION(4 * 1000 + 2) >= 3000)
137 #pragma GCC poison DWARF2_UNWIND_INFO DWARF2_FRAME_INFO
138#endif
139
140/* The size of the target's pointer type. */
141#ifndef PTR_SIZE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) / (8))
142#define PTR_SIZE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) / (8))
(POINTER_SIZE(((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4)))
/ BITS_PER_UNIT(8))
143#endif
144
145/* Array of RTXes referenced by the debugging information, which therefore
146 must be kept around forever. */
147static GTY(()) vec<rtx, va_gc> *used_rtx_array;
148
149/* A pointer to the base of a list of incomplete types which might be
150 completed at some later time. incomplete_types_list needs to be a
151 vec<tree, va_gc> *because we want to tell the garbage collector about
152 it. */
153static GTY(()) vec<tree, va_gc> *incomplete_types;
154
155/* Pointers to various DWARF2 sections. */
156static GTY(()) section *debug_info_section;
157static GTY(()) section *debug_skeleton_info_section;
158static GTY(()) section *debug_abbrev_section;
159static GTY(()) section *debug_skeleton_abbrev_section;
160static GTY(()) section *debug_aranges_section;
161static GTY(()) section *debug_addr_section;
162static GTY(()) section *debug_macinfo_section;
163static const char *debug_macinfo_section_name;
164static unsigned macinfo_label_base = 1;
165static GTY(()) section *debug_line_section;
166static GTY(()) section *debug_skeleton_line_section;
167static GTY(()) section *debug_loc_section;
168static GTY(()) section *debug_pubnames_section;
169static GTY(()) section *debug_pubtypes_section;
170static GTY(()) section *debug_str_section;
171static GTY(()) section *debug_line_str_section;
172static GTY(()) section *debug_str_dwo_section;
173static GTY(()) section *debug_str_offsets_section;
174static GTY(()) section *debug_ranges_section;
175static GTY(()) section *debug_ranges_dwo_section;
176static GTY(()) section *debug_frame_section;
177
178/* Maximum size (in bytes) of an artificially generated label. */
179#define MAX_ARTIFICIAL_LABEL_BYTES40 40
180
181/* According to the (draft) DWARF 3 specification, the initial length
182 should either be 4 or 12 bytes. When it's 12 bytes, the first 4
183 bytes are 0xffffffff, followed by the length stored in the next 8
184 bytes.
185
186 However, the SGI/MIPS ABI uses an initial length which is equal to
187 dwarf_offset_size. It is defined (elsewhere) accordingly. */
188
189#ifndef DWARF_INITIAL_LENGTH_SIZE(global_options.x_dwarf_offset_size == 4 ? 4 : 12)
190#define DWARF_INITIAL_LENGTH_SIZE(global_options.x_dwarf_offset_size == 4 ? 4 : 12) (dwarf_offset_sizeglobal_options.x_dwarf_offset_size == 4 ? 4 : 12)
191#endif
192
193#ifndef DWARF_INITIAL_LENGTH_SIZE_STR(global_options.x_dwarf_offset_size == 4 ? "-4" : "-12")
194#define DWARF_INITIAL_LENGTH_SIZE_STR(global_options.x_dwarf_offset_size == 4 ? "-4" : "-12") (dwarf_offset_sizeglobal_options.x_dwarf_offset_size == 4 ? "-4" : "-12")
195#endif
196
197/* Round SIZE up to the nearest BOUNDARY. */
198#define DWARF_ROUND(SIZE,BOUNDARY)((((SIZE) + (BOUNDARY) - 1) / (BOUNDARY)) * (BOUNDARY)) \
199 ((((SIZE) + (BOUNDARY) - 1) / (BOUNDARY)) * (BOUNDARY))
200
201/* CIE identifier. */
202#if HOST_BITS_PER_WIDE_INT64 >= 64
203#define DWARF_CIE_ID(unsigned long) (global_options.x_dwarf_offset_size == 4 ? 0xffffffff
: 0xffffffffffffffffULL)
\
204 (unsigned HOST_WIDE_INTlong) (dwarf_offset_sizeglobal_options.x_dwarf_offset_size == 4 ? DW_CIE_ID0xffffffff : DW64_CIE_ID0xffffffffffffffffULL)
205#else
206#define DWARF_CIE_ID(unsigned long) (global_options.x_dwarf_offset_size == 4 ? 0xffffffff
: 0xffffffffffffffffULL)
DW_CIE_ID0xffffffff
207#endif
208
209
210/* A vector for a table that contains frame description
211 information for each routine. */
212#define NOT_INDEXED(-1U) (-1U)
213#define NO_INDEX_ASSIGNED(-2U) (-2U)
214
215static GTY(()) vec<dw_fde_ref, va_gc> *fde_vec;
216
217struct GTY((for_user)) indirect_string_node {
218 const char *str;
219 unsigned int refcount;
220 enum dwarf_form form;
221 char *label;
222 unsigned int index;
223};
224
225struct indirect_string_hasher : ggc_ptr_hash<indirect_string_node>
226{
227 typedef const char *compare_type;
228
229 static hashval_t hash (indirect_string_node *);
230 static bool equal (indirect_string_node *, const char *);
231};
232
233static GTY (()) hash_table<indirect_string_hasher> *debug_str_hash;
234
235static GTY (()) hash_table<indirect_string_hasher> *debug_line_str_hash;
236
237/* With split_debug_info, both the comp_dir and dwo_name go in the
238 main object file, rather than the dwo, similar to the force_direct
239 parameter elsewhere but with additional complications:
240
241 1) The string is needed in both the main object file and the dwo.
242 That is, the comp_dir and dwo_name will appear in both places.
243
244 2) Strings can use four forms: DW_FORM_string, DW_FORM_strp,
245 DW_FORM_line_strp or DW_FORM_strx/GNU_str_index.
246
247 3) GCC chooses the form to use late, depending on the size and
248 reference count.
249
250 Rather than forcing the all debug string handling functions and
251 callers to deal with these complications, simply use a separate,
252 special-cased string table for any attribute that should go in the
253 main object file. This limits the complexity to just the places
254 that need it. */
255
256static GTY (()) hash_table<indirect_string_hasher> *skeleton_debug_str_hash;
257
258static GTY(()) int dw2_string_counter;
259
260/* True if the compilation unit places functions in more than one section. */
261static GTY(()) bool have_multiple_function_sections = false;
262
263/* The default cold text section. */
264static GTY(()) section *cold_text_section;
265
266/* True if currently in text section. */
267static GTY(()) bool in_text_section_p = false;
268
269/* Last debug-on location in corresponding section. */
270static GTY(()) const char *last_text_label;
271static GTY(()) const char *last_cold_label;
272
273/* Mark debug-on/off locations per section.
274 NULL means the section is not used at all. */
275static GTY(()) vec<const char *, va_gc> *switch_text_ranges;
276static GTY(()) vec<const char *, va_gc> *switch_cold_ranges;
277
278/* The DIE for C++14 'auto' in a function return type. */
279static GTY(()) dw_die_ref auto_die;
280
281/* The DIE for C++14 'decltype(auto)' in a function return type. */
282static GTY(()) dw_die_ref decltype_auto_die;
283
284/* Forward declarations for functions defined in this file. */
285
286static void output_call_frame_info (int);
287
288/* Personality decl of current unit. Used only when assembler does not support
289 personality CFI. */
290static GTY(()) rtx current_unit_personality;
291
292/* Whether an eh_frame section is required. */
293static GTY(()) bool do_eh_frame = false;
294
295/* .debug_rnglists next index. */
296static unsigned int rnglist_idx;
297
298/* Data and reference forms for relocatable data. */
299#define DW_FORM_data(global_options.x_dwarf_offset_size == 8 ? DW_FORM_data8 : DW_FORM_data4
)
(dwarf_offset_sizeglobal_options.x_dwarf_offset_size == 8 ? DW_FORM_data8 : DW_FORM_data4)
300#define DW_FORM_ref(global_options.x_dwarf_offset_size == 8 ? DW_FORM_ref8 : DW_FORM_ref4
)
(dwarf_offset_sizeglobal_options.x_dwarf_offset_size == 8 ? DW_FORM_ref8 : DW_FORM_ref4)
301
302#ifndef DEBUG_FRAME_SECTION".debug_frame"
303#define DEBUG_FRAME_SECTION".debug_frame" ".debug_frame"
304#endif
305
306#ifndef FUNC_BEGIN_LABEL"LFB"
307#define FUNC_BEGIN_LABEL"LFB" "LFB"
308#endif
309
310#ifndef FUNC_SECOND_SECT_LABEL"LFSB"
311#define FUNC_SECOND_SECT_LABEL"LFSB" "LFSB"
312#endif
313
314#ifndef FUNC_END_LABEL"LFE"
315#define FUNC_END_LABEL"LFE" "LFE"
316#endif
317
318#ifndef PROLOGUE_END_LABEL"LPE"
319#define PROLOGUE_END_LABEL"LPE" "LPE"
320#endif
321
322#ifndef EPILOGUE_BEGIN_LABEL"LEB"
323#define EPILOGUE_BEGIN_LABEL"LEB" "LEB"
324#endif
325
326#ifndef FRAME_BEGIN_LABEL"Lframe"
327#define FRAME_BEGIN_LABEL"Lframe" "Lframe"
328#endif
329#define CIE_AFTER_SIZE_LABEL"LSCIE" "LSCIE"
330#define CIE_END_LABEL"LECIE" "LECIE"
331#define FDE_LABEL"LSFDE" "LSFDE"
332#define FDE_AFTER_SIZE_LABEL"LASFDE" "LASFDE"
333#define FDE_END_LABEL"LEFDE" "LEFDE"
334#define LINE_NUMBER_BEGIN_LABEL"LSLT" "LSLT"
335#define LINE_NUMBER_END_LABEL"LELT" "LELT"
336#define LN_PROLOG_AS_LABEL"LASLTP" "LASLTP"
337#define LN_PROLOG_END_LABEL"LELTP" "LELTP"
338#define DIE_LABEL_PREFIX"DW" "DW"
339
340/* Match the base name of a file to the base name of a compilation unit. */
341
342static int
343matches_main_base (const char *path)
344{
345 /* Cache the last query. */
346 static const char *last_path = NULLnullptr;
347 static int last_match = 0;
348 if (path != last_path)
349 {
350 const char *base;
351 int length = base_of_path (path, &base);
352 last_path = path;
353 last_match = (length == main_input_baselengthglobal_options.x_main_input_baselength
354 && memcmp (base, main_input_basenameglobal_options.x_main_input_basename, length) == 0);
355 }
356 return last_match;
357}
358
359#ifdef DEBUG_DEBUG_STRUCT
360
361static int
362dump_struct_debug (tree type, enum debug_info_usage usage,
363 enum debug_struct_file criterion, int generic,
364 int matches, int result)
365{
366 /* Find the type name. */
367 tree type_decl = TYPE_STUB_DECL (type)(((contains_struct_check (((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 367, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 367, __FUNCTION__))->common.chain))
;
368 tree t = type_decl;
369 const char *name = 0;
370 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == TYPE_DECL)
371 t = DECL_NAME (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 371, __FUNCTION__))->decl_minimal.name)
;
372 if (t)
373 name = IDENTIFIER_POINTER (t)((const char *) (tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 373, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
;
374
375 fprintf (stderrstderr, " struct %d %s %s %s %s %d %p %s\n",
376 criterion,
377 DECL_IN_SYSTEM_HEADER (type_decl)(in_system_header_at (((contains_struct_check ((type_decl), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 377, __FUNCTION__))->decl_minimal.locus)))
? "sys" : "usr",
378 matches ? "bas" : "hdr",
379 generic ? "gen" : "ord",
380 usage == DINFO_USAGE_DFN ? ";" :
381 usage == DINFO_USAGE_DIR_USE ? "." : "*",
382 result,
383 (void*) type_decl, name);
384 return result;
385}
386#define DUMP_GSTRUCT(type, usage, criterion, generic, matches, result)(result) \
387 dump_struct_debug (type, usage, criterion, generic, matches, result)
388
389#else
390
391#define DUMP_GSTRUCT(type, usage, criterion, generic, matches, result)(result) \
392 (result)
393
394#endif
395
396/* Get the number of HOST_WIDE_INTs needed to represent the precision
397 of the number. */
398
399static unsigned int
400get_full_len (const wide_int &op)
401{
402 int prec = wi::get_precision (op);
403 return ((prec + HOST_BITS_PER_WIDE_INT64 - 1)
404 / HOST_BITS_PER_WIDE_INT64);
405}
406
407static bool
408should_emit_struct_debug (tree type, enum debug_info_usage usage)
409{
410 if (debug_info_levelglobal_options.x_debug_info_level <= DINFO_LEVEL_TERSE)
411 return false;
412
413 enum debug_struct_file criterion;
414 tree type_decl;
415 bool generic = lang_hooks.types.generic_p (type);
416
417 if (generic)
418 criterion = debug_struct_genericglobal_options.x_debug_struct_generic[usage];
419 else
420 criterion = debug_struct_ordinaryglobal_options.x_debug_struct_ordinary[usage];
421
422 if (criterion == DINFO_STRUCT_FILE_NONE)
423 return DUMP_GSTRUCT (type, usage, criterion, generic, false, false)(false);
424 if (criterion == DINFO_STRUCT_FILE_ANY)
425 return DUMP_GSTRUCT (type, usage, criterion, generic, false, true)(true);
426
427 type_decl = TYPE_STUB_DECL (TYPE_MAIN_VARIANT (type))(((contains_struct_check (((tree_class_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 427, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 427, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 427, __FUNCTION__))->common.chain))
;
428
429 if (type_decl != NULLnullptr)
430 {
431 if (criterion == DINFO_STRUCT_FILE_SYS && DECL_IN_SYSTEM_HEADER (type_decl)(in_system_header_at (((contains_struct_check ((type_decl), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 431, __FUNCTION__))->decl_minimal.locus)))
)
432 return DUMP_GSTRUCT (type, usage, criterion, generic, false, true)(true);
433
434 if (matches_main_base (DECL_SOURCE_FILE (type_decl)((expand_location (((contains_struct_check ((type_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 434, __FUNCTION__))->decl_minimal.locus))).file)
))
435 return DUMP_GSTRUCT (type, usage, criterion, generic, true, true)(true);
436 }
437
438 return DUMP_GSTRUCT (type, usage, criterion, generic, false, false)(false);
439}
440
441/* Switch [BACK] to eh_frame_section. If we don't have an eh_frame_section,
442 switch to the data section instead, and write out a synthetic start label
443 for collect2 the first time around. */
444
445static void
446switch_to_eh_frame_section (bool back ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
447{
448 if (eh_frame_section == 0)
449 {
450 int flags;
451
452 if (EH_TABLES_CAN_BE_READ_ONLY1)
453 {
454 int fde_encoding;
455 int per_encoding;
456 int lsda_encoding;
457
458 fde_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1,asm_preferred_eh_data_format ((1), (0))
459 /*global=*/0)asm_preferred_eh_data_format ((1), (0));
460 per_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2,asm_preferred_eh_data_format ((2), (1))
461 /*global=*/1)asm_preferred_eh_data_format ((2), (1));
462 lsda_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0,asm_preferred_eh_data_format ((0), (0))
463 /*global=*/0)asm_preferred_eh_data_format ((0), (0));
464 flags = ((! flag_picglobal_options.x_flag_pic
465 || ((fde_encoding & 0x70) != DW_EH_PE_absptr0x00
466 && (fde_encoding & 0x70) != DW_EH_PE_aligned0x50
467 && (per_encoding & 0x70) != DW_EH_PE_absptr0x00
468 && (per_encoding & 0x70) != DW_EH_PE_aligned0x50
469 && (lsda_encoding & 0x70) != DW_EH_PE_absptr0x00
470 && (lsda_encoding & 0x70) != DW_EH_PE_aligned0x50))
471 ? 0 : SECTION_WRITE);
472 }
473 else
474 flags = SECTION_WRITE;
475
476#ifdef EH_FRAME_SECTION_NAME".eh_frame"
477 eh_frame_section = get_section (EH_FRAME_SECTION_NAME".eh_frame", flags, NULLnullptr);
478#else
479 eh_frame_section = ((flags == SECTION_WRITE)
480 ? data_section : readonly_data_section);
481#endif /* EH_FRAME_SECTION_NAME */
482 }
483
484 switch_to_section (eh_frame_section);
485
486#ifdef EH_FRAME_THROUGH_COLLECT2
487 /* We have no special eh_frame section. Emit special labels to guide
488 collect2. */
489 if (!back)
490 {
491 tree label = get_file_function_name ("F");
492 ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE))if ((floor_log2 (((((global_options.x_ix86_isa_flags & (1UL
<< 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) / (8)))) != 0) fprintf
((asm_out_file), "\t.align %d\n", 1 << (floor_log2 (((
((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) / (8)))))
;
493 targetm.asm_out.globalize_label (asm_out_file,
494 IDENTIFIER_POINTER (label)((const char *) (tree_check ((label), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 494, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
);
495 ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label))do { assemble_name ((asm_out_file), (((const char *) (tree_check
((label), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 495, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
))); fputs (":\n", (asm_out_file)); } while (0)
;
496 }
497#endif
498}
499
500/* Switch [BACK] to the eh or debug frame table section, depending on
501 FOR_EH. */
502
503static void
504switch_to_frame_table_section (int for_eh, bool back)
505{
506 if (for_eh)
507 switch_to_eh_frame_section (back);
508 else
509 {
510 if (!debug_frame_section)
511 debug_frame_section = get_section (DEBUG_FRAME_SECTION".debug_frame",
512 SECTION_DEBUG, NULLnullptr);
513 switch_to_section (debug_frame_section);
514 }
515}
516
517/* Describe for the GTY machinery what parts of dw_cfi_oprnd1 are used. */
518
519enum dw_cfi_oprnd_type
520dw_cfi_oprnd1_desc (enum dwarf_call_frame_info cfi)
521{
522 switch (cfi)
523 {
524 case DW_CFA_nop:
525 case DW_CFA_GNU_window_save:
526 case DW_CFA_remember_state:
527 case DW_CFA_restore_state:
528 return dw_cfi_oprnd_unused;
529
530 case DW_CFA_set_loc:
531 case DW_CFA_advance_loc1:
532 case DW_CFA_advance_loc2:
533 case DW_CFA_advance_loc4:
534 case DW_CFA_MIPS_advance_loc8:
535 return dw_cfi_oprnd_addr;
536
537 case DW_CFA_offset:
538 case DW_CFA_offset_extended:
539 case DW_CFA_def_cfa:
540 case DW_CFA_offset_extended_sf:
541 case DW_CFA_def_cfa_sf:
542 case DW_CFA_restore:
543 case DW_CFA_restore_extended:
544 case DW_CFA_undefined:
545 case DW_CFA_same_value:
546 case DW_CFA_def_cfa_register:
547 case DW_CFA_register:
548 case DW_CFA_expression:
549 case DW_CFA_val_expression:
550 return dw_cfi_oprnd_reg_num;
551
552 case DW_CFA_def_cfa_offset:
553 case DW_CFA_GNU_args_size:
554 case DW_CFA_def_cfa_offset_sf:
555 return dw_cfi_oprnd_offset;
556
557 case DW_CFA_def_cfa_expression:
558 return dw_cfi_oprnd_loc;
559
560 default:
561 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 561, __FUNCTION__))
;
562 }
563}
564
565/* Describe for the GTY machinery what parts of dw_cfi_oprnd2 are used. */
566
567enum dw_cfi_oprnd_type
568dw_cfi_oprnd2_desc (enum dwarf_call_frame_info cfi)
569{
570 switch (cfi)
571 {
572 case DW_CFA_def_cfa:
573 case DW_CFA_def_cfa_sf:
574 case DW_CFA_offset:
575 case DW_CFA_offset_extended_sf:
576 case DW_CFA_offset_extended:
577 return dw_cfi_oprnd_offset;
578
579 case DW_CFA_register:
580 return dw_cfi_oprnd_reg_num;
581
582 case DW_CFA_expression:
583 case DW_CFA_val_expression:
584 return dw_cfi_oprnd_loc;
585
586 case DW_CFA_def_cfa_expression:
587 return dw_cfi_oprnd_cfa_loc;
588
589 default:
590 return dw_cfi_oprnd_unused;
591 }
592}
593
594/* Output one FDE. */
595
596static void
597output_fde (dw_fde_ref fde, bool for_eh, bool second,
598 char *section_start_label, int fde_encoding, char *augmentation,
599 bool any_lsda_needed, int lsda_encoding)
600{
601 const char *begin, *end;
602 static unsigned int j;
603 char l1[MAX_ARTIFICIAL_LABEL_BYTES40], l2[MAX_ARTIFICIAL_LABEL_BYTES40];
604
605 targetm.asm_out.emit_unwind_label (asm_out_file, fde->decl, for_eh,
606 /* empty */ 0);
607 targetm.asm_out.internal_label (asm_out_file, FDE_LABEL"LSFDE",
608 for_eh + j);
609 ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + j)do { char *__p; (l1)[0] = '*'; (l1)[1] = '.'; __p = stpcpy (&
(l1)[2], "LASFDE"); sprint_ul (__p, (unsigned long) (for_eh +
j)); } while (0)
;
610 ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + j)do { char *__p; (l2)[0] = '*'; (l2)[1] = '.'; __p = stpcpy (&
(l2)[2], "LEFDE"); sprint_ul (__p, (unsigned long) (for_eh + j
)); } while (0)
;
611 if (!XCOFF_DEBUGGING_INFO0 || for_eh)
612 {
613 if (DWARF_INITIAL_LENGTH_SIZE(global_options.x_dwarf_offset_size == 4 ? 4 : 12) - dwarf_offset_sizeglobal_options.x_dwarf_offset_size == 4 && !for_eh)
614 dw2_asm_output_data (4, 0xffffffff, "Initial length escape value"
615 " indicating 64-bit DWARF extension");
616 dw2_asm_output_delta (for_eh ? 4 : dwarf_offset_sizeglobal_options.x_dwarf_offset_size, l2, l1,
617 "FDE Length");
618 }
619 ASM_OUTPUT_LABEL (asm_out_file, l1)do { assemble_name ((asm_out_file), (l1)); fputs (":\n", (asm_out_file
)); } while (0)
;
620
621 if (for_eh)
622 dw2_asm_output_delta (4, l1, section_start_label, "FDE CIE offset");
623 else
624 dw2_asm_output_offset (dwarf_offset_sizeglobal_options.x_dwarf_offset_size, section_start_label,
625 debug_frame_section, "FDE CIE offset");
626
627 begin = second ? fde->dw_fde_second_begin : fde->dw_fde_begin;
628 end = second ? fde->dw_fde_second_end : fde->dw_fde_end;
629
630 if (for_eh)
631 {
632 rtx sym_ref = gen_rtx_SYMBOL_REF (Pmode, begin)gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((begin)) )
;
633 SYMBOL_REF_FLAGS (sym_ref)(__extension__ ({ __typeof ((sym_ref)) const _rtx = ((sym_ref
)); if (((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 633, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags)
|= SYMBOL_FLAG_LOCAL(1 << 1);
634 dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref, false,
635 "FDE initial location");
636 dw2_asm_output_delta (size_of_encoded_value (fde_encoding),
637 end, begin, "FDE address range");
638 }
639 else
640 {
641 dw2_asm_output_addr (DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
, begin, "FDE initial location");
642 dw2_asm_output_delta (DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
, end, begin, "FDE address range");
643 }
644
645 if (augmentation[0])
646 {
647 if (any_lsda_needed)
648 {
649 int size = size_of_encoded_value (lsda_encoding);
650
651 if (lsda_encoding == DW_EH_PE_aligned0x50)
652 {
653 int offset = ( 4 /* Length */
654 + 4 /* CIE offset */
655 + 2 * size_of_encoded_value (fde_encoding)
656 + 1 /* Augmentation size */ );
657 int pad = -offset & (PTR_SIZE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) / (8))
- 1);
658
659 size += pad;
660 gcc_assert (size_of_uleb128 (size) == 1)((void)(!(size_of_uleb128 (size) == 1) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 660, __FUNCTION__), 0 : 0))
;
661 }
662
663 dw2_asm_output_data_uleb128 (size, "Augmentation size");
664
665 if (fde->uses_eh_lsda)
666 {
667 ASM_GENERATE_INTERNAL_LABEL (l1, second ? "LLSDAC" : "LLSDA",do { char *__p; (l1)[0] = '*'; (l1)[1] = '.'; __p = stpcpy (&
(l1)[2], second ? "LLSDAC" : "LLSDA"); sprint_ul (__p, (unsigned
long) (fde->funcdef_number)); } while (0)
668 fde->funcdef_number)do { char *__p; (l1)[0] = '*'; (l1)[1] = '.'; __p = stpcpy (&
(l1)[2], second ? "LLSDAC" : "LLSDA"); sprint_ul (__p, (unsigned
long) (fde->funcdef_number)); } while (0)
;
669 dw2_asm_output_encoded_addr_rtx (lsda_encoding,
670 gen_rtx_SYMBOL_REF (Pmode, l1)gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((l1)) )
,
671 false,
672 "Language Specific Data Area");
673 }
674 else
675 {
676 if (lsda_encoding == DW_EH_PE_aligned0x50)
677 ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE))if ((floor_log2 (((((global_options.x_ix86_isa_flags & (1UL
<< 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) / (8)))) != 0) fprintf
((asm_out_file), "\t.align %d\n", 1 << (floor_log2 (((
((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) / (8)))))
;
678 dw2_asm_output_data (size_of_encoded_value (lsda_encoding), 0,
679 "Language Specific Data Area (none)");
680 }
681 }
682 else
683 dw2_asm_output_data_uleb128 (0, "Augmentation size");
684 }
685
686 /* Loop through the Call Frame Instructions associated with this FDE. */
687 fde->dw_fde_current_label = begin;
688 {
689 size_t from, until, i;
690
691 from = 0;
692 until = vec_safe_length (fde->dw_fde_cfi);
693
694 if (fde->dw_fde_second_begin == NULLnullptr)
695 ;
696 else if (!second)
697 until = fde->dw_fde_switch_cfi_index;
698 else
699 from = fde->dw_fde_switch_cfi_index;
700
701 for (i = from; i < until; i++)
702 output_cfi ((*fde->dw_fde_cfi)[i], fde, for_eh);
703 }
704
705 /* If we are to emit a ref/link from function bodies to their frame tables,
706 do it now. This is typically performed to make sure that tables
707 associated with functions are dragged with them and not discarded in
708 garbage collecting links. We need to do this on a per function basis to
709 cope with -ffunction-sections. */
710
711#ifdef ASM_OUTPUT_DWARF_TABLE_REF
712 /* Switch to the function section, emit the ref to the tables, and
713 switch *back* into the table section. */
714 switch_to_section (function_section (fde->decl));
715 ASM_OUTPUT_DWARF_TABLE_REF (section_start_label);
716 switch_to_frame_table_section (for_eh, true);
717#endif
718
719 /* Pad the FDE out to an address sized boundary. */
720 ASM_OUTPUT_ALIGN (asm_out_file,if ((floor_log2 ((for_eh ? ((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) / (
8)) : (((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))))) != 0
) fprintf ((asm_out_file), "\t.align %d\n", 1 << (floor_log2
((for_eh ? ((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) / (8)) : (((((global_options
.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) *
(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 8 : 4))) + (8) - 1) / (8))))))
721 floor_log2 ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE)))if ((floor_log2 ((for_eh ? ((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) / (
8)) : (((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))))) != 0
) fprintf ((asm_out_file), "\t.align %d\n", 1 << (floor_log2
((for_eh ? ((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) / (8)) : (((((global_options
.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) *
(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 8 : 4))) + (8) - 1) / (8))))))
;
722 ASM_OUTPUT_LABEL (asm_out_file, l2)do { assemble_name ((asm_out_file), (l2)); fputs (":\n", (asm_out_file
)); } while (0)
;
723
724 j += 2;
725}
726
727/* Return true if frame description entry FDE is needed for EH. */
728
729static bool
730fde_needed_for_eh_p (dw_fde_ref fde)
731{
732 if (flag_asynchronous_unwind_tablesglobal_options.x_flag_asynchronous_unwind_tables)
733 return true;
734
735 if (TARGET_USES_WEAK_UNWIND_INFO0 && DECL_WEAK (fde->decl)((contains_struct_check ((fde->decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 735, __FUNCTION__))->decl_with_vis.weak_flag)
)
736 return true;
737
738 if (fde->uses_eh_lsda)
739 return true;
740
741 /* If exceptions are enabled, we have collected nothrow info. */
742 if (flag_exceptionsglobal_options.x_flag_exceptions && (fde->all_throwers_are_sibcalls || fde->nothrow))
743 return false;
744
745 return true;
746}
747
748/* Output the call frame information used to record information
749 that relates to calculating the frame pointer, and records the
750 location of saved registers. */
751
752static void
753output_call_frame_info (int for_eh)
754{
755 unsigned int i;
756 dw_fde_ref fde;
757 dw_cfi_ref cfi;
758 char l1[MAX_ARTIFICIAL_LABEL_BYTES40], l2[MAX_ARTIFICIAL_LABEL_BYTES40];
759 char section_start_label[MAX_ARTIFICIAL_LABEL_BYTES40];
760 bool any_lsda_needed = false;
761 char augmentation[6];
762 int augmentation_size;
763 int fde_encoding = DW_EH_PE_absptr0x00;
764 int per_encoding = DW_EH_PE_absptr0x00;
765 int lsda_encoding = DW_EH_PE_absptr0x00;
766 int return_reg;
767 rtx personality = NULLnullptr;
768 int dw_cie_version;
769
770 /* Don't emit a CIE if there won't be any FDEs. */
771 if (!fde_vec)
772 return;
773
774 /* Nothing to do if the assembler's doing it all. */
775 if (dwarf2out_do_cfi_asm ())
776 return;
777
778 /* If we don't have any functions we'll want to unwind out of, don't emit
779 any EH unwind information. If we make FDEs linkonce, we may have to
780 emit an empty label for an FDE that wouldn't otherwise be emitted. We
781 want to avoid having an FDE kept around when the function it refers to
782 is discarded. Example where this matters: a primary function template
783 in C++ requires EH information, an explicit specialization doesn't. */
784 if (for_eh)
785 {
786 bool any_eh_needed = false;
787
788 FOR_EACH_VEC_ELT (*fde_vec, i, fde)for (i = 0; (*fde_vec).iterate ((i), &(fde)); ++(i))
789 {
790 if (fde->uses_eh_lsda)
791 any_eh_needed = any_lsda_needed = true;
792 else if (fde_needed_for_eh_p (fde))
793 any_eh_needed = true;
794 else if (TARGET_USES_WEAK_UNWIND_INFO0)
795 targetm.asm_out.emit_unwind_label (asm_out_file, fde->decl, 1, 1);
796 }
797
798 if (!any_eh_needed)
799 return;
800 }
801
802 /* We're going to be generating comments, so turn on app. */
803 if (flag_debug_asmglobal_options.x_flag_debug_asm)
804 app_enable ();
805
806 /* Switch to the proper frame section, first time. */
807 switch_to_frame_table_section (for_eh, false);
808
809 ASM_GENERATE_INTERNAL_LABEL (section_start_label, FRAME_BEGIN_LABEL, for_eh)do { char *__p; (section_start_label)[0] = '*'; (section_start_label
)[1] = '.'; __p = stpcpy (&(section_start_label)[2], "Lframe"
); sprint_ul (__p, (unsigned long) (for_eh)); } while (0)
;
810 ASM_OUTPUT_LABEL (asm_out_file, section_start_label)do { assemble_name ((asm_out_file), (section_start_label)); fputs
(":\n", (asm_out_file)); } while (0)
;
811
812 /* Output the CIE. */
813 ASM_GENERATE_INTERNAL_LABEL (l1, CIE_AFTER_SIZE_LABEL, for_eh)do { char *__p; (l1)[0] = '*'; (l1)[1] = '.'; __p = stpcpy (&
(l1)[2], "LSCIE"); sprint_ul (__p, (unsigned long) (for_eh));
} while (0)
;
814 ASM_GENERATE_INTERNAL_LABEL (l2, CIE_END_LABEL, for_eh)do { char *__p; (l2)[0] = '*'; (l2)[1] = '.'; __p = stpcpy (&
(l2)[2], "LECIE"); sprint_ul (__p, (unsigned long) (for_eh));
} while (0)
;
815 if (!XCOFF_DEBUGGING_INFO0 || for_eh)
816 {
817 if (DWARF_INITIAL_LENGTH_SIZE(global_options.x_dwarf_offset_size == 4 ? 4 : 12) - dwarf_offset_sizeglobal_options.x_dwarf_offset_size == 4 && !for_eh)
818 dw2_asm_output_data (4, 0xffffffff,
819 "Initial length escape value indicating 64-bit DWARF extension");
820 dw2_asm_output_delta (for_eh ? 4 : dwarf_offset_sizeglobal_options.x_dwarf_offset_size, l2, l1,
821 "Length of Common Information Entry");
822 }
823 ASM_OUTPUT_LABEL (asm_out_file, l1)do { assemble_name ((asm_out_file), (l1)); fputs (":\n", (asm_out_file
)); } while (0)
;
824
825 /* Now that the CIE pointer is PC-relative for EH,
826 use 0 to identify the CIE. */
827 dw2_asm_output_data ((for_eh ? 4 : dwarf_offset_sizeglobal_options.x_dwarf_offset_size),
828 (for_eh ? 0 : DWARF_CIE_ID(unsigned long) (global_options.x_dwarf_offset_size == 4 ? 0xffffffff
: 0xffffffffffffffffULL)
),
829 "CIE Identifier Tag");
830
831 /* Use the CIE version 3 for DWARF3; allow DWARF2 to continue to
832 use CIE version 1, unless that would produce incorrect results
833 due to overflowing the return register column. */
834 return_reg = DWARF2_FRAME_REG_OUT (DWARF_FRAME_RETURN_COLUMN, for_eh)((((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 16 : 8))
;
835 dw_cie_version = 1;
836 if (return_reg >= 256 || dwarf_versionglobal_options.x_dwarf_version > 2)
837 dw_cie_version = 3;
838 dw2_asm_output_data (1, dw_cie_version, "CIE Version");
839
840 augmentation[0] = 0;
841 augmentation_size = 0;
842
843 personality = current_unit_personality;
844 if (for_eh)
845 {
846 char *p;
847
848 /* Augmentation:
849 z Indicates that a uleb128 is present to size the
850 augmentation section.
851 L Indicates the encoding (and thus presence) of
852 an LSDA pointer in the FDE augmentation.
853 R Indicates a non-default pointer encoding for
854 FDE code pointers.
855 P Indicates the presence of an encoding + language
856 personality routine in the CIE augmentation. */
857
858 fde_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1, /*global=*/0)asm_preferred_eh_data_format ((1), (0));
859 per_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1)asm_preferred_eh_data_format ((2), (1));
860 lsda_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/0)asm_preferred_eh_data_format ((0), (0));
861
862 p = augmentation + 1;
863 if (personality)
864 {
865 *p++ = 'P';
866 augmentation_size += 1 + size_of_encoded_value (per_encoding);
867 assemble_external_libcall (personality);
868 }
869 if (any_lsda_needed)
870 {
871 *p++ = 'L';
872 augmentation_size += 1;
873 }
874 if (fde_encoding != DW_EH_PE_absptr0x00)
875 {
876 *p++ = 'R';
877 augmentation_size += 1;
878 }
879 if (p > augmentation + 1)
880 {
881 augmentation[0] = 'z';
882 *p = '\0';
883 }
884
885 /* Ug. Some platforms can't do unaligned dynamic relocations at all. */
886 if (personality && per_encoding == DW_EH_PE_aligned0x50)
887 {
888 int offset = ( 4 /* Length */
889 + 4 /* CIE Id */
890 + 1 /* CIE version */
891 + strlen (augmentation) + 1 /* Augmentation */
892 + size_of_uleb128 (1) /* Code alignment */
893 + size_of_sleb128 (DWARF_CIE_DATA_ALIGNMENT(-((int) (((global_options.x_ix86_isa_flags & (1UL <<
1)) != 0) ? 8 : 4)))
)
894 + 1 /* RA column */
895 + 1 /* Augmentation size */
896 + 1 /* Personality encoding */ );
897 int pad = -offset & (PTR_SIZE((((global_options.x_ix86_isa_flags & (1UL << 58)) !=
0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL
<< 1)) != 0) ? 8 : 4))) / (8))
- 1);
898
899 augmentation_size += pad;
900
901 /* Augmentations should be small, so there's scarce need to
902 iterate for a solution. Die if we exceed one uleb128 byte. */
903 gcc_assert (size_of_uleb128 (augmentation_size) == 1)((void)(!(size_of_uleb128 (augmentation_size) == 1) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 903, __FUNCTION__), 0 : 0))
;
904 }
905 }
906
907 dw2_asm_output_nstring (augmentation, -1, "CIE Augmentation");
908 if (dw_cie_version >= 4)
909 {
910 dw2_asm_output_data (1, DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
, "CIE Address Size");
911 dw2_asm_output_data (1, 0, "CIE Segment Size");
912 }
913 dw2_asm_output_data_uleb128 (1, "CIE Code Alignment Factor");
914 dw2_asm_output_data_sleb128 (DWARF_CIE_DATA_ALIGNMENT(-((int) (((global_options.x_ix86_isa_flags & (1UL <<
1)) != 0) ? 8 : 4)))
,
915 "CIE Data Alignment Factor");
916
917 if (dw_cie_version == 1)
918 dw2_asm_output_data (1, return_reg, "CIE RA Column");
919 else
920 dw2_asm_output_data_uleb128 (return_reg, "CIE RA Column");
921
922 if (augmentation[0])
923 {
924 dw2_asm_output_data_uleb128 (augmentation_size, "Augmentation size");
925 if (personality)
926 {
927 dw2_asm_output_data (1, per_encoding, "Personality (%s)",
928 eh_data_format_name (per_encoding));
929 dw2_asm_output_encoded_addr_rtx (per_encoding,
930 personality,
931 true, NULLnullptr);
932 }
933
934 if (any_lsda_needed)
935 dw2_asm_output_data (1, lsda_encoding, "LSDA Encoding (%s)",
936 eh_data_format_name (lsda_encoding));
937
938 if (fde_encoding != DW_EH_PE_absptr0x00)
939 dw2_asm_output_data (1, fde_encoding, "FDE Encoding (%s)",
940 eh_data_format_name (fde_encoding));
941 }
942
943 FOR_EACH_VEC_ELT (*cie_cfi_vec, i, cfi)for (i = 0; (*cie_cfi_vec).iterate ((i), &(cfi)); ++(i))
944 output_cfi (cfi, NULLnullptr, for_eh);
945
946 /* Pad the CIE out to an address sized boundary. */
947 ASM_OUTPUT_ALIGN (asm_out_file,if ((floor_log2 (for_eh ? ((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) / (
8)) : (((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)))) != 0)
fprintf ((asm_out_file), "\t.align %d\n", 1 << (floor_log2
(for_eh ? ((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) / (8)) : (((((global_options
.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) *
(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 8 : 4))) + (8) - 1) / (8)))))
948 floor_log2 (for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE))if ((floor_log2 (for_eh ? ((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) / (
8)) : (((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)))) != 0)
fprintf ((asm_out_file), "\t.align %d\n", 1 << (floor_log2
(for_eh ? ((((global_options.x_ix86_isa_flags & (1UL <<
58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) / (8)) : (((((global_options
.x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) *
(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? 8 : 4))) + (8) - 1) / (8)))))
;
949 ASM_OUTPUT_LABEL (asm_out_file, l2)do { assemble_name ((asm_out_file), (l2)); fputs (":\n", (asm_out_file
)); } while (0)
;
950
951 /* Loop through all of the FDE's. */
952 FOR_EACH_VEC_ELT (*fde_vec, i, fde)for (i = 0; (*fde_vec).iterate ((i), &(fde)); ++(i))
953 {
954 unsigned int k;
955
956 /* Don't emit EH unwind info for leaf functions that don't need it. */
957 if (for_eh && !fde_needed_for_eh_p (fde))
958 continue;
959
960 for (k = 0; k < (fde->dw_fde_second_begin ? 2 : 1); k++)
961 output_fde (fde, for_eh, k, section_start_label, fde_encoding,
962 augmentation, any_lsda_needed, lsda_encoding);
963 }
964
965 if (for_eh && targetm.terminate_dw2_eh_frame_info)
966 dw2_asm_output_data (4, 0, "End of Table");
967
968 /* Turn off app to make assembly quicker. */
969 if (flag_debug_asmglobal_options.x_flag_debug_asm)
970 app_disable ();
971}
972
973/* Emit .cfi_startproc and .cfi_personality/.cfi_lsda if needed. */
974
975static void
976dwarf2out_do_cfi_startproc (bool second)
977{
978 int enc;
979 rtx ref;
980
981 fprintf (asm_out_file, "\t.cfi_startproc\n");
982
983 targetm.asm_out.post_cfi_startproc (asm_out_file, current_function_decl);
984
985 /* .cfi_personality and .cfi_lsda are only relevant to DWARF2
986 eh unwinders. */
987 if (targetm_common.except_unwind_info (&global_options) != UI_DWARF2)
988 return;
989
990 rtx personality = get_personality_function (current_function_decl);
991
992 if (personality)
993 {
994 enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1)asm_preferred_eh_data_format ((2), (1));
995 ref = personality;
996
997 /* ??? The GAS support isn't entirely consistent. We have to
998 handle indirect support ourselves, but PC-relative is done
999 in the assembler. Further, the assembler can't handle any
1000 of the weirder relocation types. */
1001 if (enc & DW_EH_PE_indirect0x80)
1002 {
1003 if (targetm.asm_out.make_eh_symbol_indirect != NULLnullptr)
1004 ref = targetm.asm_out.make_eh_symbol_indirect (ref, true);
1005 else
1006 ref = dw2_force_const_mem (ref, true);
1007 }
1008
1009 fprintf (asm_out_file, "\t.cfi_personality %#x,", enc);
1010 output_addr_const (asm_out_file, ref);
1011 fputc ('\n', asm_out_file);
1012 }
1013
1014 if (crtl(&x_rtl)->uses_eh_lsda)
1015 {
1016 char lab[MAX_ARTIFICIAL_LABEL_BYTES40];
1017
1018 enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/0)asm_preferred_eh_data_format ((0), (0));
1019 ASM_GENERATE_INTERNAL_LABEL (lab, second ? "LLSDAC" : "LLSDA",do { char *__p; (lab)[0] = '*'; (lab)[1] = '.'; __p = stpcpy (
&(lab)[2], second ? "LLSDAC" : "LLSDA"); sprint_ul (__p, (
unsigned long) (((cfun + 0)->funcdef_no))); } while (0)
1020 current_function_funcdef_no)do { char *__p; (lab)[0] = '*'; (lab)[1] = '.'; __p = stpcpy (
&(lab)[2], second ? "LLSDAC" : "LLSDA"); sprint_ul (__p, (
unsigned long) (((cfun + 0)->funcdef_no))); } while (0)
;
1021 ref = gen_rtx_SYMBOL_REF (Pmode, lab)gen_rtx_fmt_s0_stat ((SYMBOL_REF), (((global_options.x_ix86_pmode
== PMODE_DI ? (scalar_int_mode ((scalar_int_mode::from_int) E_DImode
)) : (scalar_int_mode ((scalar_int_mode::from_int) E_SImode))
))), ((lab)) )
;
1022 SYMBOL_REF_FLAGS (ref)(__extension__ ({ __typeof ((ref)) const _rtx = ((ref)); if (
((enum rtx_code) (_rtx)->code) != SYMBOL_REF) rtl_check_failed_flag
("SYMBOL_REF_FLAGS", _rtx, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 1022, __FUNCTION__); _rtx; }) ->u2.symbol_ref_flags)
= SYMBOL_FLAG_LOCAL(1 << 1);
1023
1024 if (enc & DW_EH_PE_indirect0x80)
1025 {
1026 if (targetm.asm_out.make_eh_symbol_indirect != NULLnullptr)
1027 ref = targetm.asm_out.make_eh_symbol_indirect (ref, true);
1028 else
1029 ref = dw2_force_const_mem (ref, true);
1030 }
1031
1032 fprintf (asm_out_file, "\t.cfi_lsda %#x,", enc);
1033 output_addr_const (asm_out_file, ref);
1034 fputc ('\n', asm_out_file);
1035 }
1036}
1037
1038/* Allocate CURRENT_FDE. Immediately initialize all we can, noting that
1039 this allocation may be done before pass_final. */
1040
1041dw_fde_ref
1042dwarf2out_alloc_current_fde (void)
1043{
1044 dw_fde_ref fde;
1045
1046 fde = ggc_cleared_alloc<dw_fde_node> ();
1047 fde->decl = current_function_decl;
1048 fde->funcdef_number = current_function_funcdef_no((cfun + 0)->funcdef_no);
1049 fde->fde_index = vec_safe_length (fde_vec);
1050 fde->all_throwers_are_sibcalls = crtl(&x_rtl)->all_throwers_are_sibcalls;
1051 fde->uses_eh_lsda = crtl(&x_rtl)->uses_eh_lsda;
1052 fde->nothrow = crtl(&x_rtl)->nothrow;
1053 fde->drap_reg = INVALID_REGNUM(~(unsigned int) 0);
1054 fde->vdrap_reg = INVALID_REGNUM(~(unsigned int) 0);
1055
1056 /* Record the FDE associated with this function. */
1057 cfun(cfun + 0)->fde = fde;
1058 vec_safe_push (fde_vec, fde);
1059
1060 return fde;
1061}
1062
1063/* Output a marker (i.e. a label) for the beginning of a function, before
1064 the prologue. */
1065
1066void
1067dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
1068 unsigned int column ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
1069 const char *file ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1070{
1071 char label[MAX_ARTIFICIAL_LABEL_BYTES40];
1072 char * dup_label;
1073 dw_fde_ref fde;
1074 section *fnsec;
1075 bool do_frame;
1076
1077 current_function_func_begin_label = NULLnullptr;
1078
1079 do_frame = dwarf2out_do_frame ();
1080
1081 /* ??? current_function_func_begin_label is also used by except.c for
1082 call-site information. We must emit this label if it might be used. */
1083 if (!do_frame
1084 && (!flag_exceptionsglobal_options.x_flag_exceptions
1085 || targetm_common.except_unwind_info (&global_options) == UI_SJLJ))
1086 return;
1087
1088 fnsec = function_section (current_function_decl);
1089 switch_to_section (fnsec);
1090 ASM_GENERATE_INTERNAL_LABEL (label, FUNC_BEGIN_LABEL,do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LFB"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
1091 current_function_funcdef_no)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LFB"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
;
1092 ASM_OUTPUT_DEBUG_LABEL (asm_out_file, FUNC_BEGIN_LABEL,(*targetm.asm_out.internal_label) (asm_out_file, "LFB", ((cfun
+ 0)->funcdef_no))
1093 current_function_funcdef_no)(*targetm.asm_out.internal_label) (asm_out_file, "LFB", ((cfun
+ 0)->funcdef_no))
;
1094 dup_label = xstrdup (label);
1095 current_function_func_begin_label = dup_label;
1096
1097 /* We can elide FDE allocation if we're not emitting frame unwind info. */
1098 if (!do_frame)
1099 return;
1100
1101 /* Unlike the debug version, the EH version of frame unwind info is a per-
1102 function setting so we need to record whether we need it for the unit. */
1103 do_eh_frame |= dwarf2out_do_eh_frame ();
1104
1105 /* Cater to the various TARGET_ASM_OUTPUT_MI_THUNK implementations that
1106 emit insns as rtx but bypass the bulk of rest_of_compilation, which
1107 would include pass_dwarf2_frame. If we've not created the FDE yet,
1108 do so now. */
1109 fde = cfun(cfun + 0)->fde;
1110 if (fde == NULLnullptr)
1111 fde = dwarf2out_alloc_current_fde ();
1112
1113 /* Initialize the bits of CURRENT_FDE that were not available earlier. */
1114 fde->dw_fde_begin = dup_label;
1115 fde->dw_fde_current_label = dup_label;
1116 fde->in_std_section = (fnsec == text_section
1117 || (cold_text_section && fnsec == cold_text_section));
1118 fde->ignored_debug = DECL_IGNORED_P (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 1118, __FUNCTION__))->decl_common.ignored_flag)
;
1119 in_text_section_p = fnsec == text_section;
1120
1121 /* We only want to output line number information for the genuine dwarf2
1122 prologue case, not the eh frame case. */
1123#ifdef DWARF2_DEBUGGING_INFO1
1124 if (file)
1125 dwarf2out_source_line (line, column, file, 0, true);
1126#endif
1127
1128 if (dwarf2out_do_cfi_asm ())
1129 dwarf2out_do_cfi_startproc (false);
1130 else
1131 {
1132 rtx personality = get_personality_function (current_function_decl);
1133 if (!current_unit_personality)
1134 current_unit_personality = personality;
1135
1136 /* We cannot keep a current personality per function as without CFI
1137 asm, at the point where we emit the CFI data, there is no current
1138 function anymore. */
1139 if (personality && current_unit_personality != personality)
1140 sorry ("multiple EH personalities are supported only with assemblers "
1141 "supporting %<.cfi_personality%> directive");
1142 }
1143}
1144
1145/* Output a marker (i.e. a label) for the end of the generated code
1146 for a function prologue. This gets called *after* the prologue code has
1147 been generated. */
1148
1149void
1150dwarf2out_vms_end_prologue (unsigned int line ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
1151 const char *file ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1152{
1153 char label[MAX_ARTIFICIAL_LABEL_BYTES40];
1154
1155 /* Output a label to mark the endpoint of the code generated for this
1156 function. */
1157 ASM_GENERATE_INTERNAL_LABEL (label, PROLOGUE_END_LABEL,do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LPE"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
1158 current_function_funcdef_no)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LPE"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
;
1159 ASM_OUTPUT_DEBUG_LABEL (asm_out_file, PROLOGUE_END_LABEL,(*targetm.asm_out.internal_label) (asm_out_file, "LPE", ((cfun
+ 0)->funcdef_no))
1160 current_function_funcdef_no)(*targetm.asm_out.internal_label) (asm_out_file, "LPE", ((cfun
+ 0)->funcdef_no))
;
1161 cfun(cfun + 0)->fde->dw_fde_vms_end_prologue = xstrdup (label);
1162}
1163
1164/* Output a marker (i.e. a label) for the beginning of the generated code
1165 for a function epilogue. This gets called *before* the prologue code has
1166 been generated. */
1167
1168void
1169dwarf2out_vms_begin_epilogue (unsigned int line ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
1170 const char *file ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1171{
1172 dw_fde_ref fde = cfun(cfun + 0)->fde;
1173 char label[MAX_ARTIFICIAL_LABEL_BYTES40];
1174
1175 if (fde->dw_fde_vms_begin_epilogue)
1176 return;
1177
1178 /* Output a label to mark the endpoint of the code generated for this
1179 function. */
1180 ASM_GENERATE_INTERNAL_LABEL (label, EPILOGUE_BEGIN_LABEL,do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LEB"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
1181 current_function_funcdef_no)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LEB"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
;
1182 ASM_OUTPUT_DEBUG_LABEL (asm_out_file, EPILOGUE_BEGIN_LABEL,(*targetm.asm_out.internal_label) (asm_out_file, "LEB", ((cfun
+ 0)->funcdef_no))
1183 current_function_funcdef_no)(*targetm.asm_out.internal_label) (asm_out_file, "LEB", ((cfun
+ 0)->funcdef_no))
;
1184 fde->dw_fde_vms_begin_epilogue = xstrdup (label);
1185}
1186
1187/* Mark the ranges of non-debug subsections in the std text sections. */
1188
1189static void
1190mark_ignored_debug_section (dw_fde_ref fde, bool second)
1191{
1192 bool std_section;
1193 const char *begin_label, *end_label;
1194 const char **last_end_label;
1195 vec<const char *, va_gc> **switch_ranges;
1196
1197 if (second)
1198 {
1199 std_section = fde->second_in_std_section;
1200 begin_label = fde->dw_fde_second_begin;
1201 end_label = fde->dw_fde_second_end;
1202 }
1203 else
1204 {
1205 std_section = fde->in_std_section;
1206 begin_label = fde->dw_fde_begin;
1207 end_label = fde->dw_fde_end;
1208 }
1209
1210 if (!std_section)
1211 return;
1212
1213 if (in_text_section_p)
1214 {
1215 last_end_label = &last_text_label;
1216 switch_ranges = &switch_text_ranges;
1217 }
1218 else
1219 {
1220 last_end_label = &last_cold_label;
1221 switch_ranges = &switch_cold_ranges;
1222 }
1223
1224 if (fde->ignored_debug)
1225 {
1226 if (*switch_ranges && !(vec_safe_length (*switch_ranges) & 1))
1227 vec_safe_push (*switch_ranges, *last_end_label);
1228 }
1229 else
1230 {
1231 *last_end_label = end_label;
1232
1233 if (!*switch_ranges)
1234 vec_alloc (*switch_ranges, 16);
1235 else if (vec_safe_length (*switch_ranges) & 1)
1236 vec_safe_push (*switch_ranges, begin_label);
1237 }
1238}
1239
1240/* Output a marker (i.e. a label) for the absolute end of the generated code
1241 for a function definition. This gets called *after* the epilogue code has
1242 been generated. */
1243
1244void
1245dwarf2out_end_epilogue (unsigned int line ATTRIBUTE_UNUSED__attribute__ ((__unused__)),
1246 const char *file ATTRIBUTE_UNUSED__attribute__ ((__unused__)))
1247{
1248 dw_fde_ref fde;
1249 char label[MAX_ARTIFICIAL_LABEL_BYTES40];
1250
1251 last_var_location_insn = NULLnullptr;
1252 cached_next_real_insn = NULLnullptr;
1253
1254 if (dwarf2out_do_cfi_asm ())
1255 fprintf (asm_out_file, "\t.cfi_endproc\n");
1256
1257 /* Output a label to mark the endpoint of the code generated for this
1258 function. */
1259 ASM_GENERATE_INTERNAL_LABEL (label, FUNC_END_LABEL,do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LFE"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
1260 current_function_funcdef_no)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LFE"); sprint_ul (__p, (unsigned long) ((
(cfun + 0)->funcdef_no))); } while (0)
;
1261 ASM_OUTPUT_LABEL (asm_out_file, label)do { assemble_name ((asm_out_file), (label)); fputs (":\n", (
asm_out_file)); } while (0)
;
1262 fde = cfun(cfun + 0)->fde;
1263 gcc_assert (fde != NULL)((void)(!(fde != nullptr) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 1263, __FUNCTION__), 0 : 0))
;
1264 if (fde->dw_fde_second_begin == NULLnullptr)
1265 fde->dw_fde_end = xstrdup (label);
1266
1267 mark_ignored_debug_section (fde, fde->dw_fde_second_begin != NULLnullptr);
1268}
1269
1270void
1271dwarf2out_frame_finish (void)
1272{
1273 /* Output call frame information. */
1274 if (targetm.debug_unwind_info () == UI_DWARF2)
1275 output_call_frame_info (0);
1276
1277 /* Output another copy for the unwinder. */
1278 if (do_eh_frame)
1279 output_call_frame_info (1);
1280}
1281
1282static void var_location_switch_text_section (void);
1283static void set_cur_line_info_table (section *);
1284
1285void
1286dwarf2out_switch_text_section (void)
1287{
1288 char label[MAX_ARTIFICIAL_LABEL_BYTES40];
1289 section *sect;
1290 dw_fde_ref fde = cfun(cfun + 0)->fde;
1291
1292 gcc_assert (cfun && fde && fde->dw_fde_second_begin == NULL)((void)(!((cfun + 0) && fde && fde->dw_fde_second_begin
== nullptr) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 1292, __FUNCTION__), 0 : 0))
;
1293
1294 ASM_GENERATE_INTERNAL_LABEL (label, FUNC_SECOND_SECT_LABEL,do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LFSB"); sprint_ul (__p, (unsigned long) (
((cfun + 0)->funcdef_no))); } while (0)
1295 current_function_funcdef_no)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LFSB"); sprint_ul (__p, (unsigned long) (
((cfun + 0)->funcdef_no))); } while (0)
;
1296
1297 fde->dw_fde_second_begin = ggc_strdup (label)ggc_alloc_string ((label), -1 );
1298 if (!in_cold_section_p)
1299 {
1300 fde->dw_fde_end = crtl(&x_rtl)->subsections.cold_section_end_label;
1301 fde->dw_fde_second_end = crtl(&x_rtl)->subsections.hot_section_end_label;
1302 }
1303 else
1304 {
1305 fde->dw_fde_end = crtl(&x_rtl)->subsections.hot_section_end_label;
1306 fde->dw_fde_second_end = crtl(&x_rtl)->subsections.cold_section_end_label;
1307 }
1308 have_multiple_function_sections = true;
1309
1310 if (dwarf2out_do_cfi_asm ())
1311 fprintf (asm_out_file, "\t.cfi_endproc\n");
1312
1313 mark_ignored_debug_section (fde, false);
1314
1315 /* Now do the real section switch. */
1316 sect = current_function_section ();
1317 switch_to_section (sect);
1318
1319 fde->second_in_std_section
1320 = (sect == text_section
1321 || (cold_text_section && sect == cold_text_section));
1322 in_text_section_p = sect == text_section;
1323
1324 if (dwarf2out_do_cfi_asm ())
1325 dwarf2out_do_cfi_startproc (true);
1326
1327 var_location_switch_text_section ();
1328
1329 if (cold_text_section != NULLnullptr)
1330 set_cur_line_info_table (sect);
1331}
1332
1333/* And now, the subset of the debugging information support code necessary
1334 for emitting location expressions. */
1335
1336/* Describe an entry into the .debug_addr section. */
1337
1338enum ate_kind {
1339 ate_kind_rtx,
1340 ate_kind_rtx_dtprel,
1341 ate_kind_label
1342};
1343
1344struct GTY((for_user)) addr_table_entry {
1345 enum ate_kind kind;
1346 unsigned int refcount;
1347 unsigned int index;
1348 union addr_table_entry_struct_union
1349 {
1350 rtx GTY ((tag ("0"))) rtl;
1351 char * GTY ((tag ("1"))) label;
1352 }
1353 GTY ((desc ("%1.kind"))) addr;
1354};
1355
1356typedef unsigned int var_loc_view;
1357
1358/* Location lists are ranges + location descriptions for that range,
1359 so you can track variables that are in different places over
1360 their entire life. */
1361typedef struct GTY(()) dw_loc_list_struct {
1362 dw_loc_list_ref dw_loc_next;
1363 const char *begin; /* Label and addr_entry for start of range */
1364 addr_table_entry *begin_entry;
1365 const char *end; /* Label for end of range */
1366 addr_table_entry *end_entry;
1367 char *ll_symbol; /* Label for beginning of location list.
1368 Only on head of list. */
1369 char *vl_symbol; /* Label for beginning of view list. Ditto. */
1370 const char *section; /* Section this loclist is relative to */
1371 dw_loc_descr_ref expr;
1372 var_loc_view vbegin, vend;
1373 hashval_t hash;
1374 /* True if all addresses in this and subsequent lists are known to be
1375 resolved. */
1376 bool resolved_addr;
1377 /* True if this list has been replaced by dw_loc_next. */
1378 bool replaced;
1379 /* True if it has been emitted into .debug_loc* / .debug_loclists*
1380 section. */
1381 unsigned char emitted : 1;
1382 /* True if hash field is index rather than hash value. */
1383 unsigned char num_assigned : 1;
1384 /* True if .debug_loclists.dwo offset has been emitted for it already. */
1385 unsigned char offset_emitted : 1;
1386 /* True if note_variable_value_in_expr has been called on it. */
1387 unsigned char noted_variable_value : 1;
1388 /* True if the range should be emitted even if begin and end
1389 are the same. */
1390 bool force;
1391} dw_loc_list_node;
1392
1393static dw_loc_descr_ref int_loc_descriptor (poly_int64);
1394static dw_loc_descr_ref uint_loc_descriptor (unsigned HOST_WIDE_INTlong);
1395
1396/* Convert a DWARF stack opcode into its string name. */
1397
1398static const char *
1399dwarf_stack_op_name (unsigned int op)
1400{
1401 const char *name = get_DW_OP_name (op);
1402
1403 if (name != NULLnullptr)
1404 return name;
1405
1406 return "OP_<unknown>";
1407}
1408
1409/* Return TRUE iff we're to output location view lists as a separate
1410 attribute next to the location lists, as an extension compatible
1411 with DWARF 2 and above. */
1412
1413static inline bool
1414dwarf2out_locviews_in_attribute ()
1415{
1416 return debug_variable_location_viewsglobal_options.x_debug_variable_location_views == 1;
1417}
1418
1419/* Return TRUE iff we're to output location view lists as part of the
1420 location lists, as proposed for standardization after DWARF 5. */
1421
1422static inline bool
1423dwarf2out_locviews_in_loclist ()
1424{
1425#ifndef DW_LLE_view_pairDW_LLE_GNU_view_pair
1426 return false;
1427#else
1428 return debug_variable_location_viewsglobal_options.x_debug_variable_location_views == -1;
1429#endif
1430}
1431
1432/* Return a pointer to a newly allocated location description. Location
1433 descriptions are simple expression terms that can be strung
1434 together to form more complicated location (address) descriptions. */
1435
1436static inline dw_loc_descr_ref
1437new_loc_descr (enum dwarf_location_atom op, unsigned HOST_WIDE_INTlong oprnd1,
1438 unsigned HOST_WIDE_INTlong oprnd2)
1439{
1440 dw_loc_descr_ref descr = ggc_cleared_alloc<dw_loc_descr_node> ();
1441
1442 descr->dw_loc_opc = op;
1443 descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
1444 descr->dw_loc_oprnd1.val_entry = NULLnullptr;
1445 descr->dw_loc_oprnd1.v.val_unsigned = oprnd1;
1446 descr->dw_loc_oprnd2.val_class = dw_val_class_unsigned_const;
1447 descr->dw_loc_oprnd2.val_entry = NULLnullptr;
1448 descr->dw_loc_oprnd2.v.val_unsigned = oprnd2;
1449
1450 return descr;
1451}
1452
1453/* Add a location description term to a location description expression. */
1454
1455static inline void
1456add_loc_descr (dw_loc_descr_ref *list_head, dw_loc_descr_ref descr)
1457{
1458 dw_loc_descr_ref *d;
1459
1460 /* Find the end of the chain. */
1461 for (d = list_head; (*d) != NULLnullptr; d = &(*d)->dw_loc_next)
1462 ;
1463
1464 *d = descr;
1465}
1466
1467/* Compare two location operands for exact equality. */
1468
1469static bool
1470dw_val_equal_p (dw_val_node *a, dw_val_node *b)
1471{
1472 if (a->val_class != b->val_class)
1473 return false;
1474 switch (a->val_class)
1475 {
1476 case dw_val_class_none:
1477 return true;
1478 case dw_val_class_addr:
1479 return rtx_equal_p (a->v.val_addr, b->v.val_addr);
1480
1481 case dw_val_class_offset:
1482 case dw_val_class_unsigned_const:
1483 case dw_val_class_const:
1484 case dw_val_class_unsigned_const_implicit:
1485 case dw_val_class_const_implicit:
1486 case dw_val_class_range_list:
1487 /* These are all HOST_WIDE_INT, signed or unsigned. */
1488 return a->v.val_unsigned == b->v.val_unsigned;
1489
1490 case dw_val_class_loc:
1491 return a->v.val_loc == b->v.val_loc;
1492 case dw_val_class_loc_list:
1493 return a->v.val_loc_list == b->v.val_loc_list;
1494 case dw_val_class_view_list:
1495 return a->v.val_view_list == b->v.val_view_list;
1496 case dw_val_class_die_ref:
1497 return a->v.val_die_ref.die == b->v.val_die_ref.die;
1498 case dw_val_class_fde_ref:
1499 return a->v.val_fde_index == b->v.val_fde_index;
1500 case dw_val_class_symview:
1501 return strcmp (a->v.val_symbolic_view, b->v.val_symbolic_view) == 0;
1502 case dw_val_class_lbl_id:
1503 case dw_val_class_lineptr:
1504 case dw_val_class_macptr:
1505 case dw_val_class_loclistsptr:
1506 case dw_val_class_high_pc:
1507 return strcmp (a->v.val_lbl_id, b->v.val_lbl_id) == 0;
1508 case dw_val_class_str:
1509 return a->v.val_str == b->v.val_str;
1510 case dw_val_class_flag:
1511 return a->v.val_flag == b->v.val_flag;
1512 case dw_val_class_file:
1513 case dw_val_class_file_implicit:
1514 return a->v.val_file == b->v.val_file;
1515 case dw_val_class_decl_ref:
1516 return a->v.val_decl_ref == b->v.val_decl_ref;
1517
1518 case dw_val_class_const_double:
1519 return (a->v.val_double.high == b->v.val_double.high
1520 && a->v.val_double.low == b->v.val_double.low);
1521
1522 case dw_val_class_wide_int:
1523 return *a->v.val_wide == *b->v.val_wide;
1524
1525 case dw_val_class_vec:
1526 {
1527 size_t a_len = a->v.val_vec.elt_size * a->v.val_vec.length;
1528 size_t b_len = b->v.val_vec.elt_size * b->v.val_vec.length;
1529
1530 return (a_len == b_len
1531 && !memcmp (a->v.val_vec.array, b->v.val_vec.array, a_len));
1532 }
1533
1534 case dw_val_class_data8:
1535 return memcmp (a->v.val_data8, b->v.val_data8, 8) == 0;
1536
1537 case dw_val_class_vms_delta:
1538 return (!strcmp (a->v.val_vms_delta.lbl1, b->v.val_vms_delta.lbl1)
1539 && !strcmp (a->v.val_vms_delta.lbl2, b->v.val_vms_delta.lbl2));
1540
1541 case dw_val_class_discr_value:
1542 return (a->v.val_discr_value.pos == b->v.val_discr_value.pos
1543 && a->v.val_discr_value.v.uval == b->v.val_discr_value.v.uval);
1544 case dw_val_class_discr_list:
1545 /* It makes no sense comparing two discriminant value lists. */
1546 return false;
1547 }
1548 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 1548, __FUNCTION__))
;
1549}
1550
1551/* Compare two location atoms for exact equality. */
1552
1553static bool
1554loc_descr_equal_p_1 (dw_loc_descr_ref a, dw_loc_descr_ref b)
1555{
1556 if (a->dw_loc_opc != b->dw_loc_opc)
1557 return false;
1558
1559 /* ??? This is only ever set for DW_OP_constNu, for N equal to the
1560 address size, but since we always allocate cleared storage it
1561 should be zero for other types of locations. */
1562 if (a->dtprel != b->dtprel)
1563 return false;
1564
1565 return (dw_val_equal_p (&a->dw_loc_oprnd1, &b->dw_loc_oprnd1)
1566 && dw_val_equal_p (&a->dw_loc_oprnd2, &b->dw_loc_oprnd2));
1567}
1568
1569/* Compare two complete location expressions for exact equality. */
1570
1571bool
1572loc_descr_equal_p (dw_loc_descr_ref a, dw_loc_descr_ref b)
1573{
1574 while (1)
1575 {
1576 if (a == b)
1577 return true;
1578 if (a == NULLnullptr || b == NULLnullptr)
1579 return false;
1580 if (!loc_descr_equal_p_1 (a, b))
1581 return false;
1582
1583 a = a->dw_loc_next;
1584 b = b->dw_loc_next;
1585 }
1586}
1587
1588
1589/* Add a constant POLY_OFFSET to a location expression. */
1590
1591static void
1592loc_descr_plus_const (dw_loc_descr_ref *list_head, poly_int64 poly_offset)
1593{
1594 dw_loc_descr_ref loc;
1595 HOST_WIDE_INTlong *p;
1596
1597 gcc_assert (*list_head != NULL)((void)(!(*list_head != nullptr) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 1597, __FUNCTION__), 0 : 0))
;
1598
1599 if (known_eq (poly_offset, 0)(!maybe_ne (poly_offset, 0)))
1600 return;
1601
1602 /* Find the end of the chain. */
1603 for (loc = *list_head; loc->dw_loc_next != NULLnullptr; loc = loc->dw_loc_next)
1604 ;
1605
1606 HOST_WIDE_INTlong offset;
1607 if (!poly_offset.is_constant (&offset))
1608 {
1609 loc->dw_loc_next = int_loc_descriptor (poly_offset);
1610 add_loc_descr (&loc->dw_loc_next, new_loc_descr (DW_OP_plus, 0, 0));
1611 return;
1612 }
1613
1614 p = NULLnullptr;
1615 if (loc->dw_loc_opc == DW_OP_fbreg
1616 || (loc->dw_loc_opc >= DW_OP_breg0 && loc->dw_loc_opc <= DW_OP_breg31))
1617 p = &loc->dw_loc_oprnd1.v.val_int;
1618 else if (loc->dw_loc_opc == DW_OP_bregx)
1619 p = &loc->dw_loc_oprnd2.v.val_int;
1620
1621 /* If the last operation is fbreg, breg{0..31,x}, optimize by adjusting its
1622 offset. Don't optimize if an signed integer overflow would happen. */
1623 if (p != NULLnullptr
1624 && ((offset > 0 && *p <= INTTYPE_MAXIMUM (HOST_WIDE_INT)((long) (~ (long) 0 - ((long) ((! ((long) 0 < (long) -1)) ?
(long) 1 << (sizeof (long) * 8 - 1) : (long) 0))))
- offset)
1625 || (offset < 0 && *p >= INTTYPE_MINIMUM (HOST_WIDE_INT)((long) ((! ((long) 0 < (long) -1)) ? (long) 1 << (sizeof
(long) * 8 - 1) : (long) 0))
- offset)))
1626 *p += offset;
1627
1628 else if (offset > 0)
1629 loc->dw_loc_next = new_loc_descr (DW_OP_plus_uconst, offset, 0);
1630
1631 else
1632 {
1633 loc->dw_loc_next
1634 = uint_loc_descriptor (-(unsigned HOST_WIDE_INTlong) offset);
1635 add_loc_descr (&loc->dw_loc_next, new_loc_descr (DW_OP_minus, 0, 0));
1636 }
1637}
1638
1639/* Return a pointer to a newly allocated location description for
1640 REG and OFFSET. */
1641
1642static inline dw_loc_descr_ref
1643new_reg_loc_descr (unsigned int reg, poly_int64 offset)
1644{
1645 HOST_WIDE_INTlong const_offset;
1646 if (offset.is_constant (&const_offset))
1647 {
1648 if (reg <= 31)
1649 return new_loc_descr ((enum dwarf_location_atom) (DW_OP_breg0 + reg),
1650 const_offset, 0);
1651 else
1652 return new_loc_descr (DW_OP_bregx, reg, const_offset);
1653 }
1654 else
1655 {
1656 dw_loc_descr_ref ret = new_reg_loc_descr (reg, 0);
1657 loc_descr_plus_const (&ret, offset);
1658 return ret;
1659 }
1660}
1661
1662/* Add a constant OFFSET to a location list. */
1663
1664static void
1665loc_list_plus_const (dw_loc_list_ref list_head, poly_int64 offset)
1666{
1667 dw_loc_list_ref d;
1668 for (d = list_head; d != NULLnullptr; d = d->dw_loc_next)
1669 loc_descr_plus_const (&d->expr, offset);
1670}
1671
1672#define DWARF_REF_SIZE(global_options.x_dwarf_version == 2 ? (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) : global_options.x_dwarf_offset_size)
\
1673 (dwarf_versionglobal_options.x_dwarf_version == 2 ? DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
: dwarf_offset_sizeglobal_options.x_dwarf_offset_size)
1674
1675/* The number of bits that can be encoded by largest DW_FORM_dataN.
1676 In DWARF4 and earlier it is DW_FORM_data8 with 64 bits, in DWARF5
1677 DW_FORM_data16 with 128 bits. */
1678#define DWARF_LARGEST_DATA_FORM_BITS(global_options.x_dwarf_version >= 5 ? 128 : 64) \
1679 (dwarf_versionglobal_options.x_dwarf_version >= 5 ? 128 : 64)
1680
1681/* Utility inline function for construction of ops that were GNU extension
1682 before DWARF 5. */
1683static inline enum dwarf_location_atom
1684dwarf_OP (enum dwarf_location_atom op)
1685{
1686 switch (op)
1687 {
1688 case DW_OP_implicit_pointer:
1689 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1690 return DW_OP_GNU_implicit_pointer;
1691 break;
1692
1693 case DW_OP_entry_value:
1694 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1695 return DW_OP_GNU_entry_value;
1696 break;
1697
1698 case DW_OP_const_type:
1699 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1700 return DW_OP_GNU_const_type;
1701 break;
1702
1703 case DW_OP_regval_type:
1704 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1705 return DW_OP_GNU_regval_type;
1706 break;
1707
1708 case DW_OP_deref_type:
1709 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1710 return DW_OP_GNU_deref_type;
1711 break;
1712
1713 case DW_OP_convert:
1714 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1715 return DW_OP_GNU_convert;
1716 break;
1717
1718 case DW_OP_reinterpret:
1719 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1720 return DW_OP_GNU_reinterpret;
1721 break;
1722
1723 case DW_OP_addrx:
1724 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1725 return DW_OP_GNU_addr_index;
1726 break;
1727
1728 case DW_OP_constx:
1729 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1730 return DW_OP_GNU_const_index;
1731 break;
1732
1733 default:
1734 break;
1735 }
1736 return op;
1737}
1738
1739/* Similarly for attributes. */
1740static inline enum dwarf_attribute
1741dwarf_AT (enum dwarf_attribute at)
1742{
1743 switch (at)
1744 {
1745 case DW_AT_call_return_pc:
1746 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1747 return DW_AT_low_pc;
1748 break;
1749
1750 case DW_AT_call_tail_call:
1751 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1752 return DW_AT_GNU_tail_call;
1753 break;
1754
1755 case DW_AT_call_origin:
1756 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1757 return DW_AT_abstract_origin;
1758 break;
1759
1760 case DW_AT_call_target:
1761 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1762 return DW_AT_GNU_call_site_target;
1763 break;
1764
1765 case DW_AT_call_target_clobbered:
1766 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1767 return DW_AT_GNU_call_site_target_clobbered;
1768 break;
1769
1770 case DW_AT_call_parameter:
1771 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1772 return DW_AT_abstract_origin;
1773 break;
1774
1775 case DW_AT_call_value:
1776 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1777 return DW_AT_GNU_call_site_value;
1778 break;
1779
1780 case DW_AT_call_data_value:
1781 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1782 return DW_AT_GNU_call_site_data_value;
1783 break;
1784
1785 case DW_AT_call_all_calls:
1786 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1787 return DW_AT_GNU_all_call_sites;
1788 break;
1789
1790 case DW_AT_call_all_tail_calls:
1791 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1792 return DW_AT_GNU_all_tail_call_sites;
1793 break;
1794
1795 case DW_AT_dwo_name:
1796 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1797 return DW_AT_GNU_dwo_name;
1798 break;
1799
1800 case DW_AT_addr_base:
1801 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1802 return DW_AT_GNU_addr_base;
1803 break;
1804
1805 default:
1806 break;
1807 }
1808 return at;
1809}
1810
1811/* And similarly for tags. */
1812static inline enum dwarf_tag
1813dwarf_TAG (enum dwarf_tag tag)
1814{
1815 switch (tag)
1816 {
1817 case DW_TAG_call_site:
1818 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1819 return DW_TAG_GNU_call_site;
1820 break;
1821
1822 case DW_TAG_call_site_parameter:
1823 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1824 return DW_TAG_GNU_call_site_parameter;
1825 break;
1826
1827 default:
1828 break;
1829 }
1830 return tag;
1831}
1832
1833/* And similarly for forms. */
1834static inline enum dwarf_form
1835dwarf_FORM (enum dwarf_form form)
1836{
1837 switch (form)
1838 {
1839 case DW_FORM_addrx:
1840 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1841 return DW_FORM_GNU_addr_index;
1842 break;
1843
1844 case DW_FORM_strx:
1845 if (dwarf_versionglobal_options.x_dwarf_version < 5)
1846 return DW_FORM_GNU_str_index;
1847 break;
1848
1849 default:
1850 break;
1851 }
1852 return form;
1853}
1854
1855static unsigned long int get_base_type_offset (dw_die_ref);
1856
1857/* Return the size of a location descriptor. */
1858
1859static unsigned long
1860size_of_loc_descr (dw_loc_descr_ref loc)
1861{
1862 unsigned long size = 1;
1863
1864 switch (loc->dw_loc_opc)
1865 {
1866 case DW_OP_addr:
1867 size += DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
;
1868 break;
1869 case DW_OP_GNU_addr_index:
1870 case DW_OP_addrx:
1871 case DW_OP_GNU_const_index:
1872 case DW_OP_constx:
1873 gcc_assert (loc->dw_loc_oprnd1.val_entry->index != NO_INDEX_ASSIGNED)((void)(!(loc->dw_loc_oprnd1.val_entry->index != (-2U))
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 1873, __FUNCTION__), 0 : 0))
;
1874 size += size_of_uleb128 (loc->dw_loc_oprnd1.val_entry->index);
1875 break;
1876 case DW_OP_const1u:
1877 case DW_OP_const1s:
1878 size += 1;
1879 break;
1880 case DW_OP_const2u:
1881 case DW_OP_const2s:
1882 size += 2;
1883 break;
1884 case DW_OP_const4u:
1885 case DW_OP_const4s:
1886 size += 4;
1887 break;
1888 case DW_OP_const8u:
1889 case DW_OP_const8s:
1890 size += 8;
1891 break;
1892 case DW_OP_constu:
1893 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
1894 break;
1895 case DW_OP_consts:
1896 size += size_of_sleb128 (loc->dw_loc_oprnd1.v.val_int);
1897 break;
1898 case DW_OP_pick:
1899 size += 1;
1900 break;
1901 case DW_OP_plus_uconst:
1902 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
1903 break;
1904 case DW_OP_skip:
1905 case DW_OP_bra:
1906 size += 2;
1907 break;
1908 case DW_OP_breg0:
1909 case DW_OP_breg1:
1910 case DW_OP_breg2:
1911 case DW_OP_breg3:
1912 case DW_OP_breg4:
1913 case DW_OP_breg5:
1914 case DW_OP_breg6:
1915 case DW_OP_breg7:
1916 case DW_OP_breg8:
1917 case DW_OP_breg9:
1918 case DW_OP_breg10:
1919 case DW_OP_breg11:
1920 case DW_OP_breg12:
1921 case DW_OP_breg13:
1922 case DW_OP_breg14:
1923 case DW_OP_breg15:
1924 case DW_OP_breg16:
1925 case DW_OP_breg17:
1926 case DW_OP_breg18:
1927 case DW_OP_breg19:
1928 case DW_OP_breg20:
1929 case DW_OP_breg21:
1930 case DW_OP_breg22:
1931 case DW_OP_breg23:
1932 case DW_OP_breg24:
1933 case DW_OP_breg25:
1934 case DW_OP_breg26:
1935 case DW_OP_breg27:
1936 case DW_OP_breg28:
1937 case DW_OP_breg29:
1938 case DW_OP_breg30:
1939 case DW_OP_breg31:
1940 size += size_of_sleb128 (loc->dw_loc_oprnd1.v.val_int);
1941 break;
1942 case DW_OP_regx:
1943 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
1944 break;
1945 case DW_OP_fbreg:
1946 size += size_of_sleb128 (loc->dw_loc_oprnd1.v.val_int);
1947 break;
1948 case DW_OP_bregx:
1949 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
1950 size += size_of_sleb128 (loc->dw_loc_oprnd2.v.val_int);
1951 break;
1952 case DW_OP_piece:
1953 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
1954 break;
1955 case DW_OP_bit_piece:
1956 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
1957 size += size_of_uleb128 (loc->dw_loc_oprnd2.v.val_unsigned);
1958 break;
1959 case DW_OP_deref_size:
1960 case DW_OP_xderef_size:
1961 size += 1;
1962 break;
1963 case DW_OP_call2:
1964 size += 2;
1965 break;
1966 case DW_OP_call4:
1967 size += 4;
1968 break;
1969 case DW_OP_call_ref:
1970 case DW_OP_GNU_variable_value:
1971 size += DWARF_REF_SIZE(global_options.x_dwarf_version == 2 ? (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) : global_options.x_dwarf_offset_size)
;
1972 break;
1973 case DW_OP_implicit_value:
1974 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned)
1975 + loc->dw_loc_oprnd1.v.val_unsigned;
1976 break;
1977 case DW_OP_implicit_pointer:
1978 case DW_OP_GNU_implicit_pointer:
1979 size += DWARF_REF_SIZE(global_options.x_dwarf_version == 2 ? (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) : global_options.x_dwarf_offset_size)
+ size_of_sleb128 (loc->dw_loc_oprnd2.v.val_int);
1980 break;
1981 case DW_OP_entry_value:
1982 case DW_OP_GNU_entry_value:
1983 {
1984 unsigned long op_size = size_of_locs (loc->dw_loc_oprnd1.v.val_loc);
1985 size += size_of_uleb128 (op_size) + op_size;
1986 break;
1987 }
1988 case DW_OP_const_type:
1989 case DW_OP_GNU_const_type:
1990 {
1991 unsigned long o
1992 = get_base_type_offset (loc->dw_loc_oprnd1.v.val_die_ref.die);
1993 size += size_of_uleb128 (o) + 1;
1994 switch (loc->dw_loc_oprnd2.val_class)
1995 {
1996 case dw_val_class_vec:
1997 size += loc->dw_loc_oprnd2.v.val_vec.length
1998 * loc->dw_loc_oprnd2.v.val_vec.elt_size;
1999 break;
2000 case dw_val_class_const:
2001 size += HOST_BITS_PER_WIDE_INT64 / BITS_PER_UNIT(8);
2002 break;
2003 case dw_val_class_const_double:
2004 size += HOST_BITS_PER_DOUBLE_INT(2 * 64) / BITS_PER_UNIT(8);
2005 break;
2006 case dw_val_class_wide_int:
2007 size += (get_full_len (*loc->dw_loc_oprnd2.v.val_wide)
2008 * HOST_BITS_PER_WIDE_INT64 / BITS_PER_UNIT(8));
2009 break;
2010 default:
2011 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2011, __FUNCTION__))
;
2012 }
2013 break;
2014 }
2015 case DW_OP_regval_type:
2016 case DW_OP_GNU_regval_type:
2017 {
2018 unsigned long o
2019 = get_base_type_offset (loc->dw_loc_oprnd2.v.val_die_ref.die);
2020 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned)
2021 + size_of_uleb128 (o);
2022 }
2023 break;
2024 case DW_OP_deref_type:
2025 case DW_OP_GNU_deref_type:
2026 {
2027 unsigned long o
2028 = get_base_type_offset (loc->dw_loc_oprnd2.v.val_die_ref.die);
2029 size += 1 + size_of_uleb128 (o);
2030 }
2031 break;
2032 case DW_OP_convert:
2033 case DW_OP_reinterpret:
2034 case DW_OP_GNU_convert:
2035 case DW_OP_GNU_reinterpret:
2036 if (loc->dw_loc_oprnd1.val_class == dw_val_class_unsigned_const)
2037 size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
2038 else
2039 {
2040 unsigned long o
2041 = get_base_type_offset (loc->dw_loc_oprnd1.v.val_die_ref.die);
2042 size += size_of_uleb128 (o);
2043 }
2044 break;
2045 case DW_OP_GNU_parameter_ref:
2046 size += 4;
2047 break;
2048 default:
2049 break;
2050 }
2051
2052 return size;
2053}
2054
2055/* Return the size of a series of location descriptors. */
2056
2057unsigned long
2058size_of_locs (dw_loc_descr_ref loc)
2059{
2060 dw_loc_descr_ref l;
2061 unsigned long size;
2062
2063 /* If there are no skip or bra opcodes, don't fill in the dw_loc_addr
2064 field, to avoid writing to a PCH file. */
2065 for (size = 0, l = loc; l != NULLnullptr; l = l->dw_loc_next)
2066 {
2067 if (l->dw_loc_opc == DW_OP_skip || l->dw_loc_opc == DW_OP_bra)
2068 break;
2069 size += size_of_loc_descr (l);
2070 }
2071 if (! l)
2072 return size;
2073
2074 for (size = 0, l = loc; l != NULLnullptr; l = l->dw_loc_next)
2075 {
2076 l->dw_loc_addr = size;
2077 size += size_of_loc_descr (l);
2078 }
2079
2080 return size;
2081}
2082
2083/* Return the size of the value in a DW_AT_discr_value attribute. */
2084
2085static int
2086size_of_discr_value (dw_discr_value *discr_value)
2087{
2088 if (discr_value->pos)
2089 return size_of_uleb128 (discr_value->v.uval);
2090 else
2091 return size_of_sleb128 (discr_value->v.sval);
2092}
2093
2094/* Return the size of the value in a DW_AT_discr_list attribute. */
2095
2096static int
2097size_of_discr_list (dw_discr_list_ref discr_list)
2098{
2099 int size = 0;
2100
2101 for (dw_discr_list_ref list = discr_list;
2102 list != NULLnullptr;
2103 list = list->dw_discr_next)
2104 {
2105 /* One byte for the discriminant value descriptor, and then one or two
2106 LEB128 numbers, depending on whether it's a single case label or a
2107 range label. */
2108 size += 1;
2109 size += size_of_discr_value (&list->dw_discr_lower_bound);
2110 if (list->dw_discr_range != 0)
2111 size += size_of_discr_value (&list->dw_discr_upper_bound);
2112 }
2113 return size;
2114}
2115
2116static HOST_WIDE_INTlong extract_int (const unsigned char *, unsigned);
2117static void get_ref_die_offset_label (char *, dw_die_ref);
2118static unsigned long int get_ref_die_offset (dw_die_ref);
2119
2120/* Output location description stack opcode's operands (if any).
2121 The for_eh_or_skip parameter controls whether register numbers are
2122 converted using DWARF2_FRAME_REG_OUT, which is needed in the case that
2123 hard reg numbers have been processed via DWARF_FRAME_REGNUM (i.e. for unwind
2124 info). This should be suppressed for the cases that have not been converted
2125 (i.e. symbolic debug info), by setting the parameter < 0. See PR47324. */
2126
2127static void
2128output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip)
2129{
2130 dw_val_ref val1 = &loc->dw_loc_oprnd1;
2131 dw_val_ref val2 = &loc->dw_loc_oprnd2;
2132
2133 switch (loc->dw_loc_opc)
2134 {
2135#ifdef DWARF2_DEBUGGING_INFO1
2136 case DW_OP_const2u:
2137 case DW_OP_const2s:
2138 dw2_asm_output_data (2, val1->v.val_int, NULLnullptr);
2139 break;
2140 case DW_OP_const4u:
2141 if (loc->dtprel)
2142 {
2143 gcc_assert (targetm.asm_out.output_dwarf_dtprel)((void)(!(targetm.asm_out.output_dwarf_dtprel) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2143, __FUNCTION__), 0 : 0))
;
2144 targetm.asm_out.output_dwarf_dtprel (asm_out_file, 4,
2145 val1->v.val_addr);
2146 fputc ('\n', asm_out_file);
2147 break;
2148 }
2149 /* FALLTHRU */
2150 case DW_OP_const4s:
2151 dw2_asm_output_data (4, val1->v.val_int, NULLnullptr);
2152 break;
2153 case DW_OP_const8u:
2154 if (loc->dtprel)
2155 {
2156 gcc_assert (targetm.asm_out.output_dwarf_dtprel)((void)(!(targetm.asm_out.output_dwarf_dtprel) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2156, __FUNCTION__), 0 : 0))
;
2157 targetm.asm_out.output_dwarf_dtprel (asm_out_file, 8,
2158 val1->v.val_addr);
2159 fputc ('\n', asm_out_file);
2160 break;
2161 }
2162 /* FALLTHRU */
2163 case DW_OP_const8s:
2164 gcc_assert (HOST_BITS_PER_WIDE_INT >= 64)((void)(!(64 >= 64) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2164, __FUNCTION__), 0 : 0))
;
2165 dw2_asm_output_data (8, val1->v.val_int, NULLnullptr);
2166 break;
2167 case DW_OP_skip:
2168 case DW_OP_bra:
2169 {
2170 int offset;
2171
2172 gcc_assert (val1->val_class == dw_val_class_loc)((void)(!(val1->val_class == dw_val_class_loc) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2172, __FUNCTION__), 0 : 0))
;
2173 offset = val1->v.val_loc->dw_loc_addr - (loc->dw_loc_addr + 3);
2174
2175 dw2_asm_output_data (2, offset, NULLnullptr);
2176 }
2177 break;
2178 case DW_OP_implicit_value:
2179 dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULLnullptr);
2180 switch (val2->val_class)
2181 {
2182 case dw_val_class_const:
2183 dw2_asm_output_data (val1->v.val_unsigned, val2->v.val_int, NULLnullptr);
2184 break;
2185 case dw_val_class_vec:
2186 {
2187 unsigned int elt_size = val2->v.val_vec.elt_size;
2188 unsigned int len = val2->v.val_vec.length;
2189 unsigned int i;
2190 unsigned char *p;
2191
2192 if (elt_size > sizeof (HOST_WIDE_INTlong))
2193 {
2194 elt_size /= 2;
2195 len *= 2;
2196 }
2197 for (i = 0, p = (unsigned char *) val2->v.val_vec.array;
2198 i < len;
2199 i++, p += elt_size)
2200 dw2_asm_output_data (elt_size, extract_int (p, elt_size),
2201 "fp or vector constant word %u", i);
2202 }
2203 break;
2204 case dw_val_class_const_double:
2205 {
2206 unsigned HOST_WIDE_INTlong first, second;
2207
2208 if (WORDS_BIG_ENDIAN0)
2209 {
2210 first = val2->v.val_double.high;
2211 second = val2->v.val_double.low;
2212 }
2213 else
2214 {
2215 first = val2->v.val_double.low;
2216 second = val2->v.val_double.high;
2217 }
2218 dw2_asm_output_data (HOST_BITS_PER_WIDE_INT64 / HOST_BITS_PER_CHAR8,
2219 first, NULLnullptr);
2220 dw2_asm_output_data (HOST_BITS_PER_WIDE_INT64 / HOST_BITS_PER_CHAR8,
2221 second, NULLnullptr);
2222 }
2223 break;
2224 case dw_val_class_wide_int:
2225 {
2226 int i;
2227 int len = get_full_len (*val2->v.val_wide);
2228 if (WORDS_BIG_ENDIAN0)
2229 for (i = len - 1; i >= 0; --i)
2230 dw2_asm_output_data (HOST_BITS_PER_WIDE_INT64 / HOST_BITS_PER_CHAR8,
2231 val2->v.val_wide->elt (i), NULLnullptr);
2232 else
2233 for (i = 0; i < len; ++i)
2234 dw2_asm_output_data (HOST_BITS_PER_WIDE_INT64 / HOST_BITS_PER_CHAR8,
2235 val2->v.val_wide->elt (i), NULLnullptr);
2236 }
2237 break;
2238 case dw_val_class_addr:
2239 gcc_assert (val1->v.val_unsigned == DWARF2_ADDR_SIZE)((void)(!(val1->v.val_unsigned == (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2239, __FUNCTION__), 0 : 0))
;
2240 dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
, val2->v.val_addr, NULLnullptr);
2241 break;
2242 default:
2243 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2243, __FUNCTION__))
;
2244 }
2245 break;
2246#else
2247 case DW_OP_const2u:
2248 case DW_OP_const2s:
2249 case DW_OP_const4u:
2250 case DW_OP_const4s:
2251 case DW_OP_const8u:
2252 case DW_OP_const8s:
2253 case DW_OP_skip:
2254 case DW_OP_bra:
2255 case DW_OP_implicit_value:
2256 /* We currently don't make any attempt to make sure these are
2257 aligned properly like we do for the main unwind info, so
2258 don't support emitting things larger than a byte if we're
2259 only doing unwinding. */
2260 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2260, __FUNCTION__))
;
2261#endif
2262 case DW_OP_const1u:
2263 case DW_OP_const1s:
2264 dw2_asm_output_data (1, val1->v.val_int, NULLnullptr);
2265 break;
2266 case DW_OP_constu:
2267 dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULLnullptr);
2268 break;
2269 case DW_OP_consts:
2270 dw2_asm_output_data_sleb128 (val1->v.val_int, NULLnullptr);
2271 break;
2272 case DW_OP_pick:
2273 dw2_asm_output_data (1, val1->v.val_int, NULLnullptr);
2274 break;
2275 case DW_OP_plus_uconst:
2276 dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULLnullptr);
2277 break;
2278 case DW_OP_breg0:
2279 case DW_OP_breg1:
2280 case DW_OP_breg2:
2281 case DW_OP_breg3:
2282 case DW_OP_breg4:
2283 case DW_OP_breg5:
2284 case DW_OP_breg6:
2285 case DW_OP_breg7:
2286 case DW_OP_breg8:
2287 case DW_OP_breg9:
2288 case DW_OP_breg10:
2289 case DW_OP_breg11:
2290 case DW_OP_breg12:
2291 case DW_OP_breg13:
2292 case DW_OP_breg14:
2293 case DW_OP_breg15:
2294 case DW_OP_breg16:
2295 case DW_OP_breg17:
2296 case DW_OP_breg18:
2297 case DW_OP_breg19:
2298 case DW_OP_breg20:
2299 case DW_OP_breg21:
2300 case DW_OP_breg22:
2301 case DW_OP_breg23:
2302 case DW_OP_breg24:
2303 case DW_OP_breg25:
2304 case DW_OP_breg26:
2305 case DW_OP_breg27:
2306 case DW_OP_breg28:
2307 case DW_OP_breg29:
2308 case DW_OP_breg30:
2309 case DW_OP_breg31:
2310 dw2_asm_output_data_sleb128 (val1->v.val_int, NULLnullptr);
2311 break;
2312 case DW_OP_regx:
2313 {
2314 unsigned r = val1->v.val_unsigned;
2315 if (for_eh_or_skip >= 0)
2316 r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip)(r);
2317 gcc_assert (size_of_uleb128 (r)((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2318, __FUNCTION__), 0 : 0))
2318 == size_of_uleb128 (val1->v.val_unsigned))((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2318, __FUNCTION__), 0 : 0))
;
2319 dw2_asm_output_data_uleb128 (r, NULLnullptr);
2320 }
2321 break;
2322 case DW_OP_fbreg:
2323 dw2_asm_output_data_sleb128 (val1->v.val_int, NULLnullptr);
2324 break;
2325 case DW_OP_bregx:
2326 {
2327 unsigned r = val1->v.val_unsigned;
2328 if (for_eh_or_skip >= 0)
2329 r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip)(r);
2330 gcc_assert (size_of_uleb128 (r)((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2331, __FUNCTION__), 0 : 0))
2331 == size_of_uleb128 (val1->v.val_unsigned))((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2331, __FUNCTION__), 0 : 0))
;
2332 dw2_asm_output_data_uleb128 (r, NULLnullptr);
2333 dw2_asm_output_data_sleb128 (val2->v.val_int, NULLnullptr);
2334 }
2335 break;
2336 case DW_OP_piece:
2337 dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULLnullptr);
2338 break;
2339 case DW_OP_bit_piece:
2340 dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULLnullptr);
2341 dw2_asm_output_data_uleb128 (val2->v.val_unsigned, NULLnullptr);
2342 break;
2343 case DW_OP_deref_size:
2344 case DW_OP_xderef_size:
2345 dw2_asm_output_data (1, val1->v.val_int, NULLnullptr);
2346 break;
2347
2348 case DW_OP_addr:
2349 if (loc->dtprel)
2350 {
2351 if (targetm.asm_out.output_dwarf_dtprel)
2352 {
2353 targetm.asm_out.output_dwarf_dtprel (asm_out_file,
2354 DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
,
2355 val1->v.val_addr);
2356 fputc ('\n', asm_out_file);
2357 }
2358 else
2359 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2359, __FUNCTION__))
;
2360 }
2361 else
2362 {
2363#ifdef DWARF2_DEBUGGING_INFO1
2364 dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
, val1->v.val_addr, NULLnullptr);
2365#else
2366 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2366, __FUNCTION__))
;
2367#endif
2368 }
2369 break;
2370
2371 case DW_OP_GNU_addr_index:
2372 case DW_OP_addrx:
2373 case DW_OP_GNU_const_index:
2374 case DW_OP_constx:
2375 gcc_assert (loc->dw_loc_oprnd1.val_entry->index != NO_INDEX_ASSIGNED)((void)(!(loc->dw_loc_oprnd1.val_entry->index != (-2U))
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2375, __FUNCTION__), 0 : 0))
;
2376 dw2_asm_output_data_uleb128 (loc->dw_loc_oprnd1.val_entry->index,
2377 "(index into .debug_addr)");
2378 break;
2379
2380 case DW_OP_call2:
2381 case DW_OP_call4:
2382 {
2383 unsigned long die_offset
2384 = get_ref_die_offset (val1->v.val_die_ref.die);
2385 /* Make sure the offset has been computed and that we can encode it as
2386 an operand. */
2387 gcc_assert (die_offset > 0((void)(!(die_offset > 0 && die_offset <= (loc->
dw_loc_opc == DW_OP_call2 ? 0xffff : 0xffffffff)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2390, __FUNCTION__), 0 : 0))
2388 && die_offset <= (loc->dw_loc_opc == DW_OP_call2((void)(!(die_offset > 0 && die_offset <= (loc->
dw_loc_opc == DW_OP_call2 ? 0xffff : 0xffffffff)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2390, __FUNCTION__), 0 : 0))
2389 ? 0xffff((void)(!(die_offset > 0 && die_offset <= (loc->
dw_loc_opc == DW_OP_call2 ? 0xffff : 0xffffffff)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2390, __FUNCTION__), 0 : 0))
2390 : 0xffffffff))((void)(!(die_offset > 0 && die_offset <= (loc->
dw_loc_opc == DW_OP_call2 ? 0xffff : 0xffffffff)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2390, __FUNCTION__), 0 : 0))
;
2391 dw2_asm_output_data ((loc->dw_loc_opc == DW_OP_call2) ? 2 : 4,
2392 die_offset, NULLnullptr);
2393 }
2394 break;
2395
2396 case DW_OP_call_ref:
2397 case DW_OP_GNU_variable_value:
2398 {
2399 char label[MAX_ARTIFICIAL_LABEL_BYTES40
2400 + HOST_BITS_PER_WIDE_INT64 / 2 + 2];
2401 gcc_assert (val1->val_class == dw_val_class_die_ref)((void)(!(val1->val_class == dw_val_class_die_ref) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2401, __FUNCTION__), 0 : 0))
;
2402 get_ref_die_offset_label (label, val1->v.val_die_ref.die);
2403 dw2_asm_output_offset (DWARF_REF_SIZE(global_options.x_dwarf_version == 2 ? (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) : global_options.x_dwarf_offset_size)
, label, debug_info_section, NULLnullptr);
2404 }
2405 break;
2406
2407 case DW_OP_implicit_pointer:
2408 case DW_OP_GNU_implicit_pointer:
2409 {
2410 char label[MAX_ARTIFICIAL_LABEL_BYTES40
2411 + HOST_BITS_PER_WIDE_INT64 / 2 + 2];
2412 gcc_assert (val1->val_class == dw_val_class_die_ref)((void)(!(val1->val_class == dw_val_class_die_ref) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2412, __FUNCTION__), 0 : 0))
;
2413 get_ref_die_offset_label (label, val1->v.val_die_ref.die);
2414 dw2_asm_output_offset (DWARF_REF_SIZE(global_options.x_dwarf_version == 2 ? (((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) : global_options.x_dwarf_offset_size)
, label, debug_info_section, NULLnullptr);
2415 dw2_asm_output_data_sleb128 (val2->v.val_int, NULLnullptr);
2416 }
2417 break;
2418
2419 case DW_OP_entry_value:
2420 case DW_OP_GNU_entry_value:
2421 dw2_asm_output_data_uleb128 (size_of_locs (val1->v.val_loc), NULLnullptr);
2422 output_loc_sequence (val1->v.val_loc, for_eh_or_skip);
2423 break;
2424
2425 case DW_OP_const_type:
2426 case DW_OP_GNU_const_type:
2427 {
2428 unsigned long o = get_base_type_offset (val1->v.val_die_ref.die), l;
2429 gcc_assert (o)((void)(!(o) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2429, __FUNCTION__), 0 : 0))
;
2430 dw2_asm_output_data_uleb128 (o, NULLnullptr);
2431 switch (val2->val_class)
2432 {
2433 case dw_val_class_const:
2434 l = HOST_BITS_PER_WIDE_INT64 / HOST_BITS_PER_CHAR8;
2435 dw2_asm_output_data (1, l, NULLnullptr);
2436 dw2_asm_output_data (l, val2->v.val_int, NULLnullptr);
2437 break;
2438 case dw_val_class_vec:
2439 {
2440 unsigned int elt_size = val2->v.val_vec.elt_size;
2441 unsigned int len = val2->v.val_vec.length;
2442 unsigned int i;
2443 unsigned char *p;
2444
2445 l = len * elt_size;
2446 dw2_asm_output_data (1, l, NULLnullptr);
2447 if (elt_size > sizeof (HOST_WIDE_INTlong))
2448 {
2449 elt_size /= 2;
2450 len *= 2;
2451 }
2452 for (i = 0, p = (unsigned char *) val2->v.val_vec.array;
2453 i < len;
2454 i++, p += elt_size)
2455 dw2_asm_output_data (elt_size, extract_int (p, elt_size),
2456 "fp or vector constant word %u", i);
2457 }
2458 break;
2459 case dw_val_class_const_double:
2460 {
2461 unsigned HOST_WIDE_INTlong first, second;
2462 l = HOST_BITS_PER_WIDE_INT64 / HOST_BITS_PER_CHAR8;
2463
2464 dw2_asm_output_data (1, 2 * l, NULLnullptr);
2465 if (WORDS_BIG_ENDIAN0)
2466 {
2467 first = val2->v.val_double.high;
2468 second = val2->v.val_double.low;
2469 }
2470 else
2471 {
2472 first = val2->v.val_double.low;
2473 second = val2->v.val_double.high;
2474 }
2475 dw2_asm_output_data (l, first, NULLnullptr);
2476 dw2_asm_output_data (l, second, NULLnullptr);
2477 }
2478 break;
2479 case dw_val_class_wide_int:
2480 {
2481 int i;
2482 int len = get_full_len (*val2->v.val_wide);
2483 l = HOST_BITS_PER_WIDE_INT64 / HOST_BITS_PER_CHAR8;
2484
2485 dw2_asm_output_data (1, len * l, NULLnullptr);
2486 if (WORDS_BIG_ENDIAN0)
2487 for (i = len - 1; i >= 0; --i)
2488 dw2_asm_output_data (l, val2->v.val_wide->elt (i), NULLnullptr);
2489 else
2490 for (i = 0; i < len; ++i)
2491 dw2_asm_output_data (l, val2->v.val_wide->elt (i), NULLnullptr);
2492 }
2493 break;
2494 default:
2495 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2495, __FUNCTION__))
;
2496 }
2497 }
2498 break;
2499 case DW_OP_regval_type:
2500 case DW_OP_GNU_regval_type:
2501 {
2502 unsigned r = val1->v.val_unsigned;
2503 unsigned long o = get_base_type_offset (val2->v.val_die_ref.die);
2504 gcc_assert (o)((void)(!(o) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2504, __FUNCTION__), 0 : 0))
;
2505 if (for_eh_or_skip >= 0)
2506 {
2507 r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip)(r);
2508 gcc_assert (size_of_uleb128 (r)((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2509, __FUNCTION__), 0 : 0))
2509 == size_of_uleb128 (val1->v.val_unsigned))((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2509, __FUNCTION__), 0 : 0))
;
2510 }
2511 dw2_asm_output_data_uleb128 (r, NULLnullptr);
2512 dw2_asm_output_data_uleb128 (o, NULLnullptr);
2513 }
2514 break;
2515 case DW_OP_deref_type:
2516 case DW_OP_GNU_deref_type:
2517 {
2518 unsigned long o = get_base_type_offset (val2->v.val_die_ref.die);
2519 gcc_assert (o)((void)(!(o) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2519, __FUNCTION__), 0 : 0))
;
2520 dw2_asm_output_data (1, val1->v.val_int, NULLnullptr);
2521 dw2_asm_output_data_uleb128 (o, NULLnullptr);
2522 }
2523 break;
2524 case DW_OP_convert:
2525 case DW_OP_reinterpret:
2526 case DW_OP_GNU_convert:
2527 case DW_OP_GNU_reinterpret:
2528 if (loc->dw_loc_oprnd1.val_class == dw_val_class_unsigned_const)
2529 dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULLnullptr);
2530 else
2531 {
2532 unsigned long o = get_base_type_offset (val1->v.val_die_ref.die);
2533 gcc_assert (o)((void)(!(o) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2533, __FUNCTION__), 0 : 0))
;
2534 dw2_asm_output_data_uleb128 (o, NULLnullptr);
2535 }
2536 break;
2537
2538 case DW_OP_GNU_parameter_ref:
2539 {
2540 unsigned long o;
2541 gcc_assert (val1->val_class == dw_val_class_die_ref)((void)(!(val1->val_class == dw_val_class_die_ref) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2541, __FUNCTION__), 0 : 0))
;
2542 o = get_ref_die_offset (val1->v.val_die_ref.die);
2543 dw2_asm_output_data (4, o, NULLnullptr);
2544 }
2545 break;
2546
2547 default:
2548 /* Other codes have no operands. */
2549 break;
2550 }
2551}
2552
2553/* Output a sequence of location operations.
2554 The for_eh_or_skip parameter controls whether register numbers are
2555 converted using DWARF2_FRAME_REG_OUT, which is needed in the case that
2556 hard reg numbers have been processed via DWARF_FRAME_REGNUM (i.e. for unwind
2557 info). This should be suppressed for the cases that have not been converted
2558 (i.e. symbolic debug info), by setting the parameter < 0. See PR47324. */
2559
2560void
2561output_loc_sequence (dw_loc_descr_ref loc, int for_eh_or_skip)
2562{
2563 for (; loc != NULLnullptr; loc = loc->dw_loc_next)
2564 {
2565 enum dwarf_location_atom opc = loc->dw_loc_opc;
2566 /* Output the opcode. */
2567 if (for_eh_or_skip >= 0
2568 && opc >= DW_OP_breg0 && opc <= DW_OP_breg31)
2569 {
2570 unsigned r = (opc - DW_OP_breg0);
2571 r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip)(r);
2572 gcc_assert (r <= 31)((void)(!(r <= 31) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2572, __FUNCTION__), 0 : 0))
;
2573 opc = (enum dwarf_location_atom) (DW_OP_breg0 + r);
2574 }
2575 else if (for_eh_or_skip >= 0
2576 && opc >= DW_OP_reg0 && opc <= DW_OP_reg31)
2577 {
2578 unsigned r = (opc - DW_OP_reg0);
2579 r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip)(r);
2580 gcc_assert (r <= 31)((void)(!(r <= 31) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2580, __FUNCTION__), 0 : 0))
;
2581 opc = (enum dwarf_location_atom) (DW_OP_reg0 + r);
2582 }
2583
2584 dw2_asm_output_data (1, opc,
2585 "%s", dwarf_stack_op_name (opc));
2586
2587 /* Output the operand(s) (if any). */
2588 output_loc_operands (loc, for_eh_or_skip);
2589 }
2590}
2591
2592/* Output location description stack opcode's operands (if any).
2593 The output is single bytes on a line, suitable for .cfi_escape. */
2594
2595static void
2596output_loc_operands_raw (dw_loc_descr_ref loc)
2597{
2598 dw_val_ref val1 = &loc->dw_loc_oprnd1;
2599 dw_val_ref val2 = &loc->dw_loc_oprnd2;
2600
2601 switch (loc->dw_loc_opc)
2602 {
2603 case DW_OP_addr:
2604 case DW_OP_GNU_addr_index:
2605 case DW_OP_addrx:
2606 case DW_OP_GNU_const_index:
2607 case DW_OP_constx:
2608 case DW_OP_implicit_value:
2609 /* We cannot output addresses in .cfi_escape, only bytes. */
2610 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2610, __FUNCTION__))
;
2611
2612 case DW_OP_const1u:
2613 case DW_OP_const1s:
2614 case DW_OP_pick:
2615 case DW_OP_deref_size:
2616 case DW_OP_xderef_size:
2617 fputc (',', asm_out_file);
2618 dw2_asm_output_data_raw (1, val1->v.val_int);
2619 break;
2620
2621 case DW_OP_const2u:
2622 case DW_OP_const2s:
2623 fputc (',', asm_out_file);
2624 dw2_asm_output_data_raw (2, val1->v.val_int);
2625 break;
2626
2627 case DW_OP_const4u:
2628 case DW_OP_const4s:
2629 fputc (',', asm_out_file);
2630 dw2_asm_output_data_raw (4, val1->v.val_int);
2631 break;
2632
2633 case DW_OP_const8u:
2634 case DW_OP_const8s:
2635 gcc_assert (HOST_BITS_PER_WIDE_INT >= 64)((void)(!(64 >= 64) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2635, __FUNCTION__), 0 : 0))
;
2636 fputc (',', asm_out_file);
2637 dw2_asm_output_data_raw (8, val1->v.val_int);
2638 break;
2639
2640 case DW_OP_skip:
2641 case DW_OP_bra:
2642 {
2643 int offset;
2644
2645 gcc_assert (val1->val_class == dw_val_class_loc)((void)(!(val1->val_class == dw_val_class_loc) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2645, __FUNCTION__), 0 : 0))
;
2646 offset = val1->v.val_loc->dw_loc_addr - (loc->dw_loc_addr + 3);
2647
2648 fputc (',', asm_out_file);
2649 dw2_asm_output_data_raw (2, offset);
2650 }
2651 break;
2652
2653 case DW_OP_regx:
2654 {
2655 unsigned r = DWARF2_FRAME_REG_OUT (val1->v.val_unsigned, 1)(val1->v.val_unsigned);
2656 gcc_assert (size_of_uleb128 (r)((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2657, __FUNCTION__), 0 : 0))
2657 == size_of_uleb128 (val1->v.val_unsigned))((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2657, __FUNCTION__), 0 : 0))
;
2658 fputc (',', asm_out_file);
2659 dw2_asm_output_data_uleb128_raw (r);
2660 }
2661 break;
2662
2663 case DW_OP_constu:
2664 case DW_OP_plus_uconst:
2665 case DW_OP_piece:
2666 fputc (',', asm_out_file);
2667 dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned);
2668 break;
2669
2670 case DW_OP_bit_piece:
2671 fputc (',', asm_out_file);
2672 dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned);
2673 dw2_asm_output_data_uleb128_raw (val2->v.val_unsigned);
2674 break;
2675
2676 case DW_OP_consts:
2677 case DW_OP_breg0:
2678 case DW_OP_breg1:
2679 case DW_OP_breg2:
2680 case DW_OP_breg3:
2681 case DW_OP_breg4:
2682 case DW_OP_breg5:
2683 case DW_OP_breg6:
2684 case DW_OP_breg7:
2685 case DW_OP_breg8:
2686 case DW_OP_breg9:
2687 case DW_OP_breg10:
2688 case DW_OP_breg11:
2689 case DW_OP_breg12:
2690 case DW_OP_breg13:
2691 case DW_OP_breg14:
2692 case DW_OP_breg15:
2693 case DW_OP_breg16:
2694 case DW_OP_breg17:
2695 case DW_OP_breg18:
2696 case DW_OP_breg19:
2697 case DW_OP_breg20:
2698 case DW_OP_breg21:
2699 case DW_OP_breg22:
2700 case DW_OP_breg23:
2701 case DW_OP_breg24:
2702 case DW_OP_breg25:
2703 case DW_OP_breg26:
2704 case DW_OP_breg27:
2705 case DW_OP_breg28:
2706 case DW_OP_breg29:
2707 case DW_OP_breg30:
2708 case DW_OP_breg31:
2709 case DW_OP_fbreg:
2710 fputc (',', asm_out_file);
2711 dw2_asm_output_data_sleb128_raw (val1->v.val_int);
2712 break;
2713
2714 case DW_OP_bregx:
2715 {
2716 unsigned r = DWARF2_FRAME_REG_OUT (val1->v.val_unsigned, 1)(val1->v.val_unsigned);
2717 gcc_assert (size_of_uleb128 (r)((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2718, __FUNCTION__), 0 : 0))
2718 == size_of_uleb128 (val1->v.val_unsigned))((void)(!(size_of_uleb128 (r) == size_of_uleb128 (val1->v.
val_unsigned)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2718, __FUNCTION__), 0 : 0))
;
2719 fputc (',', asm_out_file);
2720 dw2_asm_output_data_uleb128_raw (r);
2721 fputc (',', asm_out_file);
2722 dw2_asm_output_data_sleb128_raw (val2->v.val_int);
2723 }
2724 break;
2725
2726 case DW_OP_implicit_pointer:
2727 case DW_OP_entry_value:
2728 case DW_OP_const_type:
2729 case DW_OP_regval_type:
2730 case DW_OP_deref_type:
2731 case DW_OP_convert:
2732 case DW_OP_reinterpret:
2733 case DW_OP_GNU_implicit_pointer:
2734 case DW_OP_GNU_entry_value:
2735 case DW_OP_GNU_const_type:
2736 case DW_OP_GNU_regval_type:
2737 case DW_OP_GNU_deref_type:
2738 case DW_OP_GNU_convert:
2739 case DW_OP_GNU_reinterpret:
2740 case DW_OP_GNU_parameter_ref:
2741 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2741, __FUNCTION__))
;
2742 break;
2743
2744 default:
2745 /* Other codes have no operands. */
2746 break;
2747 }
2748}
2749
2750void
2751output_loc_sequence_raw (dw_loc_descr_ref loc)
2752{
2753 while (1)
2754 {
2755 enum dwarf_location_atom opc = loc->dw_loc_opc;
2756 /* Output the opcode. */
2757 if (opc >= DW_OP_breg0 && opc <= DW_OP_breg31)
2758 {
2759 unsigned r = (opc - DW_OP_breg0);
2760 r = DWARF2_FRAME_REG_OUT (r, 1)(r);
2761 gcc_assert (r <= 31)((void)(!(r <= 31) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2761, __FUNCTION__), 0 : 0))
;
2762 opc = (enum dwarf_location_atom) (DW_OP_breg0 + r);
2763 }
2764 else if (opc >= DW_OP_reg0 && opc <= DW_OP_reg31)
2765 {
2766 unsigned r = (opc - DW_OP_reg0);
2767 r = DWARF2_FRAME_REG_OUT (r, 1)(r);
2768 gcc_assert (r <= 31)((void)(!(r <= 31) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 2768, __FUNCTION__), 0 : 0))
;
2769 opc = (enum dwarf_location_atom) (DW_OP_reg0 + r);
2770 }
2771 /* Output the opcode. */
2772 fprintf (asm_out_file, "%#x", opc);
2773 output_loc_operands_raw (loc);
2774
2775 if (!loc->dw_loc_next)
2776 break;
2777 loc = loc->dw_loc_next;
2778
2779 fputc (',', asm_out_file);
2780 }
2781}
2782
2783/* This function builds a dwarf location descriptor sequence from a
2784 dw_cfa_location, adding the given OFFSET to the result of the
2785 expression. */
2786
2787struct dw_loc_descr_node *
2788build_cfa_loc (dw_cfa_location *cfa, poly_int64 offset)
2789{
2790 struct dw_loc_descr_node *head, *tmp;
2791
2792 offset += cfa->offset;
2793
2794 if (cfa->indirect)
2795 {
2796 head = new_reg_loc_descr (cfa->reg, cfa->base_offset);
2797 head->dw_loc_oprnd1.val_class = dw_val_class_const;
2798 head->dw_loc_oprnd1.val_entry = NULLnullptr;
2799 tmp = new_loc_descr (DW_OP_deref, 0, 0);
2800 add_loc_descr (&head, tmp);
2801 loc_descr_plus_const (&head, offset);
2802 }
2803 else
2804 head = new_reg_loc_descr (cfa->reg, offset);
2805
2806 return head;
2807}
2808
2809/* This function builds a dwarf location descriptor sequence for
2810 the address at OFFSET from the CFA when stack is aligned to
2811 ALIGNMENT byte. */
2812
2813struct dw_loc_descr_node *
2814build_cfa_aligned_loc (dw_cfa_location *cfa,
2815 poly_int64 offset, HOST_WIDE_INTlong alignment)
2816{
2817 struct dw_loc_descr_node *head;
2818 unsigned int dwarf_fp
2819 = DWARF_FRAME_REGNUM (HARD_FRAME_POINTER_REGNUM)(((global_options.x_ix86_isa_flags & (1UL << 1)) !=
0) ? dbx64_register_map[6] : svr4_dbx_register_map[6])
;
2820
2821 /* When CFA is defined as FP+OFFSET, emulate stack alignment. */
2822 if (cfa->reg == HARD_FRAME_POINTER_REGNUM6 && cfa->indirect == 0)
2823 {
2824 head = new_reg_loc_descr (dwarf_fp, 0);
2825 add_loc_descr (&head, int_loc_descriptor (alignment));
2826 add_loc_descr (&head, new_loc_descr (DW_OP_and, 0, 0));
2827 loc_descr_plus_const (&head, offset);
2828 }
2829 else
2830 head = new_reg_loc_descr (dwarf_fp, offset);
2831 return head;
2832}
2833
2834/* And now, the support for symbolic debugging information. */
2835
2836/* .debug_str support. */
2837
2838static void dwarf2out_init (const char *);
2839static void dwarf2out_finish (const char *);
2840static void dwarf2out_early_finish (const char *);
2841static void dwarf2out_assembly_start (void);
2842static void dwarf2out_define (unsigned int, const char *);
2843static void dwarf2out_undef (unsigned int, const char *);
2844static void dwarf2out_start_source_file (unsigned, const char *);
2845static void dwarf2out_end_source_file (unsigned);
2846static void dwarf2out_function_decl (tree);
2847static void dwarf2out_begin_block (unsigned, unsigned);
2848static void dwarf2out_end_block (unsigned, unsigned);
2849static bool dwarf2out_ignore_block (const_tree);
2850static void dwarf2out_set_ignored_loc (unsigned, unsigned, const char *);
2851static void dwarf2out_early_global_decl (tree);
2852static void dwarf2out_late_global_decl (tree);
2853static void dwarf2out_type_decl (tree, int);
2854static void dwarf2out_imported_module_or_decl (tree, tree, tree, bool, bool);
2855static void dwarf2out_imported_module_or_decl_1 (tree, tree, tree,
2856 dw_die_ref);
2857static void dwarf2out_abstract_function (tree);
2858static void dwarf2out_var_location (rtx_insn *);
2859static void dwarf2out_inline_entry (tree);
2860static void dwarf2out_size_function (tree);
2861static void dwarf2out_begin_function (tree);
2862static void dwarf2out_end_function (unsigned int);
2863static void dwarf2out_register_main_translation_unit (tree unit);
2864static void dwarf2out_set_name (tree, tree);
2865static void dwarf2out_register_external_die (tree decl, const char *sym,
2866 unsigned HOST_WIDE_INTlong off);
2867static bool dwarf2out_die_ref_for_decl (tree decl, const char **sym,
2868 unsigned HOST_WIDE_INTlong *off);
2869
2870/* The debug hooks structure. */
2871
2872const struct gcc_debug_hooks dwarf2_debug_hooks =
2873{
2874 dwarf2out_init,
2875 dwarf2out_finish,
2876 dwarf2out_early_finish,
2877 dwarf2out_assembly_start,
2878 dwarf2out_define,
2879 dwarf2out_undef,
2880 dwarf2out_start_source_file,
2881 dwarf2out_end_source_file,
2882 dwarf2out_begin_block,
2883 dwarf2out_end_block,
2884 dwarf2out_ignore_block,
2885 dwarf2out_source_line,
2886 dwarf2out_set_ignored_loc,
2887 dwarf2out_begin_prologue,
2888#if VMS_DEBUGGING_INFO
2889 dwarf2out_vms_end_prologue,
2890 dwarf2out_vms_begin_epilogue,
2891#else
2892 debug_nothing_int_charstar,
2893 debug_nothing_int_charstar,
2894#endif
2895 dwarf2out_end_epilogue,
2896 dwarf2out_begin_function,
2897 dwarf2out_end_function, /* end_function */
2898 dwarf2out_register_main_translation_unit,
2899 dwarf2out_function_decl, /* function_decl */
2900 dwarf2out_early_global_decl,
2901 dwarf2out_late_global_decl,
2902 dwarf2out_type_decl, /* type_decl */
2903 dwarf2out_imported_module_or_decl,
2904 dwarf2out_die_ref_for_decl,
2905 dwarf2out_register_external_die,
2906 debug_nothing_tree, /* deferred_inline_function */
2907 /* The DWARF 2 backend tries to reduce debugging bloat by not
2908 emitting the abstract description of inline functions until
2909 something tries to reference them. */
2910 dwarf2out_abstract_function, /* outlining_inline_function */
2911 debug_nothing_rtx_code_label, /* label */
2912 debug_nothing_int, /* handle_pch */
2913 dwarf2out_var_location,
2914 dwarf2out_inline_entry, /* inline_entry */
2915 dwarf2out_size_function, /* size_function */
2916 dwarf2out_switch_text_section,
2917 dwarf2out_set_name,
2918 1, /* start_end_main_source_file */
2919 TYPE_SYMTAB_IS_DIE(1) /* tree_type_symtab_field */
2920};
2921
2922const struct gcc_debug_hooks dwarf2_lineno_debug_hooks =
2923{
2924 dwarf2out_init,
2925 debug_nothing_charstar,
2926 debug_nothing_charstar,
2927 dwarf2out_assembly_start,
2928 debug_nothing_int_charstar,
2929 debug_nothing_int_charstar,
2930 debug_nothing_int_charstar,
2931 debug_nothing_int,
2932 debug_nothing_int_int, /* begin_block */
2933 debug_nothing_int_int, /* end_block */
2934 debug_true_const_tree, /* ignore_block */
2935 dwarf2out_source_line, /* source_line */
2936 debug_nothing_int_int_charstar, /* set_ignored_loc */
2937 debug_nothing_int_int_charstar, /* begin_prologue */
2938 debug_nothing_int_charstar, /* end_prologue */
2939 debug_nothing_int_charstar, /* begin_epilogue */
2940 debug_nothing_int_charstar, /* end_epilogue */
2941 debug_nothing_tree, /* begin_function */
2942 debug_nothing_int, /* end_function */
2943 debug_nothing_tree, /* register_main_translation_unit */
2944 debug_nothing_tree, /* function_decl */
2945 debug_nothing_tree, /* early_global_decl */
2946 debug_nothing_tree, /* late_global_decl */
2947 debug_nothing_tree_int, /* type_decl */
2948 debug_nothing_tree_tree_tree_bool_bool,/* imported_module_or_decl */
2949 debug_false_tree_charstarstar_uhwistar,/* die_ref_for_decl */
2950 debug_nothing_tree_charstar_uhwi, /* register_external_die */
2951 debug_nothing_tree, /* deferred_inline_function */
2952 debug_nothing_tree, /* outlining_inline_function */
2953 debug_nothing_rtx_code_label, /* label */
2954 debug_nothing_int, /* handle_pch */
2955 debug_nothing_rtx_insn, /* var_location */
2956 debug_nothing_tree, /* inline_entry */
2957 debug_nothing_tree, /* size_function */
2958 debug_nothing_void, /* switch_text_section */
2959 debug_nothing_tree_tree, /* set_name */
2960 0, /* start_end_main_source_file */
2961 TYPE_SYMTAB_IS_ADDRESS(0) /* tree_type_symtab_field */
2962};
2963
2964/* NOTE: In the comments in this file, many references are made to
2965 "Debugging Information Entries". This term is abbreviated as `DIE'
2966 throughout the remainder of this file. */
2967
2968/* An internal representation of the DWARF output is built, and then
2969 walked to generate the DWARF debugging info. The walk of the internal
2970 representation is done after the entire program has been compiled.
2971 The types below are used to describe the internal representation. */
2972
2973/* Whether to put type DIEs into their own section .debug_types instead
2974 of making them part of the .debug_info section. Only supported for
2975 Dwarf V4 or higher and the user didn't disable them through
2976 -fno-debug-types-section. It is more efficient to put them in a
2977 separate comdat sections since the linker will then be able to
2978 remove duplicates. But not all tools support .debug_types sections
2979 yet. For Dwarf V5 or higher .debug_types doesn't exist any more,
2980 it is DW_UT_type unit type in .debug_info section. For late LTO
2981 debug there should be almost no types emitted so avoid enabling
2982 -fdebug-types-section there. */
2983
2984#define use_debug_types(global_options.x_dwarf_version >= 4 && global_options
.x_flag_debug_types_section && !global_options.x_in_lto_p
)
(dwarf_versionglobal_options.x_dwarf_version >= 4 \
2985 && flag_debug_types_sectionglobal_options.x_flag_debug_types_section \
2986 && !in_lto_pglobal_options.x_in_lto_p)
2987
2988/* Various DIE's use offsets relative to the beginning of the
2989 .debug_info section to refer to each other. */
2990
2991typedef long int dw_offset;
2992
2993struct comdat_type_node;
2994
2995/* The entries in the line_info table more-or-less mirror the opcodes
2996 that are used in the real dwarf line table. Arrays of these entries
2997 are collected per section when DWARF2_ASM_LINE_DEBUG_INFO is not
2998 supported. */
2999
3000enum dw_line_info_opcode {
3001 /* Emit DW_LNE_set_address; the operand is the label index. */
3002 LI_set_address,
3003
3004 /* Emit a row to the matrix with the given line. This may be done
3005 via any combination of DW_LNS_copy, DW_LNS_advance_line, and
3006 special opcodes. */
3007 LI_set_line,
3008
3009 /* Emit a DW_LNS_set_file. */
3010 LI_set_file,
3011
3012 /* Emit a DW_LNS_set_column. */
3013 LI_set_column,
3014
3015 /* Emit a DW_LNS_negate_stmt; the operand is ignored. */
3016 LI_negate_stmt,
3017
3018 /* Emit a DW_LNS_set_prologue_end/epilogue_begin; the operand is ignored. */
3019 LI_set_prologue_end,
3020 LI_set_epilogue_begin,
3021
3022 /* Emit a DW_LNE_set_discriminator. */
3023 LI_set_discriminator,
3024
3025 /* Output a Fixed Advance PC; the target PC is the label index; the
3026 base PC is the previous LI_adv_address or LI_set_address entry.
3027 We only use this when emitting debug views without assembler
3028 support, at explicit user request. Ideally, we should only use
3029 it when the offset might be zero but we can't tell: it's the only
3030 way to maybe change the PC without resetting the view number. */
3031 LI_adv_address
3032};
3033
3034typedef struct GTY(()) dw_line_info_struct {
3035 enum dw_line_info_opcode opcode;
3036 unsigned int val;
3037} dw_line_info_entry;
3038
3039
3040struct GTY(()) dw_line_info_table {
3041 /* The label that marks the end of this section. */
3042 const char *end_label;
3043
3044 /* The values for the last row of the matrix, as collected in the table.
3045 These are used to minimize the changes to the next row. */
3046 unsigned int file_num;
3047 unsigned int line_num;
3048 unsigned int column_num;
3049 int discrim_num;
3050 bool is_stmt;
3051 bool in_use;
3052
3053 /* This denotes the NEXT view number.
3054
3055 If it is 0, it is known that the NEXT view will be the first view
3056 at the given PC.
3057
3058 If it is -1, we're forcing the view number to be reset, e.g. at a
3059 function entry.
3060
3061 The meaning of other nonzero values depends on whether we're
3062 computing views internally or leaving it for the assembler to do
3063 so. If we're emitting them internally, view denotes the view
3064 number since the last known advance of PC. If we're leaving it
3065 for the assembler, it denotes the LVU label number that we're
3066 going to ask the assembler to assign. */
3067 var_loc_view view;
3068
3069 /* This counts the number of symbolic views emitted in this table
3070 since the latest view reset. Its max value, over all tables,
3071 sets symview_upper_bound. */
3072 var_loc_view symviews_since_reset;
3073
3074#define FORCE_RESET_NEXT_VIEW(x)((x) = (var_loc_view)-1) ((x) = (var_loc_view)-1)
3075#define RESET_NEXT_VIEW(x)((x) = (var_loc_view)0) ((x) = (var_loc_view)0)
3076#define FORCE_RESETTING_VIEW_P(x)((x) == (var_loc_view)-1) ((x) == (var_loc_view)-1)
3077#define RESETTING_VIEW_P(x)((x) == (var_loc_view)0 || ((x) == (var_loc_view)-1)) ((x) == (var_loc_view)0 || FORCE_RESETTING_VIEW_P (x)((x) == (var_loc_view)-1))
3078
3079 vec<dw_line_info_entry, va_gc> *entries;
3080};
3081
3082/* This is an upper bound for view numbers that the assembler may
3083 assign to symbolic views output in this translation. It is used to
3084 decide how big a field to use to represent view numbers in
3085 symview-classed attributes. */
3086
3087static var_loc_view symview_upper_bound;
3088
3089/* If we're keep track of location views and their reset points, and
3090 INSN is a reset point (i.e., it necessarily advances the PC), mark
3091 the next view in TABLE as reset. */
3092
3093static void
3094maybe_reset_location_view (rtx_insn *insn, dw_line_info_table *table)
3095{
3096 if (!debug_internal_reset_location_viewsglobal_options.x_debug_internal_reset_location_views)
3097 return;
3098
3099 /* Maybe turn (part of?) this test into a default target hook. */
3100 int reset = 0;
3101
3102 if (targetm.reset_location_view)
3103 reset = targetm.reset_location_view (insn);
3104
3105 if (reset)
3106 ;
3107 else if (JUMP_TABLE_DATA_P (insn)(((enum rtx_code) (insn)->code) == JUMP_TABLE_DATA))
3108 reset = 1;
3109 else if (GET_CODE (insn)((enum rtx_code) (insn)->code) == USE
3110 || GET_CODE (insn)((enum rtx_code) (insn)->code) == CLOBBER
3111 || GET_CODE (insn)((enum rtx_code) (insn)->code) == ASM_INPUT
3112 || asm_noperands (insn) >= 0)
3113 ;
3114 else if (get_attr_min_length (insn) > 0)
3115 reset = 1;
3116
3117 if (reset > 0 && !RESETTING_VIEW_P (table->view)((table->view) == (var_loc_view)0 || ((table->view) == (
var_loc_view)-1))
)
3118 RESET_NEXT_VIEW (table->view)((table->view) = (var_loc_view)0);
3119}
3120
3121/* The Debugging Information Entry (DIE) structure. DIEs form a tree.
3122 The children of each node form a circular list linked by
3123 die_sib. die_child points to the node *before* the "first" child node. */
3124
3125typedef struct GTY((chain_circular ("%h.die_sib"), for_user)) die_struct {
3126 union die_symbol_or_type_node
3127 {
3128 const char * GTY ((tag ("0"))) die_symbol;
3129 comdat_type_node *GTY ((tag ("1"))) die_type_node;
3130 }
3131 GTY ((desc ("%0.comdat_type_p"))) die_id;
3132 vec<dw_attr_node, va_gc> *die_attr;
3133 dw_die_ref die_parent;
3134 dw_die_ref die_child;
3135 dw_die_ref die_sib;
3136 dw_die_ref die_definition; /* ref from a specification to its definition */
3137 dw_offset die_offset;
3138 unsigned long die_abbrev;
3139 int die_mark;
3140 unsigned int decl_id;
3141 enum dwarf_tag die_tag;
3142 /* Die is used and must not be pruned as unused. */
3143 BOOL_BITFIELDunsigned int die_perennial_p : 1;
3144 BOOL_BITFIELDunsigned int comdat_type_p : 1; /* DIE has a type signature */
3145 /* For an external ref to die_symbol if die_offset contains an extra
3146 offset to that symbol. */
3147 BOOL_BITFIELDunsigned int with_offset : 1;
3148 /* Whether this DIE was removed from the DIE tree, for example via
3149 prune_unused_types. We don't consider those present from the
3150 DIE lookup routines. */
3151 BOOL_BITFIELDunsigned int removed : 1;
3152 /* Lots of spare bits. */
3153}
3154die_node;
3155
3156/* Set to TRUE while dwarf2out_early_global_decl is running. */
3157static bool early_dwarf;
3158static bool early_dwarf_finished;
3159class set_early_dwarf {
3160public:
3161 bool saved;
3162 set_early_dwarf () : saved(early_dwarf)
3163 {
3164 gcc_assert (! early_dwarf_finished)((void)(!(! early_dwarf_finished) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3164, __FUNCTION__), 0 : 0))
;
3165 early_dwarf = true;
3166 }
3167 ~set_early_dwarf () { early_dwarf = saved; }
3168};
3169
3170/* Evaluate 'expr' while 'c' is set to each child of DIE in order. */
3171#define FOR_EACH_CHILD(die, c, expr)do { c = die->die_child; if (c) do { c = c->die_sib; expr
; } while (c != die->die_child); } while (0)
do { \
3172 c = die->die_child; \
3173 if (c) do { \
3174 c = c->die_sib; \
3175 expr; \
3176 } while (c != die->die_child); \
3177} while (0)
3178
3179/* The pubname structure */
3180
3181typedef struct GTY(()) pubname_struct {
3182 dw_die_ref die;
3183 const char *name;
3184}
3185pubname_entry;
3186
3187
3188struct GTY(()) dw_ranges {
3189 const char *label;
3190 /* If this is positive, it's a block number, otherwise it's a
3191 bitwise-negated index into dw_ranges_by_label. */
3192 int num;
3193 /* If idx is equal to DW_RANGES_IDX_SKELETON, it should be emitted
3194 into .debug_rnglists section rather than .debug_rnglists.dwo
3195 for -gsplit-dwarf and DWARF >= 5. */
3196#define DW_RANGES_IDX_SKELETON((1U << 31) - 1) ((1U << 31) - 1)
3197 /* Index for the range list for DW_FORM_rnglistx. */
3198 unsigned int idx : 31;
3199 /* True if this range might be possibly in a different section
3200 from previous entry. */
3201 unsigned int maybe_new_sec : 1;
3202 addr_table_entry *begin_entry;
3203 addr_table_entry *end_entry;
3204};
3205
3206/* A structure to hold a macinfo entry. */
3207
3208typedef struct GTY(()) macinfo_struct {
3209 unsigned char code;
3210 unsigned HOST_WIDE_INTlong lineno;
3211 const char *info;
3212}
3213macinfo_entry;
3214
3215
3216struct GTY(()) dw_ranges_by_label {
3217 const char *begin;
3218 const char *end;
3219};
3220
3221/* The comdat type node structure. */
3222struct GTY(()) comdat_type_node
3223{
3224 dw_die_ref root_die;
3225 dw_die_ref type_die;
3226 dw_die_ref skeleton_die;
3227 char signature[DWARF_TYPE_SIGNATURE_SIZE8];
3228 comdat_type_node *next;
3229};
3230
3231/* A list of DIEs for which we can't determine ancestry (parent_die
3232 field) just yet. Later in dwarf2out_finish we will fill in the
3233 missing bits. */
3234typedef struct GTY(()) limbo_die_struct {
3235 dw_die_ref die;
3236 /* The tree for which this DIE was created. We use this to
3237 determine ancestry later. */
3238 tree created_for;
3239 struct limbo_die_struct *next;
3240}
3241limbo_die_node;
3242
3243typedef struct skeleton_chain_struct
3244{
3245 dw_die_ref old_die;
3246 dw_die_ref new_die;
3247 struct skeleton_chain_struct *parent;
3248}
3249skeleton_chain_node;
3250
3251/* Define a macro which returns nonzero for a TYPE_DECL which was
3252 implicitly generated for a type.
3253
3254 Note that, unlike the C front-end (which generates a NULL named
3255 TYPE_DECL node for each complete tagged type, each array type,
3256 and each function type node created) the C++ front-end generates
3257 a _named_ TYPE_DECL node for each tagged type node created.
3258 These TYPE_DECLs have DECL_ARTIFICIAL set, so we know not to
3259 generate a DW_TAG_typedef DIE for them. Likewise with the Ada
3260 front-end, but for each type, tagged or not. */
3261
3262#define TYPE_DECL_IS_STUB(decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))->decl_minimal.name) == (tree) nullptr
|| (((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))->decl_common.artificial_flag) &&
((decl == (((contains_struct_check (((tree_class_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))->common.chain))) || (((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))->decl_common.abstract_origin) != (tree
) nullptr && (decl_ultimate_origin (decl) == (((contains_struct_check
(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3262, __FUNCTION__))->common.chain)))))))
\
3263 (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3263, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) nullptr \
3264 || (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3264, __FUNCTION__))->decl_common.artificial_flag)
\
3265 && ((decl == TYPE_STUB_DECL (TREE_TYPE (decl))(((contains_struct_check (((tree_class_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3265, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3265, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3265, __FUNCTION__))->common.chain))
) \
3266 /* This is necessary for stub decls that \
3267 appear in nested inline functions. */ \
3268 || (DECL_ABSTRACT_ORIGIN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3268, __FUNCTION__))->decl_common.abstract_origin)
!= NULL_TREE(tree) nullptr \
3269 && (decl_ultimate_origin (decl) \
3270 == TYPE_STUB_DECL (TREE_TYPE (decl))(((contains_struct_check (((tree_class_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3270, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3270, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 3270, __FUNCTION__))->common.chain))
)))))
3271
3272/* Information concerning the compilation unit's programming
3273 language, and compiler version. */
3274
3275/* Fixed size portion of the DWARF compilation unit header. */
3276#define DWARF_COMPILE_UNIT_HEADER_SIZE((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + (global_options.x_dwarf_version >= 5
? 4 : 3))
\
3277 (DWARF_INITIAL_LENGTH_SIZE(global_options.x_dwarf_offset_size == 4 ? 4 : 12) + dwarf_offset_sizeglobal_options.x_dwarf_offset_size \
3278 + (dwarf_versionglobal_options.x_dwarf_version >= 5 ? 4 : 3))
3279
3280/* Fixed size portion of the DWARF comdat type unit header. */
3281#define DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE(((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + (global_options.x_dwarf_version >= 5
? 4 : 3)) + 8 + global_options.x_dwarf_offset_size)
\
3282 (DWARF_COMPILE_UNIT_HEADER_SIZE((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + (global_options.x_dwarf_version >= 5
? 4 : 3))
\
3283 + DWARF_TYPE_SIGNATURE_SIZE8 + dwarf_offset_sizeglobal_options.x_dwarf_offset_size)
3284
3285/* Fixed size portion of the DWARF skeleton compilation unit header. */
3286#define DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE(((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + (global_options.x_dwarf_version >= 5
? 4 : 3)) + (global_options.x_dwarf_version >= 5 ? 8 : 0)
)
\
3287 (DWARF_COMPILE_UNIT_HEADER_SIZE((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + (global_options.x_dwarf_version >= 5
? 4 : 3))
+ (dwarf_versionglobal_options.x_dwarf_version >= 5 ? 8 : 0))
3288
3289/* Fixed size portion of public names info. */
3290#define DWARF_PUBNAMES_HEADER_SIZE(2 * global_options.x_dwarf_offset_size + 2) (2 * dwarf_offset_sizeglobal_options.x_dwarf_offset_size + 2)
3291
3292/* Fixed size portion of the address range info. */
3293#define DWARF_ARANGES_HEADER_SIZE((((((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + 4) + ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2) - 1) / ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2)) * ((((((global_options.x_ix86_isa_flags &
(1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)) *
2)) - (global_options.x_dwarf_offset_size == 4 ? 4 : 12))
\
3294 (DWARF_ROUND (DWARF_INITIAL_LENGTH_SIZE + dwarf_offset_size + 4, \(((((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + 4) + ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2) - 1) / ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2)) * ((((((global_options.x_ix86_isa_flags &
(1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)) *
2))
3295 DWARF2_ADDR_SIZE * 2)(((((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + 4) + ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2) - 1) / ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2)) * ((((((global_options.x_ix86_isa_flags &
(1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)) *
2))
\
3296 - DWARF_INITIAL_LENGTH_SIZE(global_options.x_dwarf_offset_size == 4 ? 4 : 12))
3297
3298/* Size of padding portion in the address range info. It must be
3299 aligned to twice the pointer size. */
3300#define DWARF_ARANGES_PAD_SIZE((((((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + 4) + ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2) - 1) / ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2)) * ((((((global_options.x_ix86_isa_flags &
(1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)) *
2)) - ((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + 4))
\
3301 (DWARF_ROUND (DWARF_INITIAL_LENGTH_SIZE + dwarf_offset_size + 4, \(((((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + 4) + ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2) - 1) / ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2)) * ((((((global_options.x_ix86_isa_flags &
(1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)) *
2))
3302 DWARF2_ADDR_SIZE * 2)(((((global_options.x_dwarf_offset_size == 4 ? 4 : 12) + global_options
.x_dwarf_offset_size + 4) + ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2) - 1) / ((((((global_options.x_ix86_isa_flags
& (1UL << 58)) != 0) ? 32 : ((8) * (((global_options
.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))) + (
8) - 1) / (8)) * 2)) * ((((((global_options.x_ix86_isa_flags &
(1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags
& (1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8)) *
2))
\
3303 - (DWARF_INITIAL_LENGTH_SIZE(global_options.x_dwarf_offset_size == 4 ? 4 : 12) + dwarf_offset_sizeglobal_options.x_dwarf_offset_size + 4))
3304
3305/* Use assembler line directives if available. */
3306#ifndef DWARF2_ASM_LINE_DEBUG_INFO
3307#ifdef HAVE_AS_DWARF2_DEBUG_LINE1
3308#define DWARF2_ASM_LINE_DEBUG_INFO 1
3309#else
3310#define DWARF2_ASM_LINE_DEBUG_INFO 0
3311#endif
3312#endif
3313
3314/* Use assembler views in line directives if available. */
3315#ifndef DWARF2_ASM_VIEW_DEBUG_INFO
3316#ifdef HAVE_AS_DWARF2_DEBUG_VIEW1
3317#define DWARF2_ASM_VIEW_DEBUG_INFO 1
3318#else
3319#define DWARF2_ASM_VIEW_DEBUG_INFO 0
3320#endif
3321#endif
3322
3323/* Return true if GCC configure detected assembler support for .loc. */
3324
3325bool
3326dwarf2out_default_as_loc_support (void)
3327{
3328 return DWARF2_ASM_LINE_DEBUG_INFO;
3329#if (GCC_VERSION(4 * 1000 + 2) >= 3000)
3330# undef DWARF2_ASM_LINE_DEBUG_INFO
3331# pragma GCC poison DWARF2_ASM_LINE_DEBUG_INFO
3332#endif
3333}
3334
3335/* Return true if GCC configure detected assembler support for views
3336 in .loc directives. */
3337
3338bool
3339dwarf2out_default_as_locview_support (void)
3340{
3341 return DWARF2_ASM_VIEW_DEBUG_INFO;
3342#if (GCC_VERSION(4 * 1000 + 2) >= 3000)
3343# undef DWARF2_ASM_VIEW_DEBUG_INFO
3344# pragma GCC poison DWARF2_ASM_VIEW_DEBUG_INFO
3345#endif
3346}
3347
3348/* A bit is set in ZERO_VIEW_P if we are using the assembler-supported
3349 view computation, and it refers to a view identifier for which we
3350 will not emit a label because it is known to map to a view number
3351 zero. We won't allocate the bitmap if we're not using assembler
3352 support for location views, but we have to make the variable
3353 visible for GGC and for code that will be optimized out for lack of
3354 support but that's still parsed and compiled. We could abstract it
3355 out with macros, but it's not worth it. */
3356static GTY(()) bitmap zero_view_p;
3357
3358/* Evaluate to TRUE iff N is known to identify the first location view
3359 at its PC. When not using assembler location view computation,
3360 that must be view number zero. Otherwise, ZERO_VIEW_P is allocated
3361 and views label numbers recorded in it are the ones known to be
3362 zero. */
3363#define ZERO_VIEW_P(N)((N) == (var_loc_view)0 || (N) == (var_loc_view)-1 || (zero_view_p
&& bitmap_bit_p (zero_view_p, (N))))
((N) == (var_loc_view)0 \
3364 || (N) == (var_loc_view)-1 \
3365 || (zero_view_p \
3366 && bitmap_bit_p (zero_view_p, (N))))
3367
3368/* Return true iff we're to emit .loc directives for the assembler to
3369 generate line number sections.
3370
3371 When we're not emitting views, all we need from the assembler is
3372 support for .loc directives.
3373
3374 If we are emitting views, we can only use the assembler's .loc
3375 support if it also supports views.
3376
3377 When the compiler is emitting the line number programs and
3378 computing view numbers itself, it resets view numbers at known PC
3379 changes and counts from that, and then it emits view numbers as
3380 literal constants in locviewlists. There are cases in which the
3381 compiler is not sure about PC changes, e.g. when extra alignment is
3382 requested for a label. In these cases, the compiler may not reset
3383 the view counter, and the potential PC advance in the line number
3384 program will use an opcode that does not reset the view counter
3385 even if the PC actually changes, so that compiler and debug info
3386 consumer can keep view numbers in sync.
3387
3388 When the compiler defers view computation to the assembler, it
3389 emits symbolic view numbers in locviewlists, with the exception of
3390 views known to be zero (forced resets, or reset after
3391 compiler-visible PC changes): instead of emitting symbols for
3392 these, we emit literal zero and assert the assembler agrees with
3393 the compiler's assessment. We could use symbolic views everywhere,
3394 instead of special-casing zero views, but then we'd be unable to
3395 optimize out locviewlists that contain only zeros. */
3396
3397static bool
3398output_asm_line_debug_info (void)
3399{
3400 return (dwarf2out_as_loc_supportglobal_options.x_dwarf2out_as_loc_support
3401 && (dwarf2out_as_locview_supportglobal_options.x_dwarf2out_as_locview_support
3402 || !debug_variable_location_viewsglobal_options.x_debug_variable_location_views));
3403}
3404
3405static bool asm_outputs_debug_line_str (void);
3406
3407/* Minimum line offset in a special line info. opcode.
3408 This value was chosen to give a reasonable range of values. */
3409#define DWARF_LINE_BASE-10 -10
3410
3411/* First special line opcode - leave room for the standard opcodes. */
3412#define DWARF_LINE_OPCODE_BASE((int)DW_LNS_set_isa + 1) ((int)DW_LNS_set_isa + 1)
3413
3414/* Range of line offsets in a special line info. opcode. */
3415#define DWARF_LINE_RANGE(254-((int)DW_LNS_set_isa + 1)+1) (254-DWARF_LINE_OPCODE_BASE((int)DW_LNS_set_isa + 1)+1)
3416
3417/* Flag that indicates the initial value of the is_stmt_start flag.
3418 In the present implementation, we do not mark any lines as
3419 the beginning of a source statement, because that information
3420 is not made available by the GCC front-end. */
3421#define DWARF_LINE_DEFAULT_IS_STMT_START1 1
3422
3423/* Maximum number of operations per instruction bundle. */
3424#ifndef DWARF_LINE_DEFAULT_MAX_OPS_PER_INSN1
3425#define DWARF_LINE_DEFAULT_MAX_OPS_PER_INSN1 1
3426#endif
3427
3428/* This location is used by calc_die_sizes() to keep track
3429 the offset of each DIE within the .debug_info section. */
3430static unsigned long next_die_offset;
3431
3432/* Record the root of the DIE's built for the current compilation unit. */
3433static GTY(()) dw_die_ref single_comp_unit_die;
3434
3435/* A list of type DIEs that have been separated into comdat sections. */
3436static GTY(()) comdat_type_node *comdat_type_list;
3437
3438/* A list of CU DIEs that have been separated. */
3439static GTY(()) limbo_die_node *cu_die_list;
3440
3441/* A list of DIEs with a NULL parent waiting to be relocated. */
3442static GTY(()) limbo_die_node *limbo_die_list;
3443
3444/* A list of DIEs for which we may have to generate
3445 DW_AT_{,MIPS_}linkage_name once their DECL_ASSEMBLER_NAMEs are set. */
3446static GTY(()) limbo_die_node *deferred_asm_name;
3447
3448struct dwarf_file_hasher : ggc_ptr_hash<dwarf_file_data>
3449{
3450 typedef const char *compare_type;
3451
3452 static hashval_t hash (dwarf_file_data *);
3453 static bool equal (dwarf_file_data *, const char *);
3454};
3455
3456/* Filenames referenced by this compilation unit. */
3457static GTY(()) hash_table<dwarf_file_hasher> *file_table;
3458
3459struct decl_die_hasher : ggc_ptr_hash<die_node>
3460{
3461 typedef tree compare_type;
3462
3463 static hashval_t hash (die_node *);
3464 static bool equal (die_node *, tree);
3465};
3466/* A hash table of references to DIE's that describe declarations.
3467 The key is a DECL_UID() which is a unique number identifying each decl. */
3468static GTY (()) hash_table<decl_die_hasher> *decl_die_table;
3469
3470struct GTY ((for_user)) variable_value_struct {
3471 unsigned int decl_id;
3472 vec<dw_die_ref, va_gc> *dies;
3473};
3474
3475struct variable_value_hasher : ggc_ptr_hash<variable_value_struct>
3476{
3477 typedef tree compare_type;
3478
3479 static hashval_t hash (variable_value_struct *);
3480 static bool equal (variable_value_struct *, tree);
3481};
3482/* A hash table of DIEs that contain DW_OP_GNU_variable_value with
3483 dw_val_class_decl_ref class, indexed by FUNCTION_DECLs which is
3484 DECL_CONTEXT of the referenced VAR_DECLs. */
3485static GTY (()) hash_table<variable_value_hasher> *variable_value_hash;
3486
3487struct block_die_hasher : ggc_ptr_hash<die_struct>
3488{
3489 static hashval_t hash (die_struct *);
3490 static bool equal (die_struct *, die_struct *);
3491};
3492
3493/* A hash table of references to DIE's that describe COMMON blocks.
3494 The key is DECL_UID() ^ die_parent. */
3495static GTY (()) hash_table<block_die_hasher> *common_block_die_table;
3496
3497typedef struct GTY(()) die_arg_entry_struct {
3498 dw_die_ref die;
3499 tree arg;
3500} die_arg_entry;
3501
3502
3503/* Node of the variable location list. */
3504struct GTY ((chain_next ("%h.next"))) var_loc_node {
3505 /* Either NOTE_INSN_VAR_LOCATION, or, for SRA optimized variables,
3506 EXPR_LIST chain. For small bitsizes, bitsize is encoded
3507 in mode of the EXPR_LIST node and first EXPR_LIST operand
3508 is either NOTE_INSN_VAR_LOCATION for a piece with a known
3509 location or NULL for padding. For larger bitsizes,
3510 mode is 0 and first operand is a CONCAT with bitsize
3511 as first CONCAT operand and NOTE_INSN_VAR_LOCATION resp.
3512 NULL as second operand. */
3513 rtx GTY (()) loc;
3514 const char * GTY (()) label;
3515 struct var_loc_node * GTY (()) next;
3516 var_loc_view view;
3517};
3518
3519/* Variable location list. */
3520struct GTY ((for_user)) var_loc_list_def {
3521 struct var_loc_node * GTY (()) first;
3522
3523 /* Pointer to the last but one or last element of the
3524 chained list. If the list is empty, both first and
3525 last are NULL, if the list contains just one node
3526 or the last node certainly is not redundant, it points
3527 to the last node, otherwise points to the last but one.
3528 Do not mark it for GC because it is marked through the chain. */
3529 struct var_loc_node * GTY ((skip ("%h"))) last;
3530
3531 /* Pointer to the last element before section switch,
3532 if NULL, either sections weren't switched or first
3533 is after section switch. */
3534 struct var_loc_node * GTY ((skip ("%h"))) last_before_switch;
3535
3536 /* DECL_UID of the variable decl. */
3537 unsigned int decl_id;
3538};
3539typedef struct var_loc_list_def var_loc_list;
3540
3541/* Call argument location list. */
3542struct GTY ((chain_next ("%h.next"))) call_arg_loc_node {
3543 rtx GTY (()) call_arg_loc_note;
3544 const char * GTY (()) label;
3545 tree GTY (()) block;
3546 bool tail_call_p;
3547 rtx GTY (()) symbol_ref;
3548 struct call_arg_loc_node * GTY (()) next;
3549};
3550
3551
3552struct decl_loc_hasher : ggc_ptr_hash<var_loc_list>
3553{
3554 typedef const_tree compare_type;
3555
3556 static hashval_t hash (var_loc_list *);
3557 static bool equal (var_loc_list *, const_tree);
3558};
3559
3560/* Table of decl location linked lists. */
3561static GTY (()) hash_table<decl_loc_hasher> *decl_loc_table;
3562
3563/* Head and tail of call_arg_loc chain. */
3564static GTY (()) struct call_arg_loc_node *call_arg_locations;
3565static struct call_arg_loc_node *call_arg_loc_last;
3566
3567/* Number of call sites in the current function. */
3568static int call_site_count = -1;
3569/* Number of tail call sites in the current function. */
3570static int tail_call_site_count = -1;
3571
3572/* A cached location list. */
3573struct GTY ((for_user)) cached_dw_loc_list_def {
3574 /* The DECL_UID of the decl that this entry describes. */
3575 unsigned int decl_id;
3576
3577 /* The cached location list. */
3578 dw_loc_list_ref loc_list;
3579};
3580typedef struct cached_dw_loc_list_def cached_dw_loc_list;
3581
3582struct dw_loc_list_hasher : ggc_ptr_hash<cached_dw_loc_list>
3583{
3584
3585 typedef const_tree compare_type;
3586
3587 static hashval_t hash (cached_dw_loc_list *);
3588 static bool equal (cached_dw_loc_list *, const_tree);
3589};
3590
3591/* Table of cached location lists. */
3592static GTY (()) hash_table<dw_loc_list_hasher> *cached_dw_loc_list_table;
3593
3594/* A vector of references to DIE's that are uniquely identified by their tag,
3595 presence/absence of children DIE's, and list of attribute/value pairs. */
3596static GTY(()) vec<dw_die_ref, va_gc> *abbrev_die_table;
3597
3598/* A hash map to remember the stack usage for DWARF procedures. The value
3599 stored is the stack size difference between before the DWARF procedure
3600 invokation and after it returned. In other words, for a DWARF procedure
3601 that consumes N stack slots and that pushes M ones, this stores M - N. */
3602static hash_map<dw_die_ref, int> *dwarf_proc_stack_usage_map;
3603
3604/* A global counter for generating labels for line number data. */
3605static unsigned int line_info_label_num;
3606
3607/* The current table to which we should emit line number information
3608 for the current function. This will be set up at the beginning of
3609 assembly for the function. */
3610static GTY(()) dw_line_info_table *cur_line_info_table;
3611
3612/* The two default tables of line number info. */
3613static GTY(()) dw_line_info_table *text_section_line_info;
3614static GTY(()) dw_line_info_table *cold_text_section_line_info;
3615
3616/* The set of all non-default tables of line number info. */
3617static GTY(()) vec<dw_line_info_table *, va_gc> *separate_line_info;
3618
3619/* A flag to tell pubnames/types export if there is an info section to
3620 refer to. */
3621static bool info_section_emitted;
3622
3623/* A pointer to the base of a table that contains a list of publicly
3624 accessible names. */
3625static GTY (()) vec<pubname_entry, va_gc> *pubname_table;
3626
3627/* A pointer to the base of a table that contains a list of publicly
3628 accessible types. */
3629static GTY (()) vec<pubname_entry, va_gc> *pubtype_table;
3630
3631/* A pointer to the base of a table that contains a list of macro
3632 defines/undefines (and file start/end markers). */
3633static GTY (()) vec<macinfo_entry, va_gc> *macinfo_table;
3634
3635/* True if .debug_macinfo or .debug_macros section is going to be
3636 emitted. */
3637#define have_macinfo((!0 || 0) && global_options.x_debug_info_level >=
DINFO_LEVEL_VERBOSE && !macinfo_table->is_empty (
))
\
3638 ((!XCOFF_DEBUGGING_INFO0 || HAVE_XCOFF_DWARF_EXTRAS0) \
3639 && debug_info_levelglobal_options.x_debug_info_level >= DINFO_LEVEL_VERBOSE \
3640 && !macinfo_table->is_empty ())
3641
3642/* Vector of dies for which we should generate .debug_ranges info. */
3643static GTY (()) vec<dw_ranges, va_gc> *ranges_table;
3644
3645/* Vector of pairs of labels referenced in ranges_table. */
3646static GTY (()) vec<dw_ranges_by_label, va_gc> *ranges_by_label;
3647
3648/* Whether we have location lists that need outputting */
3649static GTY(()) bool have_location_lists;
3650
3651/* Unique label counter. */
3652static GTY(()) unsigned int loclabel_num;
3653
3654/* Unique label counter for point-of-call tables. */
3655static GTY(()) unsigned int poc_label_num;
3656
3657/* The last file entry emitted by maybe_emit_file(). */
3658static GTY(()) struct dwarf_file_data * last_emitted_file;
3659
3660/* Number of internal labels generated by gen_internal_sym(). */
3661static GTY(()) int label_num;
3662
3663static GTY(()) vec<die_arg_entry, va_gc> *tmpl_value_parm_die_table;
3664
3665/* Instances of generic types for which we need to generate debug
3666 info that describe their generic parameters and arguments. That
3667 generation needs to happen once all types are properly laid out so
3668 we do it at the end of compilation. */
3669static GTY(()) vec<tree, va_gc> *generic_type_instances;
3670
3671/* Offset from the "steady-state frame pointer" to the frame base,
3672 within the current function. */
3673static poly_int64 frame_pointer_fb_offset;
3674static bool frame_pointer_fb_offset_valid;
3675
3676static vec<dw_die_ref> base_types;
3677
3678/* Flags to represent a set of attribute classes for attributes that represent
3679 a scalar value (bounds, pointers, ...). */
3680enum dw_scalar_form
3681{
3682 dw_scalar_form_constant = 0x01,
3683 dw_scalar_form_exprloc = 0x02,
3684 dw_scalar_form_reference = 0x04
3685};
3686
3687/* Forward declarations for functions defined in this file. */
3688
3689static int is_pseudo_reg (const_rtx);
3690static tree type_main_variant (tree);
3691static int is_tagged_type (const_tree);
3692static const char *dwarf_tag_name (unsigned);
3693static const char *dwarf_attr_name (unsigned);
3694static const char *dwarf_form_name (unsigned);
3695static tree decl_ultimate_origin (const_tree);
3696static tree decl_class_context (tree);
3697static void add_dwarf_attr (dw_die_ref, dw_attr_node *);
3698static inline unsigned int AT_index (dw_attr_node *);
3699static void add_AT_flag (dw_die_ref, enum dwarf_attribute, unsigned);
3700static inline unsigned AT_flag (dw_attr_node *);
3701static void add_AT_int (dw_die_ref, enum dwarf_attribute, HOST_WIDE_INTlong);
3702static void add_AT_unsigned (dw_die_ref, enum dwarf_attribute, unsigned HOST_WIDE_INTlong);
3703static void add_AT_double (dw_die_ref, enum dwarf_attribute,
3704 HOST_WIDE_INTlong, unsigned HOST_WIDE_INTlong);
3705static inline void add_AT_vec (dw_die_ref, enum dwarf_attribute, unsigned int,
3706 unsigned int, unsigned char *);
3707static void add_AT_data8 (dw_die_ref, enum dwarf_attribute, unsigned char *);
3708static void add_AT_string (dw_die_ref, enum dwarf_attribute, const char *);
3709static inline const char *AT_string (dw_attr_node *);
3710static enum dwarf_form AT_string_form (dw_attr_node *);
3711static void add_AT_die_ref (dw_die_ref, enum dwarf_attribute, dw_die_ref);
3712static void add_AT_specification (dw_die_ref, dw_die_ref);
3713static inline dw_die_ref AT_ref (dw_attr_node *);
3714static inline int AT_ref_external (dw_attr_node *);
3715static inline void set_AT_ref_external (dw_attr_node *, int);
3716static void add_AT_loc (dw_die_ref, enum dwarf_attribute, dw_loc_descr_ref);
3717static void add_AT_loc_list (dw_die_ref, enum dwarf_attribute,
3718 dw_loc_list_ref);
3719static inline dw_loc_list_ref AT_loc_list (dw_attr_node *);
3720static void add_AT_view_list (dw_die_ref, enum dwarf_attribute);
3721static inline dw_loc_list_ref AT_loc_list (dw_attr_node *);
3722static addr_table_entry *add_addr_table_entry (void *, enum ate_kind);
3723static void remove_addr_table_entry (addr_table_entry *);
3724static void add_AT_addr (dw_die_ref, enum dwarf_attribute, rtx, bool);
3725static inline rtx AT_addr (dw_attr_node *);
3726static void add_AT_symview (dw_die_ref, enum dwarf_attribute, const char *);
3727static void add_AT_lbl_id (dw_die_ref, enum dwarf_attribute, const char *);
3728static void add_AT_lineptr (dw_die_ref, enum dwarf_attribute, const char *);
3729static void add_AT_macptr (dw_die_ref, enum dwarf_attribute, const char *);
3730static void add_AT_range_list (dw_die_ref, enum dwarf_attribute,
3731 unsigned long, bool);
3732static inline const char *AT_lbl (dw_attr_node *);
3733static const char *get_AT_low_pc (dw_die_ref);
3734static bool is_c (void);
3735static bool is_cxx (void);
3736static bool is_cxx (const_tree);
3737static bool is_fortran (void);
3738static bool is_ada (void);
3739static bool remove_AT (dw_die_ref, enum dwarf_attribute);
3740static void remove_child_TAG (dw_die_ref, enum dwarf_tag);
3741static void add_child_die (dw_die_ref, dw_die_ref);
3742static dw_die_ref new_die (enum dwarf_tag, dw_die_ref, tree);
3743static dw_die_ref strip_naming_typedef (tree, dw_die_ref);
3744static dw_die_ref lookup_type_die_strip_naming_typedef (tree);
3745static void equate_type_number_to_die (tree, dw_die_ref);
3746static var_loc_list *lookup_decl_loc (const_tree);
3747static void equate_decl_number_to_die (tree, dw_die_ref);
3748static struct var_loc_node *add_var_loc_to_decl (tree, rtx, const char *, var_loc_view);
3749static void print_spaces (FILE *);
3750static void print_die (dw_die_ref, FILE *);
3751static void loc_checksum (dw_loc_descr_ref, struct md5_ctx *);
3752static void attr_checksum (dw_attr_node *, struct md5_ctx *, int *);
3753static void die_checksum (dw_die_ref, struct md5_ctx *, int *);
3754static void checksum_sleb128 (HOST_WIDE_INTlong, struct md5_ctx *);
3755static void checksum_uleb128 (unsigned HOST_WIDE_INTlong, struct md5_ctx *);
3756static void loc_checksum_ordered (dw_loc_descr_ref, struct md5_ctx *);
3757static void attr_checksum_ordered (enum dwarf_tag, dw_attr_node *,
3758 struct md5_ctx *, int *);
3759struct checksum_attributes;
3760static void collect_checksum_attributes (struct checksum_attributes *, dw_die_ref);
3761static void die_checksum_ordered (dw_die_ref, struct md5_ctx *, int *);
3762static void checksum_die_context (dw_die_ref, struct md5_ctx *);
3763static void generate_type_signature (dw_die_ref, comdat_type_node *);
3764static int same_loc_p (dw_loc_descr_ref, dw_loc_descr_ref, int *);
3765static int same_dw_val_p (const dw_val_node *, const dw_val_node *, int *);
3766static int same_attr_p (dw_attr_node *, dw_attr_node *, int *);
3767static int same_die_p (dw_die_ref, dw_die_ref, int *);
3768static int is_type_die (dw_die_ref);
3769static inline bool is_template_instantiation (dw_die_ref);
3770static int is_declaration_die (dw_die_ref);
3771static int should_move_die_to_comdat (dw_die_ref);
3772static dw_die_ref clone_as_declaration (dw_die_ref);
3773static dw_die_ref clone_die (dw_die_ref);
3774static dw_die_ref clone_tree (dw_die_ref);
3775static dw_die_ref copy_declaration_context (dw_die_ref, dw_die_ref);
3776static void generate_skeleton_ancestor_tree (skeleton_chain_node *);
3777static void generate_skeleton_bottom_up (skeleton_chain_node *);
3778static dw_die_ref generate_skeleton (dw_die_ref);
3779static dw_die_ref remove_child_or_replace_with_skeleton (dw_die_ref,
3780 dw_die_ref,
3781 dw_die_ref);
3782static void break_out_comdat_types (dw_die_ref);
3783static void copy_decls_for_unworthy_types (dw_die_ref);
3784
3785static void add_sibling_attributes (dw_die_ref);
3786static void output_location_lists (dw_die_ref);
3787static int constant_size (unsigned HOST_WIDE_INTlong);
3788static unsigned long size_of_die (dw_die_ref);
3789static void calc_die_sizes (dw_die_ref);
3790static void calc_base_type_die_sizes (void);
3791static void mark_dies (dw_die_ref);
3792static void unmark_dies (dw_die_ref);
3793static void unmark_all_dies (dw_die_ref);
3794static unsigned long size_of_pubnames (vec<pubname_entry, va_gc> *);
3795static unsigned long size_of_aranges (void);
3796static enum dwarf_form value_format (dw_attr_node *);
3797static void output_value_format (dw_attr_node *);
3798static void output_abbrev_section (void);
3799static void output_die_abbrevs (unsigned long, dw_die_ref);
3800static void output_die (dw_die_ref);
3801static void output_compilation_unit_header (enum dwarf_unit_type);
3802static void output_comp_unit (dw_die_ref, int, const unsigned char *);
3803static void output_comdat_type_unit (comdat_type_node *, bool);
3804static const char *dwarf2_name (tree, int);
3805static void add_pubname (tree, dw_die_ref);
3806static void add_enumerator_pubname (const char *, dw_die_ref);
3807static void add_pubname_string (const char *, dw_die_ref);
3808static void add_pubtype (tree, dw_die_ref);
3809static void output_pubnames (vec<pubname_entry, va_gc> *);
3810static void output_aranges (void);
3811static unsigned int add_ranges (const_tree, bool = false);
3812static void add_ranges_by_labels (dw_die_ref, const char *, const char *,
3813 bool *, bool);
3814static void output_ranges (void);
3815static dw_line_info_table *new_line_info_table (void);
3816static void output_line_info (bool);
3817static void output_file_names (void);
3818static int is_base_type (tree);
3819static dw_die_ref subrange_type_die (tree, tree, tree, tree, dw_die_ref);
3820static int decl_quals (const_tree);
3821static dw_die_ref modified_type_die (tree, int, bool, dw_die_ref);
3822static dw_die_ref generic_parameter_die (tree, tree, bool, dw_die_ref);
3823static dw_die_ref template_parameter_pack_die (tree, tree, dw_die_ref);
3824static unsigned int dbx_reg_number (const_rtx);
3825static void add_loc_descr_op_piece (dw_loc_descr_ref *, int);
3826static dw_loc_descr_ref reg_loc_descriptor (rtx, enum var_init_status);
3827static dw_loc_descr_ref one_reg_loc_descriptor (unsigned int,
3828 enum var_init_status);
3829static dw_loc_descr_ref multiple_reg_loc_descriptor (rtx, rtx,
3830 enum var_init_status);
3831static dw_loc_descr_ref based_loc_descr (rtx, poly_int64,
3832 enum var_init_status);
3833static int is_based_loc (const_rtx);
3834static bool resolve_one_addr (rtx *);
3835static dw_loc_descr_ref concat_loc_descriptor (rtx, rtx,
3836 enum var_init_status);
3837static dw_loc_descr_ref loc_descriptor (rtx, machine_mode mode,
3838 enum var_init_status);
3839struct loc_descr_context;
3840static void add_loc_descr_to_each (dw_loc_list_ref list, dw_loc_descr_ref ref);
3841static void add_loc_list (dw_loc_list_ref *ret, dw_loc_list_ref list);
3842static dw_loc_list_ref loc_list_from_tree (tree, int,
3843 struct loc_descr_context *);
3844static dw_loc_descr_ref loc_descriptor_from_tree (tree, int,
3845 struct loc_descr_context *);
3846static tree field_type (const_tree);
3847static unsigned int simple_type_align_in_bits (const_tree);
3848static unsigned int simple_decl_align_in_bits (const_tree);
3849static unsigned HOST_WIDE_INTlong simple_type_size_in_bits (const_tree);
3850struct vlr_context;
3851static dw_loc_descr_ref field_byte_offset (const_tree, struct vlr_context *,
3852 HOST_WIDE_INTlong *);
3853static void add_AT_location_description (dw_die_ref, enum dwarf_attribute,
3854 dw_loc_list_ref);
3855static void add_data_member_location_attribute (dw_die_ref, tree,
3856 struct vlr_context *);
3857static bool add_const_value_attribute (dw_die_ref, machine_mode, rtx);
3858static void insert_int (HOST_WIDE_INTlong, unsigned, unsigned char *);
3859static void insert_wide_int (const wide_int &, unsigned char *, int);
3860static unsigned insert_float (const_rtx, unsigned char *);
3861static rtx rtl_for_decl_location (tree);
3862static bool add_location_or_const_value_attribute (dw_die_ref, tree, bool);
3863static bool tree_add_const_value_attribute (dw_die_ref, tree);
3864static bool tree_add_const_value_attribute_for_decl (dw_die_ref, tree);
3865static void add_desc_attribute (dw_die_ref, tree);
3866static void add_gnat_descriptive_type_attribute (dw_die_ref, tree, dw_die_ref);
3867static void add_comp_dir_attribute (dw_die_ref);
3868static void add_scalar_info (dw_die_ref, enum dwarf_attribute, tree, int,
3869 struct loc_descr_context *);
3870static void add_bound_info (dw_die_ref, enum dwarf_attribute, tree,
3871 struct loc_descr_context *);
3872static void add_subscript_info (dw_die_ref, tree, bool);
3873static void add_byte_size_attribute (dw_die_ref, tree);
3874static void add_alignment_attribute (dw_die_ref, tree);
3875static void add_bit_offset_attribute (dw_die_ref, tree);
3876static void add_bit_size_attribute (dw_die_ref, tree);
3877static void add_prototyped_attribute (dw_die_ref, tree);
3878static void add_abstract_origin_attribute (dw_die_ref, tree);
3879static void add_pure_or_virtual_attribute (dw_die_ref, tree);
3880static void add_src_coords_attributes (dw_die_ref, tree);
3881static void add_name_and_src_coords_attributes (dw_die_ref, tree, bool = false);
3882static void add_discr_value (dw_die_ref, dw_discr_value *);
3883static void add_discr_list (dw_die_ref, dw_discr_list_ref);
3884static inline dw_discr_list_ref AT_discr_list (dw_attr_node *);
3885static dw_die_ref scope_die_for (tree, dw_die_ref);
3886static inline int local_scope_p (dw_die_ref);
3887static inline int class_scope_p (dw_die_ref);
3888static inline int class_or_namespace_scope_p (dw_die_ref);
3889static void add_type_attribute (dw_die_ref, tree, int, bool, dw_die_ref);
3890static void add_calling_convention_attribute (dw_die_ref, tree);
3891static const char *type_tag (const_tree);
3892static tree member_declared_type (const_tree);
3893#if 0
3894static const char *decl_start_label (tree);
3895#endif
3896static void gen_array_type_die (tree, dw_die_ref);
3897static void gen_descr_array_type_die (tree, struct array_descr_info *, dw_die_ref);
3898#if 0
3899static void gen_entry_point_die (tree, dw_die_ref);
3900#endif
3901static dw_die_ref gen_enumeration_type_die (tree, dw_die_ref);
3902static dw_die_ref gen_formal_parameter_die (tree, tree, bool, dw_die_ref);
3903static dw_die_ref gen_formal_parameter_pack_die (tree, tree, dw_die_ref, tree*);
3904static void gen_unspecified_parameters_die (tree, dw_die_ref);
3905static void gen_formal_types_die (tree, dw_die_ref);
3906static void gen_subprogram_die (tree, dw_die_ref);
3907static void gen_variable_die (tree, tree, dw_die_ref);
3908static void gen_const_die (tree, dw_die_ref);
3909static void gen_label_die (tree, dw_die_ref);
3910static void gen_lexical_block_die (tree, dw_die_ref);
3911static void gen_inlined_subroutine_die (tree, dw_die_ref);
3912static void gen_field_die (tree, struct vlr_context *, dw_die_ref);
3913static void gen_ptr_to_mbr_type_die (tree, dw_die_ref);
3914static dw_die_ref gen_compile_unit_die (const char *);
3915static void gen_inheritance_die (tree, tree, tree, dw_die_ref);
3916static void gen_member_die (tree, dw_die_ref);
3917static void gen_struct_or_union_type_die (tree, dw_die_ref,
3918 enum debug_info_usage);
3919static void gen_subroutine_type_die (tree, dw_die_ref);
3920static void gen_typedef_die (tree, dw_die_ref);
3921static void gen_type_die (tree, dw_die_ref);
3922static void gen_block_die (tree, dw_die_ref);
3923static void decls_for_scope (tree, dw_die_ref, bool = true);
3924static bool is_naming_typedef_decl (const_tree);
3925static inline dw_die_ref get_context_die (tree);
3926static void gen_namespace_die (tree, dw_die_ref);
3927static dw_die_ref gen_namelist_decl (tree, dw_die_ref, tree);
3928static dw_die_ref gen_decl_die (tree, tree, struct vlr_context *, dw_die_ref);
3929static dw_die_ref force_decl_die (tree);
3930static dw_die_ref force_type_die (tree);
3931static dw_die_ref setup_namespace_context (tree, dw_die_ref);
3932static dw_die_ref declare_in_namespace (tree, dw_die_ref);
3933static struct dwarf_file_data * lookup_filename (const char *);
3934static void retry_incomplete_types (void);
3935static void gen_type_die_for_member (tree, tree, dw_die_ref);
3936static void gen_generic_params_dies (tree);
3937static void gen_tagged_type_die (tree, dw_die_ref, enum debug_info_usage);
3938static void gen_type_die_with_usage (tree, dw_die_ref, enum debug_info_usage);
3939static void splice_child_die (dw_die_ref, dw_die_ref);
3940static int file_info_cmp (const void *, const void *);
3941static dw_loc_list_ref new_loc_list (dw_loc_descr_ref, const char *, var_loc_view,
3942 const char *, var_loc_view, const char *);
3943static void output_loc_list (dw_loc_list_ref);
3944static char *gen_internal_sym (const char *);
3945static bool want_pubnames (void);
3946
3947static void prune_unmark_dies (dw_die_ref);
3948static void prune_unused_types_mark_generic_parms_dies (dw_die_ref);
3949static void prune_unused_types_mark (dw_die_ref, int);
3950static void prune_unused_types_walk (dw_die_ref);
3951static void prune_unused_types_walk_attribs (dw_die_ref);
3952static void prune_unused_types_prune (dw_die_ref);
3953static void prune_unused_types (void);
3954static int maybe_emit_file (struct dwarf_file_data *fd);
3955static inline const char *AT_vms_delta1 (dw_attr_node *);
3956static inline const char *AT_vms_delta2 (dw_attr_node *);
3957#if VMS_DEBUGGING_INFO
3958static inline void add_AT_vms_delta (dw_die_ref, enum dwarf_attribute,
3959 const char *, const char *);
3960#endif
3961static void append_entry_to_tmpl_value_parm_die_table (dw_die_ref, tree);
3962static void gen_remaining_tmpl_value_param_die_attribute (void);
3963static bool generic_type_p (tree);
3964static void schedule_generic_params_dies_gen (tree t);
3965static void gen_scheduled_generic_parms_dies (void);
3966static void resolve_variable_values (void);
3967
3968static const char *comp_dir_string (void);
3969
3970static void hash_loc_operands (dw_loc_descr_ref, inchash::hash &);
3971
3972/* enum for tracking thread-local variables whose address is really an offset
3973 relative to the TLS pointer, which will need link-time relocation, but will
3974 not need relocation by the DWARF consumer. */
3975
3976enum dtprel_bool
3977{
3978 dtprel_false = 0,
3979 dtprel_true = 1
3980};
3981
3982/* Return the operator to use for an address of a variable. For dtprel_true, we
3983 use DW_OP_const*. For regular variables, which need both link-time
3984 relocation and consumer-level relocation (e.g., to account for shared objects
3985 loaded at a random address), we use DW_OP_addr*. */
3986
3987static inline enum dwarf_location_atom
3988dw_addr_op (enum dtprel_bool dtprel)
3989{
3990 if (dtprel == dtprel_true)
3991 return (dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info ? dwarf_OP (DW_OP_constx)
3992 : (DWARF2_ADDR_SIZE(((((global_options.x_ix86_isa_flags & (1UL << 58))
!= 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags &
(1UL << 1)) != 0) ? 8 : 4))) + (8) - 1) / (8))
== 4 ? DW_OP_const4u : DW_OP_const8u));
3993 else
3994 return dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info ? dwarf_OP (DW_OP_addrx) : DW_OP_addr;
3995}
3996
3997/* Return a pointer to a newly allocated address location description. If
3998 dwarf_split_debug_info is true, then record the address with the appropriate
3999 relocation. */
4000static inline dw_loc_descr_ref
4001new_addr_loc_descr (rtx addr, enum dtprel_bool dtprel)
4002{
4003 dw_loc_descr_ref ref = new_loc_descr (dw_addr_op (dtprel), 0, 0);
4004
4005 ref->dw_loc_oprnd1.val_class = dw_val_class_addr;
4006 ref->dw_loc_oprnd1.v.val_addr = addr;
4007 ref->dtprel = dtprel;
4008 if (dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info)
4009 ref->dw_loc_oprnd1.val_entry
4010 = add_addr_table_entry (addr,
4011 dtprel ? ate_kind_rtx_dtprel : ate_kind_rtx);
4012 else
4013 ref->dw_loc_oprnd1.val_entry = NULLnullptr;
4014
4015 return ref;
4016}
4017
4018/* Section names used to hold DWARF debugging information. */
4019
4020#ifndef DEBUG_INFO_SECTION".debug_info"
4021#define DEBUG_INFO_SECTION".debug_info" ".debug_info"
4022#endif
4023#ifndef DEBUG_DWO_INFO_SECTION".debug_info.dwo"
4024#define DEBUG_DWO_INFO_SECTION".debug_info.dwo" ".debug_info.dwo"
4025#endif
4026#ifndef DEBUG_LTO_INFO_SECTION".gnu.debuglto_.debug_info"
4027#define DEBUG_LTO_INFO_SECTION".gnu.debuglto_.debug_info" ".gnu.debuglto_.debug_info"
4028#endif
4029#ifndef DEBUG_LTO_DWO_INFO_SECTION".gnu.debuglto_.debug_info.dwo"
4030#define DEBUG_LTO_DWO_INFO_SECTION".gnu.debuglto_.debug_info.dwo" ".gnu.debuglto_.debug_info.dwo"
4031#endif
4032#ifndef DEBUG_ABBREV_SECTION".debug_abbrev"
4033#define DEBUG_ABBREV_SECTION".debug_abbrev" ".debug_abbrev"
4034#endif
4035#ifndef DEBUG_LTO_ABBREV_SECTION".gnu.debuglto_.debug_abbrev"
4036#define DEBUG_LTO_ABBREV_SECTION".gnu.debuglto_.debug_abbrev" ".gnu.debuglto_.debug_abbrev"
4037#endif
4038#ifndef DEBUG_DWO_ABBREV_SECTION".debug_abbrev.dwo"
4039#define DEBUG_DWO_ABBREV_SECTION".debug_abbrev.dwo" ".debug_abbrev.dwo"
4040#endif
4041#ifndef DEBUG_LTO_DWO_ABBREV_SECTION".gnu.debuglto_.debug_abbrev.dwo"
4042#define DEBUG_LTO_DWO_ABBREV_SECTION".gnu.debuglto_.debug_abbrev.dwo" ".gnu.debuglto_.debug_abbrev.dwo"
4043#endif
4044#ifndef DEBUG_ARANGES_SECTION".debug_aranges"
4045#define DEBUG_ARANGES_SECTION".debug_aranges" ".debug_aranges"
4046#endif
4047#ifndef DEBUG_ADDR_SECTION".debug_addr"
4048#define DEBUG_ADDR_SECTION".debug_addr" ".debug_addr"
4049#endif
4050#ifndef DEBUG_MACINFO_SECTION".debug_macinfo"
4051#define DEBUG_MACINFO_SECTION".debug_macinfo" ".debug_macinfo"
4052#endif
4053#ifndef DEBUG_LTO_MACINFO_SECTION".gnu.debuglto_.debug_macinfo"
4054#define DEBUG_LTO_MACINFO_SECTION".gnu.debuglto_.debug_macinfo" ".gnu.debuglto_.debug_macinfo"
4055#endif
4056#ifndef DEBUG_DWO_MACINFO_SECTION".debug_macinfo.dwo"
4057#define DEBUG_DWO_MACINFO_SECTION".debug_macinfo.dwo" ".debug_macinfo.dwo"
4058#endif
4059#ifndef DEBUG_LTO_DWO_MACINFO_SECTION".gnu.debuglto_.debug_macinfo.dwo"
4060#define DEBUG_LTO_DWO_MACINFO_SECTION".gnu.debuglto_.debug_macinfo.dwo" ".gnu.debuglto_.debug_macinfo.dwo"
4061#endif
4062#ifndef DEBUG_MACRO_SECTION".debug_macro"
4063#define DEBUG_MACRO_SECTION".debug_macro" ".debug_macro"
4064#endif
4065#ifndef DEBUG_LTO_MACRO_SECTION".gnu.debuglto_.debug_macro"
4066#define DEBUG_LTO_MACRO_SECTION".gnu.debuglto_.debug_macro" ".gnu.debuglto_.debug_macro"
4067#endif
4068#ifndef DEBUG_DWO_MACRO_SECTION".debug_macro.dwo"
4069#define DEBUG_DWO_MACRO_SECTION".debug_macro.dwo" ".debug_macro.dwo"
4070#endif
4071#ifndef DEBUG_LTO_DWO_MACRO_SECTION".gnu.debuglto_.debug_macro.dwo"
4072#define DEBUG_LTO_DWO_MACRO_SECTION".gnu.debuglto_.debug_macro.dwo" ".gnu.debuglto_.debug_macro.dwo"
4073#endif
4074#ifndef DEBUG_LINE_SECTION".debug_line"
4075#define DEBUG_LINE_SECTION".debug_line" ".debug_line"
4076#endif
4077#ifndef DEBUG_LTO_LINE_SECTION".gnu.debuglto_.debug_line"
4078#define DEBUG_LTO_LINE_SECTION".gnu.debuglto_.debug_line" ".gnu.debuglto_.debug_line"
4079#endif
4080#ifndef DEBUG_DWO_LINE_SECTION".debug_line.dwo"
4081#define DEBUG_DWO_LINE_SECTION".debug_line.dwo" ".debug_line.dwo"
4082#endif
4083#ifndef DEBUG_LTO_DWO_LINE_SECTION".gnu.debuglto_.debug_line.dwo"
4084#define DEBUG_LTO_DWO_LINE_SECTION".gnu.debuglto_.debug_line.dwo" ".gnu.debuglto_.debug_line.dwo"
4085#endif
4086#ifndef DEBUG_LOC_SECTION".debug_loc"
4087#define DEBUG_LOC_SECTION".debug_loc" ".debug_loc"
4088#endif
4089#ifndef DEBUG_DWO_LOC_SECTION".debug_loc.dwo"
4090#define DEBUG_DWO_LOC_SECTION".debug_loc.dwo" ".debug_loc.dwo"
4091#endif
4092#ifndef DEBUG_LOCLISTS_SECTION".debug_loclists"
4093#define DEBUG_LOCLISTS_SECTION".debug_loclists" ".debug_loclists"
4094#endif
4095#ifndef DEBUG_DWO_LOCLISTS_SECTION".debug_loclists.dwo"
4096#define DEBUG_DWO_LOCLISTS_SECTION".debug_loclists.dwo" ".debug_loclists.dwo"
4097#endif
4098#ifndef DEBUG_PUBNAMES_SECTION((global_options.x_debug_generate_pub_sections == 2) ? ".debug_gnu_pubnames"
: ".debug_pubnames")
4099#define DEBUG_PUBNAMES_SECTION((global_options.x_debug_generate_pub_sections == 2) ? ".debug_gnu_pubnames"
: ".debug_pubnames")
\
4100 ((debug_generate_pub_sectionsglobal_options.x_debug_generate_pub_sections == 2) \
4101 ? ".debug_gnu_pubnames" : ".debug_pubnames")
4102#endif
4103#ifndef DEBUG_PUBTYPES_SECTION((global_options.x_debug_generate_pub_sections == 2) ? ".debug_gnu_pubtypes"
: ".debug_pubtypes")
4104#define DEBUG_PUBTYPES_SECTION((global_options.x_debug_generate_pub_sections == 2) ? ".debug_gnu_pubtypes"
: ".debug_pubtypes")
\
4105 ((debug_generate_pub_sectionsglobal_options.x_debug_generate_pub_sections == 2) \
4106 ? ".debug_gnu_pubtypes" : ".debug_pubtypes")
4107#endif
4108#ifndef DEBUG_STR_OFFSETS_SECTION".debug_str_offsets"
4109#define DEBUG_STR_OFFSETS_SECTION".debug_str_offsets" ".debug_str_offsets"
4110#endif
4111#ifndef DEBUG_DWO_STR_OFFSETS_SECTION".debug_str_offsets.dwo"
4112#define DEBUG_DWO_STR_OFFSETS_SECTION".debug_str_offsets.dwo" ".debug_str_offsets.dwo"
4113#endif
4114#ifndef DEBUG_LTO_DWO_STR_OFFSETS_SECTION".gnu.debuglto_.debug_str_offsets.dwo"
4115#define DEBUG_LTO_DWO_STR_OFFSETS_SECTION".gnu.debuglto_.debug_str_offsets.dwo" ".gnu.debuglto_.debug_str_offsets.dwo"
4116#endif
4117#ifndef DEBUG_STR_SECTION".debug_str"
4118#define DEBUG_STR_SECTION".debug_str" ".debug_str"
4119#endif
4120#ifndef DEBUG_LTO_STR_SECTION".gnu.debuglto_.debug_str"
4121#define DEBUG_LTO_STR_SECTION".gnu.debuglto_.debug_str" ".gnu.debuglto_.debug_str"
4122#endif
4123#ifndef DEBUG_STR_DWO_SECTION".debug_str.dwo"
4124#define DEBUG_STR_DWO_SECTION".debug_str.dwo" ".debug_str.dwo"
4125#endif
4126#ifndef DEBUG_LTO_STR_DWO_SECTION".gnu.debuglto_.debug_str.dwo"
4127#define DEBUG_LTO_STR_DWO_SECTION".gnu.debuglto_.debug_str.dwo" ".gnu.debuglto_.debug_str.dwo"
4128#endif
4129#ifndef DEBUG_RANGES_SECTION".debug_ranges"
4130#define DEBUG_RANGES_SECTION".debug_ranges" ".debug_ranges"
4131#endif
4132#ifndef DEBUG_RNGLISTS_SECTION".debug_rnglists"
4133#define DEBUG_RNGLISTS_SECTION".debug_rnglists" ".debug_rnglists"
4134#endif
4135#ifndef DEBUG_DWO_RNGLISTS_SECTION".debug_rnglists.dwo"
4136#define DEBUG_DWO_RNGLISTS_SECTION".debug_rnglists.dwo" ".debug_rnglists.dwo"
4137#endif
4138#ifndef DEBUG_LINE_STR_SECTION".debug_line_str"
4139#define DEBUG_LINE_STR_SECTION".debug_line_str" ".debug_line_str"
4140#endif
4141#ifndef DEBUG_LTO_LINE_STR_SECTION".gnu.debuglto_.debug_line_str"
4142#define DEBUG_LTO_LINE_STR_SECTION".gnu.debuglto_.debug_line_str" ".gnu.debuglto_.debug_line_str"
4143#endif
4144
4145/* Standard ELF section names for compiled code and data. */
4146#ifndef TEXT_SECTION_NAME".text"
4147#define TEXT_SECTION_NAME".text" ".text"
4148#endif
4149
4150/* Section flags for .debug_str section. */
4151#define DEBUG_STR_SECTION_FLAGS(1 && global_options.x_flag_merge_debug_strings ? SECTION_DEBUG
| SECTION_MERGE | SECTION_STRINGS | 1 : SECTION_DEBUG)
\
4152 (HAVE_GAS_SHF_MERGE1 && flag_merge_debug_stringsglobal_options.x_flag_merge_debug_strings \
4153 ? SECTION_DEBUG | SECTION_MERGE | SECTION_STRINGS | 1 \
4154 : SECTION_DEBUG)
4155
4156/* Section flags for .debug_str.dwo section. */
4157#define DEBUG_STR_DWO_SECTION_FLAGS(SECTION_DEBUG | SECTION_EXCLUDE) (SECTION_DEBUG | SECTION_EXCLUDE)
4158
4159/* Attribute used to refer to the macro section. */
4160#define DEBUG_MACRO_ATTRIBUTE(global_options.x_dwarf_version >= 5 ? DW_AT_macros : global_options
.x_dwarf_strict ? DW_AT_macro_info : DW_AT_GNU_macros)
(dwarf_versionglobal_options.x_dwarf_version >= 5 ? DW_AT_macros \
4161 : dwarf_strictglobal_options.x_dwarf_strict ? DW_AT_macro_info : DW_AT_GNU_macros)
4162
4163/* Labels we insert at beginning sections we can reference instead of
4164 the section names themselves. */
4165
4166#ifndef TEXT_SECTION_LABEL"Ltext"
4167#define TEXT_SECTION_LABEL"Ltext" "Ltext"
4168#endif
4169#ifndef COLD_TEXT_SECTION_LABEL"Ltext_cold"
4170#define COLD_TEXT_SECTION_LABEL"Ltext_cold" "Ltext_cold"
4171#endif
4172#ifndef DEBUG_LINE_SECTION_LABEL"Ldebug_line"
4173#define DEBUG_LINE_SECTION_LABEL"Ldebug_line" "Ldebug_line"
4174#endif
4175#ifndef DEBUG_SKELETON_LINE_SECTION_LABEL"Lskeleton_debug_line"
4176#define DEBUG_SKELETON_LINE_SECTION_LABEL"Lskeleton_debug_line" "Lskeleton_debug_line"
4177#endif
4178#ifndef DEBUG_INFO_SECTION_LABEL"Ldebug_info"
4179#define DEBUG_INFO_SECTION_LABEL"Ldebug_info" "Ldebug_info"
4180#endif
4181#ifndef DEBUG_SKELETON_INFO_SECTION_LABEL"Lskeleton_debug_info"
4182#define DEBUG_SKELETON_INFO_SECTION_LABEL"Lskeleton_debug_info" "Lskeleton_debug_info"
4183#endif
4184#ifndef DEBUG_ABBREV_SECTION_LABEL"Ldebug_abbrev"
4185#define DEBUG_ABBREV_SECTION_LABEL"Ldebug_abbrev" "Ldebug_abbrev"
4186#endif
4187#ifndef DEBUG_SKELETON_ABBREV_SECTION_LABEL"Lskeleton_debug_abbrev"
4188#define DEBUG_SKELETON_ABBREV_SECTION_LABEL"Lskeleton_debug_abbrev" "Lskeleton_debug_abbrev"
4189#endif
4190#ifndef DEBUG_ADDR_SECTION_LABEL"Ldebug_addr"
4191#define DEBUG_ADDR_SECTION_LABEL"Ldebug_addr" "Ldebug_addr"
4192#endif
4193#ifndef DEBUG_LOC_SECTION_LABEL"Ldebug_loc"
4194#define DEBUG_LOC_SECTION_LABEL"Ldebug_loc" "Ldebug_loc"
4195#endif
4196#ifndef DEBUG_RANGES_SECTION_LABEL"Ldebug_ranges"
4197#define DEBUG_RANGES_SECTION_LABEL"Ldebug_ranges" "Ldebug_ranges"
4198#endif
4199#ifndef DEBUG_MACINFO_SECTION_LABEL"Ldebug_macinfo"
4200#define DEBUG_MACINFO_SECTION_LABEL"Ldebug_macinfo" "Ldebug_macinfo"
4201#endif
4202#ifndef DEBUG_MACRO_SECTION_LABEL"Ldebug_macro"
4203#define DEBUG_MACRO_SECTION_LABEL"Ldebug_macro" "Ldebug_macro"
4204#endif
4205#define SKELETON_COMP_DIE_ABBREV1 1
4206#define SKELETON_TYPE_DIE_ABBREV2 2
4207
4208/* Definitions of defaults for formats and names of various special
4209 (artificial) labels which may be generated within this file (when the -g
4210 options is used and DWARF2_DEBUGGING_INFO is in effect.
4211 If necessary, these may be overridden from within the tm.h file, but
4212 typically, overriding these defaults is unnecessary. */
4213
4214static char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4215static char text_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4216static char cold_text_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4217static char cold_end_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4218static char abbrev_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4219static char debug_info_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4220static char debug_skeleton_info_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4221static char debug_skeleton_abbrev_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4222static char debug_line_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4223static char debug_addr_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4224static char debug_skeleton_line_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4225static char macinfo_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4226static char loc_section_label[MAX_ARTIFICIAL_LABEL_BYTES40];
4227static char ranges_section_label[2 * MAX_ARTIFICIAL_LABEL_BYTES40];
4228static char ranges_base_label[2 * MAX_ARTIFICIAL_LABEL_BYTES40];
4229
4230#ifndef TEXT_END_LABEL"Letext"
4231#define TEXT_END_LABEL"Letext" "Letext"
4232#endif
4233#ifndef COLD_END_LABEL"Letext_cold"
4234#define COLD_END_LABEL"Letext_cold" "Letext_cold"
4235#endif
4236#ifndef BLOCK_BEGIN_LABEL"LBB"
4237#define BLOCK_BEGIN_LABEL"LBB" "LBB"
4238#endif
4239#ifndef BLOCK_INLINE_ENTRY_LABEL"LBI"
4240#define BLOCK_INLINE_ENTRY_LABEL"LBI" "LBI"
4241#endif
4242#ifndef BLOCK_END_LABEL"LBE"
4243#define BLOCK_END_LABEL"LBE" "LBE"
4244#endif
4245#ifndef LINE_CODE_LABEL"LM"
4246#define LINE_CODE_LABEL"LM" "LM"
4247#endif
4248
4249
4250/* Return the root of the DIE's built for the current compilation unit. */
4251static dw_die_ref
4252comp_unit_die (void)
4253{
4254 if (!single_comp_unit_die)
4255 single_comp_unit_die = gen_compile_unit_die (NULLnullptr);
4256 return single_comp_unit_die;
4257}
4258
4259/* We allow a language front-end to designate a function that is to be
4260 called to "demangle" any name before it is put into a DIE. */
4261
4262static const char *(*demangle_name_func) (const char *);
4263
4264void
4265dwarf2out_set_demangle_name_func (const char *(*func) (const char *))
4266{
4267 demangle_name_func = func;
4268}
4269
4270/* Test if rtl node points to a pseudo register. */
4271
4272static inline int
4273is_pseudo_reg (const_rtx rtl)
4274{
4275 return ((REG_P (rtl)(((enum rtx_code) (rtl)->code) == REG) && REGNO (rtl)(rhs_regno(rtl)) >= FIRST_PSEUDO_REGISTER76)
4276 || (GET_CODE (rtl)((enum rtx_code) (rtl)->code) == SUBREG
4277 && REGNO (SUBREG_REG (rtl))(rhs_regno((((rtl)->u.fld[0]).rt_rtx))) >= FIRST_PSEUDO_REGISTER76));
4278}
4279
4280/* Return a reference to a type, with its const and volatile qualifiers
4281 removed. */
4282
4283static inline tree
4284type_main_variant (tree type)
4285{
4286 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4286, __FUNCTION__))->type_common.main_variant)
;
4287
4288 /* ??? There really should be only one main variant among any group of
4289 variants of a given type (and all of the MAIN_VARIANT values for all
4290 members of the group should point to that one type) but sometimes the C
4291 front-end messes this up for array types, so we work around that bug
4292 here. */
4293 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE)
4294 while (type != TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4294, __FUNCTION__))->type_common.main_variant)
)
4295 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4295, __FUNCTION__))->type_common.main_variant)
;
4296
4297 return type;
4298}
4299
4300/* Return nonzero if the given type node represents a tagged type. */
4301
4302static inline int
4303is_tagged_type (const_tree type)
4304{
4305 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
4306
4307 return (code == RECORD_TYPE || code == UNION_TYPE
4308 || code == QUAL_UNION_TYPE || code == ENUMERAL_TYPE);
4309}
4310
4311/* Set label to debug_info_section_label + die_offset of a DIE reference. */
4312
4313static void
4314get_ref_die_offset_label (char *label, dw_die_ref ref)
4315{
4316 sprintf (label, "%s+%ld", debug_info_section_label, ref->die_offset);
4317}
4318
4319/* Return die_offset of a DIE reference to a base type. */
4320
4321static unsigned long int
4322get_base_type_offset (dw_die_ref ref)
4323{
4324 if (ref->die_offset)
4325 return ref->die_offset;
4326 if (comp_unit_die ()->die_abbrev)
4327 {
4328 calc_base_type_die_sizes ();
4329 gcc_assert (ref->die_offset)((void)(!(ref->die_offset) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4329, __FUNCTION__), 0 : 0))
;
4330 }
4331 return ref->die_offset;
4332}
4333
4334/* Return die_offset of a DIE reference other than base type. */
4335
4336static unsigned long int
4337get_ref_die_offset (dw_die_ref ref)
4338{
4339 gcc_assert (ref->die_offset)((void)(!(ref->die_offset) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4339, __FUNCTION__), 0 : 0))
;
4340 return ref->die_offset;
4341}
4342
4343/* Convert a DIE tag into its string name. */
4344
4345static const char *
4346dwarf_tag_name (unsigned int tag)
4347{
4348 const char *name = get_DW_TAG_name (tag);
4349
4350 if (name != NULLnullptr)
4351 return name;
4352
4353 return "DW_TAG_<unknown>";
4354}
4355
4356/* Convert a DWARF attribute code into its string name. */
4357
4358static const char *
4359dwarf_attr_name (unsigned int attr)
4360{
4361 const char *name;
4362
4363 switch (attr)
4364 {
4365#if VMS_DEBUGGING_INFO
4366 case DW_AT_HP_prologue:
4367 return "DW_AT_HP_prologue";
4368#else
4369 case DW_AT_MIPS_loop_unroll_factor:
4370 return "DW_AT_MIPS_loop_unroll_factor";
4371#endif
4372
4373#if VMS_DEBUGGING_INFO
4374 case DW_AT_HP_epilogue:
4375 return "DW_AT_HP_epilogue";
4376#else
4377 case DW_AT_MIPS_stride:
4378 return "DW_AT_MIPS_stride";
4379#endif
4380 }
4381
4382 name = get_DW_AT_name (attr);
4383
4384 if (name != NULLnullptr)
4385 return name;
4386
4387 return "DW_AT_<unknown>";
4388}
4389
4390/* Convert a DWARF value form code into its string name. */
4391
4392static const char *
4393dwarf_form_name (unsigned int form)
4394{
4395 const char *name = get_DW_FORM_name (form);
4396
4397 if (name != NULLnullptr)
4398 return name;
4399
4400 return "DW_FORM_<unknown>";
4401}
4402
4403/* Determine the "ultimate origin" of a decl. The decl may be an inlined
4404 instance of an inlined instance of a decl which is local to an inline
4405 function, so we have to trace all of the way back through the origin chain
4406 to find out what sort of node actually served as the original seed for the
4407 given block. */
4408
4409static tree
4410decl_ultimate_origin (const_tree decl)
4411{
4412 if (!CODE_CONTAINS_STRUCT (TREE_CODE (decl), TS_DECL_COMMON)(tree_contains_struct[(((enum tree_code) (decl)->base.code
))][(TS_DECL_COMMON)])
)
4413 return NULL_TREE(tree) nullptr;
4414
4415 /* DECL_ABSTRACT_ORIGIN can point to itself; ignore that if
4416 we're trying to output the abstract instance of this function. */
4417 if (DECL_ABSTRACT_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4417, __FUNCTION__))->decl_common.abstract_flag)
&& DECL_ABSTRACT_ORIGIN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4417, __FUNCTION__))->decl_common.abstract_origin)
== decl)
4418 return NULL_TREE(tree) nullptr;
4419
4420 /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
4421 most distant ancestor, this should never happen. */
4422 gcc_assert (!DECL_FROM_INLINE (DECL_ORIGIN (decl)))((void)(!(!(((contains_struct_check (((((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) : (decl
))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) != (tree
) nullptr && ((contains_struct_check (((((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) : (decl
))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) != ((
((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__))->decl_common.abstract_origin) : (decl
))))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4422, __FUNCTION__), 0 : 0))
;
4423
4424 return DECL_ABSTRACT_ORIGIN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4424, __FUNCTION__))->decl_common.abstract_origin)
;
4425}
4426
4427/* Get the class to which DECL belongs, if any. In g++, the DECL_CONTEXT
4428 of a virtual function may refer to a base class, so we check the 'this'
4429 parameter. */
4430
4431static tree
4432decl_class_context (tree decl)
4433{
4434 tree context = NULL_TREE(tree) nullptr;
4435
4436 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL || ! DECL_VINDEX (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4436, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex
)
)
4437 context = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4437, __FUNCTION__))->decl_minimal.context)
;
4438 else
4439 context = TYPE_MAIN_VARIANT((tree_class_check ((((contains_struct_check ((((tree_check (
(((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__))->type_common.main_variant)
4440 (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))))((tree_class_check ((((contains_struct_check ((((tree_check (
(((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4440, __FUNCTION__))->type_common.main_variant)
;
4441
4442 if (context && !TYPE_P (context)(tree_code_type[(int) (((enum tree_code) (context)->base.code
))] == tcc_type)
)
4443 context = NULL_TREE(tree) nullptr;
4444
4445 return context;
4446}
4447
4448/* Add an attribute/value pair to a DIE. */
4449
4450static inline void
4451add_dwarf_attr (dw_die_ref die, dw_attr_node *attr)
4452{
4453 /* Maybe this should be an assert? */
4454 if (die == NULLnullptr)
4455 return;
4456
4457 if (flag_checkingglobal_options.x_flag_checking)
4458 {
4459 /* Check we do not add duplicate attrs. Can't use get_AT here
4460 because that recurses to the specification/abstract origin DIE. */
4461 dw_attr_node *a;
4462 unsigned ix;
4463 FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)for (ix = 0; vec_safe_iterate ((die->die_attr), (ix), &
(a)); ++(ix))
4464 gcc_assert (a->dw_attr != attr->dw_attr)((void)(!(a->dw_attr != attr->dw_attr) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4464, __FUNCTION__), 0 : 0))
;
4465 }
4466
4467 vec_safe_reserve (die->die_attr, 1);
4468 vec_safe_push (die->die_attr, *attr);
4469}
4470
4471enum dw_val_class
4472AT_class (dw_attr_node *a)
4473{
4474 return a->dw_attr_val.val_class;
4475}
4476
4477/* Return the index for any attribute that will be referenced with a
4478 DW_FORM_addrx/GNU_addr_index or DW_FORM_strx/GNU_str_index. String
4479 indices are stored in dw_attr_val.v.val_str for reference counting
4480 pruning. */
4481
4482static inline unsigned int
4483AT_index (dw_attr_node *a)
4484{
4485 if (AT_class (a) == dw_val_class_str)
4486 return a->dw_attr_val.v.val_str->index;
4487 else if (a->dw_attr_val.val_entry != NULLnullptr)
4488 return a->dw_attr_val.val_entry->index;
4489 return NOT_INDEXED(-1U);
4490}
4491
4492/* Add a flag value attribute to a DIE. */
4493
4494static inline void
4495add_AT_flag (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int flag)
4496{
4497 dw_attr_node attr;
4498
4499 attr.dw_attr = attr_kind;
4500 attr.dw_attr_val.val_class = dw_val_class_flag;
4501 attr.dw_attr_val.val_entry = NULLnullptr;
4502 attr.dw_attr_val.v.val_flag = flag;
4503 add_dwarf_attr (die, &attr);
4504}
4505
4506static inline unsigned
4507AT_flag (dw_attr_node *a)
4508{
4509 gcc_assert (a && AT_class (a) == dw_val_class_flag)((void)(!(a && AT_class (a) == dw_val_class_flag) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4509, __FUNCTION__), 0 : 0))
;
4510 return a->dw_attr_val.v.val_flag;
4511}
4512
4513/* Add a signed integer attribute value to a DIE. */
4514
4515static inline void
4516add_AT_int (dw_die_ref die, enum dwarf_attribute attr_kind, HOST_WIDE_INTlong int_val)
4517{
4518 dw_attr_node attr;
4519
4520 attr.dw_attr = attr_kind;
4521 attr.dw_attr_val.val_class = dw_val_class_const;
4522 attr.dw_attr_val.val_entry = NULLnullptr;
4523 attr.dw_attr_val.v.val_int = int_val;
4524 add_dwarf_attr (die, &attr);
4525}
4526
4527HOST_WIDE_INTlong
4528AT_int (dw_attr_node *a)
4529{
4530 gcc_assert (a && (AT_class (a) == dw_val_class_const((void)(!(a && (AT_class (a) == dw_val_class_const ||
AT_class (a) == dw_val_class_const_implicit)) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4531, __FUNCTION__), 0 : 0))
4531 || AT_class (a) == dw_val_class_const_implicit))((void)(!(a && (AT_class (a) == dw_val_class_const ||
AT_class (a) == dw_val_class_const_implicit)) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4531, __FUNCTION__), 0 : 0))
;
4532 return a->dw_attr_val.v.val_int;
4533}
4534
4535/* Add an unsigned integer attribute value to a DIE. */
4536
4537static inline void
4538add_AT_unsigned (dw_die_ref die, enum dwarf_attribute attr_kind,
4539 unsigned HOST_WIDE_INTlong unsigned_val)
4540{
4541 dw_attr_node attr;
4542
4543 attr.dw_attr = attr_kind;
4544 attr.dw_attr_val.val_class = dw_val_class_unsigned_const;
4545 attr.dw_attr_val.val_entry = NULLnullptr;
4546 attr.dw_attr_val.v.val_unsigned = unsigned_val;
4547 add_dwarf_attr (die, &attr);
4548}
4549
4550unsigned HOST_WIDE_INTlong
4551AT_unsigned (dw_attr_node *a)
4552{
4553 gcc_assert (a && (AT_class (a) == dw_val_class_unsigned_const((void)(!(a && (AT_class (a) == dw_val_class_unsigned_const
|| AT_class (a) == dw_val_class_unsigned_const_implicit)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4554, __FUNCTION__), 0 : 0))
4554 || AT_class (a) == dw_val_class_unsigned_const_implicit))((void)(!(a && (AT_class (a) == dw_val_class_unsigned_const
|| AT_class (a) == dw_val_class_unsigned_const_implicit)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4554, __FUNCTION__), 0 : 0))
;
4555 return a->dw_attr_val.v.val_unsigned;
4556}
4557
4558/* Add an unsigned wide integer attribute value to a DIE. */
4559
4560static inline void
4561add_AT_wide (dw_die_ref die, enum dwarf_attribute attr_kind,
4562 const wide_int& w)
4563{
4564 dw_attr_node attr;
4565
4566 attr.dw_attr = attr_kind;
4567 attr.dw_attr_val.val_class = dw_val_class_wide_int;
4568 attr.dw_attr_val.val_entry = NULLnullptr;
4569 attr.dw_attr_val.v.val_wide = ggc_alloc<wide_int> ();
4570 *attr.dw_attr_val.v.val_wide = w;
4571 add_dwarf_attr (die, &attr);
4572}
4573
4574/* Add an unsigned double integer attribute value to a DIE. */
4575
4576static inline void
4577add_AT_double (dw_die_ref die, enum dwarf_attribute attr_kind,
4578 HOST_WIDE_INTlong high, unsigned HOST_WIDE_INTlong low)
4579{
4580 dw_attr_node attr;
4581
4582 attr.dw_attr = attr_kind;
4583 attr.dw_attr_val.val_class = dw_val_class_const_double;
4584 attr.dw_attr_val.val_entry = NULLnullptr;
4585 attr.dw_attr_val.v.val_double.high = high;
4586 attr.dw_attr_val.v.val_double.low = low;
4587 add_dwarf_attr (die, &attr);
4588}
4589
4590/* Add a floating point attribute value to a DIE and return it. */
4591
4592static inline void
4593add_AT_vec (dw_die_ref die, enum dwarf_attribute attr_kind,
4594 unsigned int length, unsigned int elt_size, unsigned char *array)
4595{
4596 dw_attr_node attr;
4597
4598 attr.dw_attr = attr_kind;
4599 attr.dw_attr_val.val_class = dw_val_class_vec;
4600 attr.dw_attr_val.val_entry = NULLnullptr;
4601 attr.dw_attr_val.v.val_vec.length = length;
4602 attr.dw_attr_val.v.val_vec.elt_size = elt_size;
4603 attr.dw_attr_val.v.val_vec.array = array;
4604 add_dwarf_attr (die, &attr);
4605}
4606
4607/* Add an 8-byte data attribute value to a DIE. */
4608
4609static inline void
4610add_AT_data8 (dw_die_ref die, enum dwarf_attribute attr_kind,
4611 unsigned char data8[8])
4612{
4613 dw_attr_node attr;
4614
4615 attr.dw_attr = attr_kind;
4616 attr.dw_attr_val.val_class = dw_val_class_data8;
4617 attr.dw_attr_val.val_entry = NULLnullptr;
4618 memcpy (attr.dw_attr_val.v.val_data8, data8, 8);
4619 add_dwarf_attr (die, &attr);
4620}
4621
4622/* Add DW_AT_low_pc and DW_AT_high_pc to a DIE. When using
4623 dwarf_split_debug_info, address attributes in dies destined for the
4624 final executable have force_direct set to avoid using indexed
4625 references. */
4626
4627static inline void
4628add_AT_low_high_pc (dw_die_ref die, const char *lbl_low, const char *lbl_high,
4629 bool force_direct)
4630{
4631 dw_attr_node attr;
4632 char * lbl_id;
4633
4634 lbl_id = xstrdup (lbl_low);
4635 attr.dw_attr = DW_AT_low_pc;
4636 attr.dw_attr_val.val_class = dw_val_class_lbl_id;
4637 attr.dw_attr_val.v.val_lbl_id = lbl_id;
4638 if (dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info && !force_direct)
4639 attr.dw_attr_val.val_entry
4640 = add_addr_table_entry (lbl_id, ate_kind_label);
4641 else
4642 attr.dw_attr_val.val_entry = NULLnullptr;
4643 add_dwarf_attr (die, &attr);
4644
4645 attr.dw_attr = DW_AT_high_pc;
4646 if (dwarf_versionglobal_options.x_dwarf_version < 4)
4647 attr.dw_attr_val.val_class = dw_val_class_lbl_id;
4648 else
4649 attr.dw_attr_val.val_class = dw_val_class_high_pc;
4650 lbl_id = xstrdup (lbl_high);
4651 attr.dw_attr_val.v.val_lbl_id = lbl_id;
4652 if (attr.dw_attr_val.val_class == dw_val_class_lbl_id
4653 && dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info && !force_direct)
4654 attr.dw_attr_val.val_entry
4655 = add_addr_table_entry (lbl_id, ate_kind_label);
4656 else
4657 attr.dw_attr_val.val_entry = NULLnullptr;
4658 add_dwarf_attr (die, &attr);
4659}
4660
4661/* Hash and equality functions for debug_str_hash. */
4662
4663hashval_t
4664indirect_string_hasher::hash (indirect_string_node *x)
4665{
4666 return htab_hash_string (x->str);
4667}
4668
4669bool
4670indirect_string_hasher::equal (indirect_string_node *x1, const char *x2)
4671{
4672 return strcmp (x1->str, x2) == 0;
4673}
4674
4675/* Add STR to the given string hash table. */
4676
4677static struct indirect_string_node *
4678find_AT_string_in_table (const char *str,
4679 hash_table<indirect_string_hasher> *table,
4680 enum insert_option insert = INSERT)
4681{
4682 struct indirect_string_node *node;
4683
4684 indirect_string_node **slot
4685 = table->find_slot_with_hash (str, htab_hash_string (str), insert);
4686 if (*slot == NULLnullptr)
4687 {
4688 node = ggc_cleared_alloc<indirect_string_node> ();
4689 node->str = ggc_strdup (str)ggc_alloc_string ((str), -1 );
4690 *slot = node;
4691 }
4692 else
4693 node = *slot;
4694
4695 node->refcount++;
4696 return node;
4697}
4698
4699/* Add STR to the indirect string hash table. */
4700
4701static struct indirect_string_node *
4702find_AT_string (const char *str, enum insert_option insert = INSERT)
4703{
4704 if (! debug_str_hash)
4705 debug_str_hash = hash_table<indirect_string_hasher>::create_ggc (10);
4706
4707 return find_AT_string_in_table (str, debug_str_hash, insert);
4708}
4709
4710/* Add a string attribute value to a DIE. */
4711
4712static inline void
4713add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str)
4714{
4715 dw_attr_node attr;
4716 struct indirect_string_node *node;
4717
4718 node = find_AT_string (str);
4719
4720 attr.dw_attr = attr_kind;
4721 attr.dw_attr_val.val_class = dw_val_class_str;
4722 attr.dw_attr_val.val_entry = NULLnullptr;
4723 attr.dw_attr_val.v.val_str = node;
4724 add_dwarf_attr (die, &attr);
4725}
4726
4727static inline const char *
4728AT_string (dw_attr_node *a)
4729{
4730 gcc_assert (a && AT_class (a) == dw_val_class_str)((void)(!(a && AT_class (a) == dw_val_class_str) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4730, __FUNCTION__), 0 : 0))
;
4731 return a->dw_attr_val.v.val_str->str;
4732}
4733
4734/* Call this function directly to bypass AT_string_form's logic to put
4735 the string inline in the die. */
4736
4737static void
4738set_indirect_string (struct indirect_string_node *node)
4739{
4740 char label[MAX_ARTIFICIAL_LABEL_BYTES40];
4741 /* Already indirect is a no op. */
4742 if (node->form == DW_FORM_strp
4743 || node->form == DW_FORM_line_strp
4744 || node->form == dwarf_FORM (DW_FORM_strx))
4745 {
4746 gcc_assert (node->label)((void)(!(node->label) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4746, __FUNCTION__), 0 : 0))
;
4747 return;
4748 }
4749 ASM_GENERATE_INTERNAL_LABEL (label, "LASF", dw2_string_counter)do { char *__p; (label)[0] = '*'; (label)[1] = '.'; __p = stpcpy
(&(label)[2], "LASF"); sprint_ul (__p, (unsigned long) (
dw2_string_counter)); } while (0)
;
4750 ++dw2_string_counter;
4751 node->label = xstrdup (label);
4752
4753 if (!dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info)
4754 {
4755 node->form = DW_FORM_strp;
4756 node->index = NOT_INDEXED(-1U);
4757 }
4758 else
4759 {
4760 node->form = dwarf_FORM (DW_FORM_strx);
4761 node->index = NO_INDEX_ASSIGNED(-2U);
4762 }
4763}
4764
4765/* A helper function for dwarf2out_finish, called to reset indirect
4766 string decisions done for early LTO dwarf output before fat object
4767 dwarf output. */
4768
4769int
4770reset_indirect_string (indirect_string_node **h, void *)
4771{
4772 struct indirect_string_node *node = *h;
4773 if (node->form == DW_FORM_strp
4774 || node->form == DW_FORM_line_strp
4775 || node->form == dwarf_FORM (DW_FORM_strx))
4776 {
4777 free (node->label);
4778 node->label = NULLnullptr;
4779 node->form = (dwarf_form) 0;
4780 node->index = 0;
4781 }
4782 return 1;
4783}
4784
4785/* Add a string representing a file or filepath attribute value to a DIE. */
4786
4787static inline void
4788add_filepath_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind,
4789 const char *str)
4790{
4791 if (! asm_outputs_debug_line_str ())
4792 add_AT_string (die, attr_kind, str);
4793 else
4794 {
4795 dw_attr_node attr;
4796 struct indirect_string_node *node;
4797
4798 if (!debug_line_str_hash)
4799 debug_line_str_hash
4800 = hash_table<indirect_string_hasher>::create_ggc (10);
4801
4802 node = find_AT_string_in_table (str, debug_line_str_hash);
4803 set_indirect_string (node);
4804 node->form = DW_FORM_line_strp;
4805
4806 attr.dw_attr = attr_kind;
4807 attr.dw_attr_val.val_class = dw_val_class_str;
4808 attr.dw_attr_val.val_entry = NULLnullptr;
4809 attr.dw_attr_val.v.val_str = node;
4810 add_dwarf_attr (die, &attr);
4811 }
4812}
4813
4814/* Find out whether a string should be output inline in DIE
4815 or out-of-line in .debug_str section. */
4816
4817static enum dwarf_form
4818find_string_form (struct indirect_string_node *node)
4819{
4820 unsigned int len;
4821
4822 if (node->form)
4823 return node->form;
4824
4825 len = strlen (node->str) + 1;
4826
4827 /* If the string is shorter or equal to the size of the reference, it is
4828 always better to put it inline. */
4829 if (len <= (unsigned) dwarf_offset_sizeglobal_options.x_dwarf_offset_size || node->refcount == 0)
4830 return node->form = DW_FORM_string;
4831
4832 /* If we cannot expect the linker to merge strings in .debug_str
4833 section, only put it into .debug_str if it is worth even in this
4834 single module. */
4835 if (DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET0
4836 || ((debug_str_section->common.flags & SECTION_MERGE) == 0
4837 && (len - dwarf_offset_sizeglobal_options.x_dwarf_offset_size) * node->refcount <= len))
4838 return node->form = DW_FORM_string;
4839
4840 set_indirect_string (node);
4841
4842 return node->form;
4843}
4844
4845/* Find out whether the string referenced from the attribute should be
4846 output inline in DIE or out-of-line in .debug_str section. */
4847
4848static enum dwarf_form
4849AT_string_form (dw_attr_node *a)
4850{
4851 gcc_assert (a && AT_class (a) == dw_val_class_str)((void)(!(a && AT_class (a) == dw_val_class_str) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4851, __FUNCTION__), 0 : 0))
;
4852 return find_string_form (a->dw_attr_val.v.val_str);
4853}
4854
4855/* Add a DIE reference attribute value to a DIE. */
4856
4857static inline void
4858add_AT_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, dw_die_ref targ_die)
4859{
4860 dw_attr_node attr;
4861 gcc_checking_assert (targ_die != NULL)((void)(!(targ_die != nullptr) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4861, __FUNCTION__), 0 : 0))
;
4862
4863 /* With LTO we can end up trying to reference something we didn't create
4864 a DIE for. Avoid crashing later on a NULL referenced DIE. */
4865 if (targ_die == NULLnullptr)
4866 return;
4867
4868 attr.dw_attr = attr_kind;
4869 attr.dw_attr_val.val_class = dw_val_class_die_ref;
4870 attr.dw_attr_val.val_entry = NULLnullptr;
4871 attr.dw_attr_val.v.val_die_ref.die = targ_die;
4872 attr.dw_attr_val.v.val_die_ref.external = 0;
4873 add_dwarf_attr (die, &attr);
4874}
4875
4876/* Change DIE reference REF to point to NEW_DIE instead. */
4877
4878static inline void
4879change_AT_die_ref (dw_attr_node *ref, dw_die_ref new_die)
4880{
4881 gcc_assert (ref->dw_attr_val.val_class == dw_val_class_die_ref)((void)(!(ref->dw_attr_val.val_class == dw_val_class_die_ref
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4881, __FUNCTION__), 0 : 0))
;
4882 ref->dw_attr_val.v.val_die_ref.die = new_die;
4883 ref->dw_attr_val.v.val_die_ref.external = 0;
4884}
4885
4886/* Add an AT_specification attribute to a DIE, and also make the back
4887 pointer from the specification to the definition. */
4888
4889static inline void
4890add_AT_specification (dw_die_ref die, dw_die_ref targ_die)
4891{
4892 add_AT_die_ref (die, DW_AT_specification, targ_die);
4893 gcc_assert (!targ_die->die_definition)((void)(!(!targ_die->die_definition) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4893, __FUNCTION__), 0 : 0))
;
4894 targ_die->die_definition = die;
4895}
4896
4897static inline dw_die_ref
4898AT_ref (dw_attr_node *a)
4899{
4900 gcc_assert (a && AT_class (a) == dw_val_class_die_ref)((void)(!(a && AT_class (a) == dw_val_class_die_ref) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4900, __FUNCTION__), 0 : 0))
;
4901 return a->dw_attr_val.v.val_die_ref.die;
4902}
4903
4904static inline int
4905AT_ref_external (dw_attr_node *a)
4906{
4907 if (a && AT_class (a) == dw_val_class_die_ref)
4908 return a->dw_attr_val.v.val_die_ref.external;
4909
4910 return 0;
4911}
4912
4913static inline void
4914set_AT_ref_external (dw_attr_node *a, int i)
4915{
4916 gcc_assert (a && AT_class (a) == dw_val_class_die_ref)((void)(!(a && AT_class (a) == dw_val_class_die_ref) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4916, __FUNCTION__), 0 : 0))
;
4917 a->dw_attr_val.v.val_die_ref.external = i;
4918}
4919
4920/* Add a location description attribute value to a DIE. */
4921
4922static inline void
4923add_AT_loc (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_descr_ref loc)
4924{
4925 dw_attr_node attr;
4926
4927 attr.dw_attr = attr_kind;
4928 attr.dw_attr_val.val_class = dw_val_class_loc;
4929 attr.dw_attr_val.val_entry = NULLnullptr;
4930 attr.dw_attr_val.v.val_loc = loc;
4931 add_dwarf_attr (die, &attr);
4932}
4933
4934dw_loc_descr_ref
4935AT_loc (dw_attr_node *a)
4936{
4937 gcc_assert (a && AT_class (a) == dw_val_class_loc)((void)(!(a && AT_class (a) == dw_val_class_loc) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4937, __FUNCTION__), 0 : 0))
;
4938 return a->dw_attr_val.v.val_loc;
4939}
4940
4941static inline void
4942add_AT_loc_list (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_list_ref loc_list)
4943{
4944 dw_attr_node attr;
4945
4946 if (XCOFF_DEBUGGING_INFO0 && !HAVE_XCOFF_DWARF_EXTRAS0)
4947 return;
4948
4949 attr.dw_attr = attr_kind;
4950 attr.dw_attr_val.val_class = dw_val_class_loc_list;
4951 attr.dw_attr_val.val_entry = NULLnullptr;
4952 attr.dw_attr_val.v.val_loc_list = loc_list;
4953 add_dwarf_attr (die, &attr);
4954 have_location_lists = true;
4955}
4956
4957static inline dw_loc_list_ref
4958AT_loc_list (dw_attr_node *a)
4959{
4960 gcc_assert (a && AT_class (a) == dw_val_class_loc_list)((void)(!(a && AT_class (a) == dw_val_class_loc_list)
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4960, __FUNCTION__), 0 : 0))
;
4961 return a->dw_attr_val.v.val_loc_list;
4962}
4963
4964/* Add a view list attribute to DIE. It must have a DW_AT_location
4965 attribute, because the view list complements the location list. */
4966
4967static inline void
4968add_AT_view_list (dw_die_ref die, enum dwarf_attribute attr_kind)
4969{
4970 dw_attr_node attr;
4971
4972 if (XCOFF_DEBUGGING_INFO0 && !HAVE_XCOFF_DWARF_EXTRAS0)
4973 return;
4974
4975 attr.dw_attr = attr_kind;
4976 attr.dw_attr_val.val_class = dw_val_class_view_list;
4977 attr.dw_attr_val.val_entry = NULLnullptr;
4978 attr.dw_attr_val.v.val_view_list = die;
4979 add_dwarf_attr (die, &attr);
4980 gcc_checking_assert (get_AT (die, DW_AT_location))((void)(!(get_AT (die, DW_AT_location)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4980, __FUNCTION__), 0 : 0))
;
4981 gcc_assert (have_location_lists)((void)(!(have_location_lists) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4981, __FUNCTION__), 0 : 0))
;
4982}
4983
4984/* Return a pointer to the location list referenced by the attribute.
4985 If the named attribute is a view list, look up the corresponding
4986 DW_AT_location attribute and return its location list. */
4987
4988static inline dw_loc_list_ref *
4989AT_loc_list_ptr (dw_attr_node *a)
4990{
4991 gcc_assert (a)((void)(!(a) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 4991, __FUNCTION__), 0 : 0))
;
4992 switch (AT_class (a))
4993 {
4994 case dw_val_class_loc_list:
4995 return &a->dw_attr_val.v.val_loc_list;
4996 case dw_val_class_view_list:
4997 {
4998 dw_attr_node *l;
4999 l = get_AT (a->dw_attr_val.v.val_view_list, DW_AT_location);
5000 if (!l)
5001 return NULLnullptr;
5002 gcc_checking_assert (l + 1 == a)((void)(!(l + 1 == a) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5002, __FUNCTION__), 0 : 0))
;
5003 return AT_loc_list_ptr (l);
5004 }
5005 default:
5006 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5006, __FUNCTION__))
;
5007 }
5008}
5009
5010/* Return the location attribute value associated with a view list
5011 attribute value. */
5012
5013static inline dw_val_node *
5014view_list_to_loc_list_val_node (dw_val_node *val)
5015{
5016 gcc_assert (val->val_class == dw_val_class_view_list)((void)(!(val->val_class == dw_val_class_view_list) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5016, __FUNCTION__), 0 : 0))
;
5017 dw_attr_node *loc = get_AT (val->v.val_view_list, DW_AT_location);
5018 if (!loc)
5019 return NULLnullptr;
5020 gcc_checking_assert (&(loc + 1)->dw_attr_val == val)((void)(!(&(loc + 1)->dw_attr_val == val) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5020, __FUNCTION__), 0 : 0))
;
5021 gcc_assert (AT_class (loc) == dw_val_class_loc_list)((void)(!(AT_class (loc) == dw_val_class_loc_list) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5021, __FUNCTION__), 0 : 0))
;
5022 return &loc->dw_attr_val;
5023}
5024
5025struct addr_hasher : ggc_ptr_hash<addr_table_entry>
5026{
5027 static hashval_t hash (addr_table_entry *);
5028 static bool equal (addr_table_entry *, addr_table_entry *);
5029};
5030
5031/* Table of entries into the .debug_addr section. */
5032
5033static GTY (()) hash_table<addr_hasher> *addr_index_table;
5034
5035/* Hash an address_table_entry. */
5036
5037hashval_t
5038addr_hasher::hash (addr_table_entry *a)
5039{
5040 inchash::hash hstate;
5041 switch (a->kind)
5042 {
5043 case ate_kind_rtx:
5044 hstate.add_int (0);
5045 break;
5046 case ate_kind_rtx_dtprel:
5047 hstate.add_int (1);
5048 break;
5049 case ate_kind_label:
5050 return htab_hash_string (a->addr.label);
5051 default:
5052 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5052, __FUNCTION__))
;
5053 }
5054 inchash::add_rtx (a->addr.rtl, hstate);
5055 return hstate.end ();
5056}
5057
5058/* Determine equality for two address_table_entries. */
5059
5060bool
5061addr_hasher::equal (addr_table_entry *a1, addr_table_entry *a2)
5062{
5063 if (a1->kind != a2->kind)
5064 return 0;
5065 switch (a1->kind)
5066 {
5067 case ate_kind_rtx:
5068 case ate_kind_rtx_dtprel:
5069 return rtx_equal_p (a1->addr.rtl, a2->addr.rtl);
5070 case ate_kind_label:
5071 return strcmp (a1->addr.label, a2->addr.label) == 0;
5072 default:
5073 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5073, __FUNCTION__))
;
5074 }
5075}
5076
5077/* Initialize an addr_table_entry. */
5078
5079void
5080init_addr_table_entry (addr_table_entry *e, enum ate_kind kind, void *addr)
5081{
5082 e->kind = kind;
5083 switch (kind)
5084 {
5085 case ate_kind_rtx:
5086 case ate_kind_rtx_dtprel:
5087 e->addr.rtl = (rtx) addr;
5088 break;
5089 case ate_kind_label:
5090 e->addr.label = (char *) addr;
5091 break;
5092 }
5093 e->refcount = 0;
5094 e->index = NO_INDEX_ASSIGNED(-2U);
5095}
5096
5097/* Add attr to the address table entry to the table. Defer setting an
5098 index until output time. */
5099
5100static addr_table_entry *
5101add_addr_table_entry (void *addr, enum ate_kind kind)
5102{
5103 addr_table_entry *node;
5104 addr_table_entry finder;
5105
5106 gcc_assert (dwarf_split_debug_info)((void)(!(global_options.x_dwarf_split_debug_info) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5106, __FUNCTION__), 0 : 0))
;
5107 if (! addr_index_table)
5108 addr_index_table = hash_table<addr_hasher>::create_ggc (10);
5109 init_addr_table_entry (&finder, kind, addr);
5110 addr_table_entry **slot = addr_index_table->find_slot (&finder, INSERT);
5111
5112 if (*slot == HTAB_EMPTY_ENTRY((void *) 0))
5113 {
5114 node = ggc_cleared_alloc<addr_table_entry> ();
5115 init_addr_table_entry (node, kind, addr);
5116 *slot = node;
5117 }
5118 else
5119 node = *slot;
5120
5121 node->refcount++;
5122 return node;
5123}
5124
5125/* Remove an entry from the addr table by decrementing its refcount.
5126 Strictly, decrementing the refcount would be enough, but the
5127 assertion that the entry is actually in the table has found
5128 bugs. */
5129
5130static void
5131remove_addr_table_entry (addr_table_entry *entry)
5132{
5133 gcc_assert (dwarf_split_debug_info && addr_index_table)((void)(!(global_options.x_dwarf_split_debug_info && addr_index_table
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5133, __FUNCTION__), 0 : 0))
;
5134 /* After an index is assigned, the table is frozen. */
5135 gcc_assert (entry->refcount > 0 && entry->index == NO_INDEX_ASSIGNED)((void)(!(entry->refcount > 0 && entry->index
== (-2U)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5135, __FUNCTION__), 0 : 0))
;
5136 entry->refcount--;
5137}
5138
5139/* Given a location list, remove all addresses it refers to from the
5140 address_table. */
5141
5142static void
5143remove_loc_list_addr_table_entries (dw_loc_descr_ref descr)
5144{
5145 for (; descr; descr = descr->dw_loc_next)
5146 if (descr->dw_loc_oprnd1.val_entry != NULLnullptr)
5147 {
5148 gcc_assert (descr->dw_loc_oprnd1.val_entry->index == NO_INDEX_ASSIGNED)((void)(!(descr->dw_loc_oprnd1.val_entry->index == (-2U
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5148, __FUNCTION__), 0 : 0))
;
5149 remove_addr_table_entry (descr->dw_loc_oprnd1.val_entry);
5150 }
5151}
5152
5153/* A helper function for dwarf2out_finish called through
5154 htab_traverse. Assign an addr_table_entry its index. All entries
5155 must be collected into the table when this function is called,
5156 because the indexing code relies on htab_traverse to traverse nodes
5157 in the same order for each run. */
5158
5159int
5160index_addr_table_entry (addr_table_entry **h, unsigned int *index)
5161{
5162 addr_table_entry *node = *h;
5163
5164 /* Don't index unreferenced nodes. */
5165 if (node->refcount == 0)
5166 return 1;
5167
5168 gcc_assert (node->index == NO_INDEX_ASSIGNED)((void)(!(node->index == (-2U)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5168, __FUNCTION__), 0 : 0))
;
5169 node->index = *index;
5170 *index += 1;
5171
5172 return 1;
5173}
5174
5175/* Return the tag of a given DIE. */
5176
5177enum dwarf_tag
5178dw_get_die_tag (dw_die_ref die)
5179{
5180 return die->die_tag;
5181}
5182
5183/* Return a reference to the children list of a given DIE. */
5184
5185dw_die_ref
5186dw_get_die_child (dw_die_ref die)
5187{
5188 return die->die_child;
5189}
5190
5191/* Return a reference to the sibling of a given DIE. */
5192
5193dw_die_ref
5194dw_get_die_sib (dw_die_ref die)
5195{
5196 return die->die_sib;
5197}
5198
5199/* Add an address constant attribute value to a DIE. When using
5200 dwarf_split_debug_info, address attributes in dies destined for the
5201 final executable should be direct references--setting the parameter
5202 force_direct ensures this behavior. */
5203
5204static inline void
5205add_AT_addr (dw_die_ref die, enum dwarf_attribute attr_kind, rtx addr,
5206 bool force_direct)
5207{
5208 dw_attr_node attr;
5209
5210 attr.dw_attr = attr_kind;
5211 attr.dw_attr_val.val_class = dw_val_class_addr;
5212 attr.dw_attr_val.v.val_addr = addr;
5213 if (dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info && !force_direct)
5214 attr.dw_attr_val.val_entry = add_addr_table_entry (addr, ate_kind_rtx);
5215 else
5216 attr.dw_attr_val.val_entry = NULLnullptr;
5217 add_dwarf_attr (die, &attr);
5218}
5219
5220/* Get the RTX from to an address DIE attribute. */
5221
5222static inline rtx
5223AT_addr (dw_attr_node *a)
5224{
5225 gcc_assert (a && AT_class (a) == dw_val_class_addr)((void)(!(a && AT_class (a) == dw_val_class_addr) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5225, __FUNCTION__), 0 : 0))
;
5226 return a->dw_attr_val.v.val_addr;
5227}
5228
5229/* Add a file attribute value to a DIE. */
5230
5231static inline void
5232add_AT_file (dw_die_ref die, enum dwarf_attribute attr_kind,
5233 struct dwarf_file_data *fd)
5234{
5235 dw_attr_node attr;
5236
5237 attr.dw_attr = attr_kind;
5238 attr.dw_attr_val.val_class = dw_val_class_file;
5239 attr.dw_attr_val.val_entry = NULLnullptr;
5240 attr.dw_attr_val.v.val_file = fd;
5241 add_dwarf_attr (die, &attr);
5242}
5243
5244/* Get the dwarf_file_data from a file DIE attribute. */
5245
5246static inline struct dwarf_file_data *
5247AT_file (dw_attr_node *a)
5248{
5249 gcc_assert (a && (AT_class (a) == dw_val_class_file((void)(!(a && (AT_class (a) == dw_val_class_file || AT_class
(a) == dw_val_class_file_implicit)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5250, __FUNCTION__), 0 : 0))
5250 || AT_class (a) == dw_val_class_file_implicit))((void)(!(a && (AT_class (a) == dw_val_class_file || AT_class
(a) == dw_val_class_file_implicit)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5250, __FUNCTION__), 0 : 0))
;
5251 return a->dw_attr_val.v.val_file;
5252}
5253
5254#if VMS_DEBUGGING_INFO
5255/* Add a vms delta attribute value to a DIE. */
5256
5257static inline void
5258add_AT_vms_delta (dw_die_ref die, enum dwarf_attribute attr_kind,
5259 const char *lbl1, const char *lbl2)
5260{
5261 dw_attr_node attr;
5262
5263 attr.dw_attr = attr_kind;
5264 attr.dw_attr_val.val_class = dw_val_class_vms_delta;
5265 attr.dw_attr_val.val_entry = NULLnullptr;
5266 attr.dw_attr_val.v.val_vms_delta.lbl1 = xstrdup (lbl1);
5267 attr.dw_attr_val.v.val_vms_delta.lbl2 = xstrdup (lbl2);
5268 add_dwarf_attr (die, &attr);
5269}
5270#endif
5271
5272/* Add a symbolic view identifier attribute value to a DIE. */
5273
5274static inline void
5275add_AT_symview (dw_die_ref die, enum dwarf_attribute attr_kind,
5276 const char *view_label)
5277{
5278 dw_attr_node attr;
5279
5280 attr.dw_attr = attr_kind;
5281 attr.dw_attr_val.val_class = dw_val_class_symview;
5282 attr.dw_attr_val.val_entry = NULLnullptr;
5283 attr.dw_attr_val.v.val_symbolic_view = xstrdup (view_label);
5284 add_dwarf_attr (die, &attr);
5285}
5286
5287/* Add a label identifier attribute value to a DIE. */
5288
5289static inline void
5290add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind,
5291 const char *lbl_id)
5292{
5293 dw_attr_node attr;
5294
5295 attr.dw_attr = attr_kind;
5296 attr.dw_attr_val.val_class = dw_val_class_lbl_id;
5297 attr.dw_attr_val.val_entry = NULLnullptr;
5298 attr.dw_attr_val.v.val_lbl_id = xstrdup (lbl_id);
5299 if (dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info)
5300 attr.dw_attr_val.val_entry
5301 = add_addr_table_entry (attr.dw_attr_val.v.val_lbl_id,
5302 ate_kind_label);
5303 add_dwarf_attr (die, &attr);
5304}
5305
5306/* Add a section offset attribute value to a DIE, an offset into the
5307 debug_line section. */
5308
5309static inline void
5310add_AT_lineptr (dw_die_ref die, enum dwarf_attribute attr_kind,
5311 const char *label)
5312{
5313 dw_attr_node attr;
5314
5315 attr.dw_attr = attr_kind;
5316 attr.dw_attr_val.val_class = dw_val_class_lineptr;
5317 attr.dw_attr_val.val_entry = NULLnullptr;
5318 attr.dw_attr_val.v.val_lbl_id = xstrdup (label);
5319 add_dwarf_attr (die, &attr);
5320}
5321
5322/* Add a section offset attribute value to a DIE, an offset into the
5323 debug_macinfo section. */
5324
5325static inline void
5326add_AT_macptr (dw_die_ref die, enum dwarf_attribute attr_kind,
5327 const char *label)
5328{
5329 dw_attr_node attr;
5330
5331 attr.dw_attr = attr_kind;
5332 attr.dw_attr_val.val_class = dw_val_class_macptr;
5333 attr.dw_attr_val.val_entry = NULLnullptr;
5334 attr.dw_attr_val.v.val_lbl_id = xstrdup (label);
5335 add_dwarf_attr (die, &attr);
5336}
5337
5338/* Add a range_list attribute value to a DIE. When using
5339 dwarf_split_debug_info, address attributes in dies destined for the
5340 final executable should be direct references--setting the parameter
5341 force_direct ensures this behavior. */
5342
5343#define UNRELOCATED_OFFSET((addr_table_entry *) 1) ((addr_table_entry *) 1)
5344#define RELOCATED_OFFSET(nullptr) (NULLnullptr)
5345
5346static void
5347add_AT_range_list (dw_die_ref die, enum dwarf_attribute attr_kind,
5348 long unsigned int offset, bool force_direct)
5349{
5350 dw_attr_node attr;
5351
5352 attr.dw_attr = attr_kind;
5353 attr.dw_attr_val.val_class = dw_val_class_range_list;
5354 /* For the range_list attribute, use val_entry to store whether the
5355 offset should follow split-debug-info or normal semantics. This
5356 value is read in output_range_list_offset. */
5357 if (dwarf_split_debug_infoglobal_options.x_dwarf_split_debug_info && !force_direct)
5358 attr.dw_attr_val.val_entry = UNRELOCATED_OFFSET((addr_table_entry *) 1);
5359 else
5360 attr.dw_attr_val.val_entry = RELOCATED_OFFSET(nullptr);
5361 attr.dw_attr_val.v.val_offset = offset;
5362 add_dwarf_attr (die, &attr);
5363}
5364
5365/* Return the start label of a delta attribute. */
5366
5367static inline const char *
5368AT_vms_delta1 (dw_attr_node *a)
5369{
5370 gcc_assert (a && (AT_class (a) == dw_val_class_vms_delta))((void)(!(a && (AT_class (a) == dw_val_class_vms_delta
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5370, __FUNCTION__), 0 : 0))
;
5371 return a->dw_attr_val.v.val_vms_delta.lbl1;
5372}
5373
5374/* Return the end label of a delta attribute. */
5375
5376static inline const char *
5377AT_vms_delta2 (dw_attr_node *a)
5378{
5379 gcc_assert (a && (AT_class (a) == dw_val_class_vms_delta))((void)(!(a && (AT_class (a) == dw_val_class_vms_delta
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5379, __FUNCTION__), 0 : 0))
;
5380 return a->dw_attr_val.v.val_vms_delta.lbl2;
5381}
5382
5383static inline const char *
5384AT_lbl (dw_attr_node *a)
5385{
5386 gcc_assert (a && (AT_class (a) == dw_val_class_lbl_id((void)(!(a && (AT_class (a) == dw_val_class_lbl_id ||
AT_class (a) == dw_val_class_lineptr || AT_class (a) == dw_val_class_macptr
|| AT_class (a) == dw_val_class_loclistsptr || AT_class (a) ==
dw_val_class_high_pc)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5390, __FUNCTION__), 0 : 0))
5387 || AT_class (a) == dw_val_class_lineptr((void)(!(a && (AT_class (a) == dw_val_class_lbl_id ||
AT_class (a) == dw_val_class_lineptr || AT_class (a) == dw_val_class_macptr
|| AT_class (a) == dw_val_class_loclistsptr || AT_class (a) ==
dw_val_class_high_pc)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5390, __FUNCTION__), 0 : 0))
5388 || AT_class (a) == dw_val_class_macptr((void)(!(a && (AT_class (a) == dw_val_class_lbl_id ||
AT_class (a) == dw_val_class_lineptr || AT_class (a) == dw_val_class_macptr
|| AT_class (a) == dw_val_class_loclistsptr || AT_class (a) ==
dw_val_class_high_pc)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5390, __FUNCTION__), 0 : 0))
5389 || AT_class (a) == dw_val_class_loclistsptr((void)(!(a && (AT_class (a) == dw_val_class_lbl_id ||
AT_class (a) == dw_val_class_lineptr || AT_class (a) == dw_val_class_macptr
|| AT_class (a) == dw_val_class_loclistsptr || AT_class (a) ==
dw_val_class_high_pc)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5390, __FUNCTION__), 0 : 0))
5390 || AT_class (a) == dw_val_class_high_pc))((void)(!(a && (AT_class (a) == dw_val_class_lbl_id ||
AT_class (a) == dw_val_class_lineptr || AT_class (a) == dw_val_class_macptr
|| AT_class (a) == dw_val_class_loclistsptr || AT_class (a) ==
dw_val_class_high_pc)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5390, __FUNCTION__), 0 : 0))
;
5391 return a->dw_attr_val.v.val_lbl_id;
5392}
5393
5394/* Get the attribute of type attr_kind. */
5395
5396dw_attr_node *
5397get_AT (dw_die_ref die, enum dwarf_attribute attr_kind)
5398{
5399 dw_attr_node *a;
5400 unsigned ix;
5401 dw_die_ref spec = NULLnullptr;
5402
5403 if (! die)
5404 return NULLnullptr;
5405
5406 FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)for (ix = 0; vec_safe_iterate ((die->die_attr), (ix), &
(a)); ++(ix))
5407 if (a->dw_attr == attr_kind)
5408 return a;
5409 else if (a->dw_attr == DW_AT_specification
5410 || a->dw_attr == DW_AT_abstract_origin)
5411 spec = AT_ref (a);
5412
5413 if (spec)
5414 return get_AT (spec, attr_kind);
5415
5416 return NULLnullptr;
5417}
5418
5419/* Returns the parent of the declaration of DIE. */
5420
5421static dw_die_ref
5422get_die_parent (dw_die_ref die)
5423{
5424 dw_die_ref t;
5425
5426 if (!die)
5427 return NULLnullptr;
5428
5429 if ((t = get_AT_ref (die, DW_AT_abstract_origin))
5430 || (t = get_AT_ref (die, DW_AT_specification)))
5431 die = t;
5432
5433 return die->die_parent;
5434}
5435
5436/* Return the "low pc" attribute value, typically associated with a subprogram
5437 DIE. Return null if the "low pc" attribute is either not present, or if it
5438 cannot be represented as an assembler label identifier. */
5439
5440static inline const char *
5441get_AT_low_pc (dw_die_ref die)
5442{
5443 dw_attr_node *a = get_AT (die, DW_AT_low_pc);
5444
5445 return a ? AT_lbl (a) : NULLnullptr;
5446}
5447
5448/* Return the value of the string attribute designated by ATTR_KIND, or
5449 NULL if it is not present. */
5450
5451const char *
5452get_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind)
5453{
5454 dw_attr_node *a = get_AT (die, attr_kind);
5455
5456 return a ? AT_string (a) : NULLnullptr;
5457}
5458
5459/* Return the value of the flag attribute designated by ATTR_KIND, or -1
5460 if it is not present. */
5461
5462int
5463get_AT_flag (dw_die_ref die, enum dwarf_attribute attr_kind)
5464{
5465 dw_attr_node *a = get_AT (die, attr_kind);
5466
5467 return a ? AT_flag (a) : 0;
5468}
5469
5470/* Return the value of the unsigned attribute designated by ATTR_KIND, or 0
5471 if it is not present. */
5472
5473unsigned
5474get_AT_unsigned (dw_die_ref die, enum dwarf_attribute attr_kind)
5475{
5476 dw_attr_node *a = get_AT (die, attr_kind);
5477
5478 return a ? AT_unsigned (a) : 0;
5479}
5480
5481dw_die_ref
5482get_AT_ref (dw_die_ref die, enum dwarf_attribute attr_kind)
5483{
5484 dw_attr_node *a = get_AT (die, attr_kind);
5485
5486 return a ? AT_ref (a) : NULLnullptr;
5487}
5488
5489struct dwarf_file_data *
5490get_AT_file (dw_die_ref die, enum dwarf_attribute attr_kind)
5491{
5492 dw_attr_node *a = get_AT (die, attr_kind);
5493
5494 return a ? AT_file (a) : NULLnullptr;
5495}
5496
5497/* Return TRUE if the language is C. */
5498
5499static inline bool
5500is_c (void)
5501{
5502 unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
5503
5504 return (lang == DW_LANG_C || lang == DW_LANG_C89 || lang == DW_LANG_C99
5505 || lang == DW_LANG_C11 || lang == DW_LANG_ObjC);
5506
5507
5508}
5509
5510/* Return TRUE if the language is C++. */
5511
5512static inline bool
5513is_cxx (void)
5514{
5515 unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
5516
5517 return (lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus
5518 || lang == DW_LANG_C_plus_plus_11 || lang == DW_LANG_C_plus_plus_14);
5519}
5520
5521/* Return TRUE if DECL was created by the C++ frontend. */
5522
5523static bool
5524is_cxx (const_tree decl)
5525{
5526 if (in_lto_pglobal_options.x_in_lto_p)
5527 {
5528 const_tree context = get_ultimate_context (decl);
5529 if (context && TRANSLATION_UNIT_LANGUAGE (context)((tree_check ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5529, __FUNCTION__, (TRANSLATION_UNIT_DECL)))->translation_unit_decl
.language)
)
5530 return startswith (TRANSLATION_UNIT_LANGUAGE (context)((tree_check ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5530, __FUNCTION__, (TRANSLATION_UNIT_DECL)))->translation_unit_decl
.language)
, "GNU C++");
5531 }
5532 return is_cxx ();
5533}
5534
5535/* Return TRUE if the language is Fortran. */
5536
5537static inline bool
5538is_fortran (void)
5539{
5540 unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
5541
5542 return (lang == DW_LANG_Fortran77
5543 || lang == DW_LANG_Fortran90
5544 || lang == DW_LANG_Fortran95
5545 || lang == DW_LANG_Fortran03
5546 || lang == DW_LANG_Fortran08);
5547}
5548
5549static inline bool
5550is_fortran (const_tree decl)
5551{
5552 if (in_lto_pglobal_options.x_in_lto_p)
5553 {
5554 const_tree context = get_ultimate_context (decl);
5555 if (context && TRANSLATION_UNIT_LANGUAGE (context)((tree_check ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5555, __FUNCTION__, (TRANSLATION_UNIT_DECL)))->translation_unit_decl
.language)
)
5556 return (strncmp (TRANSLATION_UNIT_LANGUAGE (context)((tree_check ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5556, __FUNCTION__, (TRANSLATION_UNIT_DECL)))->translation_unit_decl
.language)
,
5557 "GNU Fortran", 11) == 0
5558 || strcmp (TRANSLATION_UNIT_LANGUAGE (context)((tree_check ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5558, __FUNCTION__, (TRANSLATION_UNIT_DECL)))->translation_unit_decl
.language)
,
5559 "GNU F77") == 0);
5560 }
5561 return is_fortran ();
5562}
5563
5564/* Return TRUE if the language is Ada. */
5565
5566static inline bool
5567is_ada (void)
5568{
5569 unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
5570
5571 return lang == DW_LANG_Ada95 || lang == DW_LANG_Ada83;
5572}
5573
5574/* Return TRUE if the language is D. */
5575
5576static inline bool
5577is_dlang (void)
5578{
5579 unsigned int lang = get_AT_unsigned (comp_unit_die (), DW_AT_language);
5580
5581 return lang == DW_LANG_D;
5582}
5583
5584/* Remove the specified attribute if present. Return TRUE if removal
5585 was successful. */
5586
5587static bool
5588remove_AT (dw_die_ref die, enum dwarf_attribute attr_kind)
5589{
5590 dw_attr_node *a;
5591 unsigned ix;
5592
5593 if (! die)
5594 return false;
5595
5596 FOR_EACH_VEC_SAFE_ELT (die->die_attr, ix, a)for (ix = 0; vec_safe_iterate ((die->die_attr), (ix), &
(a)); ++(ix))
5597 if (a->dw_attr == attr_kind)
5598 {
5599 if (AT_class (a) == dw_val_class_str)
5600 if (a->dw_attr_val.v.val_str->refcount)
5601 a->dw_attr_val.v.val_str->refcount--;
5602
5603 /* vec::ordered_remove should help reduce the number of abbrevs
5604 that are needed. */
5605 die->die_attr->ordered_remove (ix);
5606 return true;
5607 }
5608 return false;
5609}
5610
5611/* Remove CHILD from its parent. PREV must have the property that
5612 PREV->DIE_SIB == CHILD. Does not alter CHILD. */
5613
5614static void
5615remove_child_with_prev (dw_die_ref child, dw_die_ref prev)
5616{
5617 gcc_assert (child->die_parent == prev->die_parent)((void)(!(child->die_parent == prev->die_parent) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5617, __FUNCTION__), 0 : 0))
;
5618 gcc_assert (prev->die_sib == child)((void)(!(prev->die_sib == child) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5618, __FUNCTION__), 0 : 0))
;
5619 if (prev == child)
5620 {
5621 gcc_assert (child->die_parent->die_child == child)((void)(!(child->die_parent->die_child == child) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5621, __FUNCTION__), 0 : 0))
;
5622 prev = NULLnullptr;
5623 }
5624 else
5625 prev->die_sib = child->die_sib;
5626 if (child->die_parent->die_child == child)
5627 child->die_parent->die_child = prev;
5628 child->die_sib = NULLnullptr;
5629}
5630
5631/* Replace OLD_CHILD with NEW_CHILD. PREV must have the property that
5632 PREV->DIE_SIB == OLD_CHILD. Does not alter OLD_CHILD. */
5633
5634static void
5635replace_child (dw_die_ref old_child, dw_die_ref new_child, dw_die_ref prev)
5636{
5637 dw_die_ref parent = old_child->die_parent;
5638
5639 gcc_assert (parent == prev->die_parent)((void)(!(parent == prev->die_parent) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5639, __FUNCTION__), 0 : 0))
;
5640 gcc_assert (prev->die_sib == old_child)((void)(!(prev->die_sib == old_child) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5640, __FUNCTION__), 0 : 0))
;
5641
5642 new_child->die_parent = parent;
5643 if (prev == old_child)
5644 {
5645 gcc_assert (parent->die_child == old_child)((void)(!(parent->die_child == old_child) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5645, __FUNCTION__), 0 : 0))
;
5646 new_child->die_sib = new_child;
5647 }
5648 else
5649 {
5650 prev->die_sib = new_child;
5651 new_child->die_sib = old_child->die_sib;
5652 }
5653 if (old_child->die_parent->die_child == old_child)
5654 old_child->die_parent->die_child = new_child;
5655 old_child->die_sib = NULLnullptr;
5656}
5657
5658/* Move all children from OLD_PARENT to NEW_PARENT. */
5659
5660static void
5661move_all_children (dw_die_ref old_parent, dw_die_ref new_parent)
5662{
5663 dw_die_ref c;
5664 new_parent->die_child = old_parent->die_child;
5665 old_parent->die_child = NULLnullptr;
5666 FOR_EACH_CHILD (new_parent, c, c->die_parent = new_parent)do { c = new_parent->die_child; if (c) do { c = c->die_sib
; c->die_parent = new_parent; } while (c != new_parent->
die_child); } while (0)
;
5667}
5668
5669/* Remove child DIE whose die_tag is TAG. Do nothing if no child
5670 matches TAG. */
5671
5672static void
5673remove_child_TAG (dw_die_ref die, enum dwarf_tag tag)
5674{
5675 dw_die_ref c;
5676
5677 c = die->die_child;
5678 if (c) do {
5679 dw_die_ref prev = c;
5680 c = c->die_sib;
5681 while (c->die_tag == tag)
5682 {
5683 remove_child_with_prev (c, prev);
5684 c->die_parent = NULLnullptr;
5685 /* Might have removed every child. */
5686 if (die->die_child == NULLnullptr)
5687 return;
5688 c = prev->die_sib;
5689 }
5690 } while (c != die->die_child);
5691}
5692
5693/* Add a CHILD_DIE as the last child of DIE. */
5694
5695static void
5696add_child_die (dw_die_ref die, dw_die_ref child_die)
5697{
5698 /* FIXME this should probably be an assert. */
5699 if (! die || ! child_die)
5700 return;
5701 gcc_assert (die != child_die)((void)(!(die != child_die) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5701, __FUNCTION__), 0 : 0))
;
5702
5703 child_die->die_parent = die;
5704 if (die->die_child)
5705 {
5706 child_die->die_sib = die->die_child->die_sib;
5707 die->die_child->die_sib = child_die;
5708 }
5709 else
5710 child_die->die_sib = child_die;
5711 die->die_child = child_die;
5712}
5713
5714/* Like add_child_die, but put CHILD_DIE after AFTER_DIE. */
5715
5716static void
5717add_child_die_after (dw_die_ref die, dw_die_ref child_die,
5718 dw_die_ref after_die)
5719{
5720 gcc_assert (die((void)(!(die && child_die && after_die &&
die->die_child && die != child_die) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5724, __FUNCTION__), 0 : 0))
5721 && child_die((void)(!(die && child_die && after_die &&
die->die_child && die != child_die) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/dwarf2out.c"
, 5724, __FUNCTION__), 0 : 0))
5722 && after_die((void)(!(die && child_die && after_die &&
die->die_child && die != child_die) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbo