1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
34 ---------------------------------
35 -- Summary of Debug Flag Usage --
36 ---------------------------------
38 -- Debug flags for compiler (GNAT1)
40 -- da Generate messages tracking semantic analyzer progress
41 -- db Show encoding of type names for debug output
42 -- dc List names of units as they are compiled
43 -- dd Dynamic allocation of tables messages generated
44 -- de List the entity table
45 -- df Full tree/source print (includes withed units)
46 -- dg Print source from tree (generated code only)
47 -- dh Generate listing showing loading of name table hash chains
48 -- di Generate messages for visibility linking/delinking
49 -- dj Suppress "junk null check" for access parameter values
50 -- dk Generate GNATBUG message on abort, even if previous errors
51 -- dl Generate unit load trace messages
52 -- dm Prevent special frontend inlining in GNATprove mode
53 -- dn Generate messages for node/list allocation
54 -- do Print source from tree (original code only)
55 -- dp Generate messages for parser scope stack push/pops
56 -- dq No auto-alignment of small records
57 -- dr Generate parser resynchronization messages
58 -- ds Print source from tree (including original and generated stuff)
60 -- du Uncheck categorization pragmas
61 -- dv Output trace of overload resolution
62 -- dw Print trace of semantic scope stack
63 -- dx Force expansion on, even if no code being generated
64 -- dy Print tree of package Standard
65 -- dz Print source of package Standard
67 -- dA All entities included in representation information output
68 -- dB Output debug encoding of type names and variants
69 -- dC Output debugging information on check suppression
70 -- dD Delete elaboration checks in inner level routines
71 -- dE Apply elaboration checks to predefined units
73 -- dG Generate all warnings including those normally suppressed
74 -- dH Hold (kill) call to gigi
75 -- dI Inhibit internal name numbering in gnatG listing
76 -- dJ Prepend subprogram name in messages
77 -- dK Kill all error messages
78 -- dL Output trace information on elaboration checking
79 -- dM Assume all variables are modified (no current values)
80 -- dN No file name information in exception messages
81 -- dO Output immediate error messages
82 -- dP Do not check for controlled objects in preelaborable packages
83 -- dQ Use old secondary stack method
84 -- dR Bypass check for correct version of s-rpc
85 -- dS Never convert numbers to machine numbers in Sem_Eval
86 -- dT Convert to machine numbers only for constant declarations
87 -- dU Enable garbage collection of unreachable entities
88 -- dV Enable viewing of all symbols in debugger
89 -- dW Disable warnings on calls for IN OUT parameters
90 -- dX Display messages on reads of potentially uninitialized scalars
91 -- dY Enable configurable run-time mode
92 -- dZ Generate listing showing the contents of the dispatch tables
94 -- d.a Force Target_Strict_Alignment mode to True
95 -- d.b Dump backend types
96 -- d.c Generate inline concatenation, do not call procedure
97 -- d.d Disable atomic synchronization
98 -- d.e Enable atomic synchronization
99 -- d.f Inhibit folding of static expressions
100 -- d.g Enable conversion of raise into goto
101 -- d.h Minimize the creation of public internal symbols for concatenation
102 -- d.i Ignore Warnings pragmas
103 -- d.j Generate listing of frontend inlined calls
104 -- d.k Kill referenced run-time library unit line numbers
105 -- d.l Use Ada 95 semantics for limited function returns
106 -- d.m For -gnatl, print full source only for main unit
107 -- d.n Print source file names
108 -- d.o Conservative elaboration order for indirect calls
109 -- d.p Use original Ada 95 semantics for Bit_Order (disable AI95-0133)
110 -- d.q Suppress optimizations on imported 'in'
111 -- d.r Disable reordering of components in record types
112 -- d.s Strict secondary stack management
113 -- d.t Disable static allocation of library level dispatch tables
114 -- d.u Enable Modify_Tree_For_C (update tree for c)
116 -- d.w Do not check for infinite loops
117 -- d.x No exception handlers
118 -- d.y Disable implicit pragma Elaborate_All on task bodies
119 -- d.z Restore previous support for frontend handling of Inline_Always
121 -- d.A Read/write Aspect_Specifications hash table to tree
122 -- d.B Generate a bug box on abort_statement
123 -- d.C Generate concatenation call, do not generate inline code
124 -- d.D Disable errors on use of overriding keyword in Ada 95 mode
125 -- d.E Turn selected errors into warnings
126 -- d.F Debug mode for GNATprove
127 -- d.G Ignore calls through generic formal parameters for elaboration
128 -- d.H GNSA mode for ASIS
129 -- d.I Do not ignore enum representation clauses in CodePeer mode
130 -- d.J Relaxed rules for pragma No_Return
131 -- d.K Enable generation of contract-only procedures in CodePeer mode
132 -- d.L Depend on back end for limited types in if and case expressions
133 -- d.M Relaxed RM semantics
134 -- d.N Add node to all entities
135 -- d.O Dump internal SCO tables
136 -- d.P Previous (non-optimized) handling of length comparisons
137 -- d.Q Previous (incomplete) style check for binary operators
138 -- d.R Restrictions in ali files in positional form
139 -- d.S Force Optimize_Alignment (Space)
140 -- d.T Force Optimize_Alignment (Time)
141 -- d.U Ignore indirect calls for static elaboration
142 -- d.V Do not verify validity of SCIL files (CodePeer mode)
143 -- d.W Print out debugging information for Walk_Library_Items
144 -- d.X Old treatment of indexing aspects
146 -- d.Z Do not enable expansion in configurable run-time mode
148 -- d1 Error msgs have node numbers where possible
149 -- d2 Eliminate error flags in verbose form error messages
150 -- d3 Dump bad node in Comperr on an abort
151 -- d4 Inhibit automatic krunch of predefined library unit files
152 -- d5 Debug output for tree read/write
153 -- d6 Default access unconstrained to thin pointers
154 -- d7 Suppress version/source stamp/compilation time for -gnatv/-gnatl
155 -- d8 Force opposite endianness in packed stuff
156 -- d9 Allow lock free implementation
158 -- d.1 Enable unnesting of nested procedures
159 -- d.2 Allow statements in declarative part
160 -- d.3 Output debugging information from Exp_Unst
161 -- d.4 Do not delete generated C file in case of errors
162 -- d.5 Do not generate imported subprogram definitions in C code
163 -- d.6 Do not avoid declaring unreferenced types in C code
168 -- Debug flags for binder (GNATBIND)
170 -- da All links (including internal units) listed if there is a cycle
171 -- db Output information from Better_Choice
172 -- dc List units as they are chosen
174 -- de Elaboration dependencies including system units
178 -- di Ignore_Errors mode for reading ali files
183 -- dn List details of manipulation of Num_Pred values
184 -- do Use older preference for elaboration order
185 -- dp Use old preference for elaboration order
190 -- du List units as they are acquired
191 -- dv Verbose debugging printouts
193 -- dx Force binder to read xref information from ali files
197 -- Debug flags used in package Make and its clients (e.g. GNATMAKE)
204 -- df Only output file names, not path names, in log
206 -- dh Generate listing showing loading of name table hash chains
211 -- dm Display the number of maximum simultaneous compilations
212 -- dn Do not delete temp files created by gnatmake
214 -- dp Prints the contents of the Q used by Make.Compile_Sources
215 -- dq Prints source files as they are enqueued and dequeued
218 -- dt Display time stamps when there is a mismatch
219 -- du List units as their ali files are acquired
221 -- dw Prints the list of units withed by the unit currently explored
226 --------------------------------------------
227 -- Documentation for Compiler Debug Flags --
228 --------------------------------------------
230 -- da Generate messages tracking semantic analyzer progress. A message
231 -- is output showing each node as it gets analyzed, expanded,
232 -- resolved, or evaluated. This option is useful for finding out
233 -- exactly where a bomb during semantic analysis is occurring.
235 -- db In Exp_Dbug, certain type names are encoded to include debugging
236 -- information. This debug switch causes lines to be output showing
237 -- the encodings used.
239 -- dc List names of units as they are compiled. One line of output will
240 -- be generated at the start of compiling each unit (package or
243 -- dd Dynamic allocation of tables messages generated. Each time a
244 -- table is reallocated, a line is output indicating the expansion.
246 -- de List the entity table
248 -- df Full tree/source print (includes withed units). Normally the tree
249 -- output (dt) or recreated source output (dg,do,ds) includes only
250 -- the main unit. If df is set, then the output in either case
251 -- includes all compiled units (see also dg,do,ds,dt). Note that to
252 -- be effective, this switch must be used in combination with one or
253 -- more of dt, dg, do or ds.
255 -- dg Print the source recreated from the generated tree. In the case
256 -- where the tree has been rewritten this output includes only the
257 -- generated code, not the original code (see also df,do,ds,dz).
258 -- This flag differs from -gnatG in that the output also includes
259 -- non-source generated null statements, and freeze nodes, which
260 -- are normally omitted in -gnatG mode.
262 -- dh Generates a table at the end of a compilation showing how the hash
263 -- table chains built by the Namet package are loaded. This is useful
264 -- in ensuring that the hashing algorithm (in Namet.Hash) is working
265 -- effectively with typical sets of program identifiers.
267 -- di Generate messages for visibility linking/delinking
269 -- dj Suppress "junk null check" for access parameters. This flag permits
270 -- Ada programs to pass null parameters to access parameters, and to
271 -- explicitly check such access values against the null literal.
272 -- Neither of these is valid Ada, but both were allowed in versions of
273 -- GNAT before 3.10, so this switch can ease the transition process.
275 -- dk Immediate kill on abort. Normally on an abort (i.e. a call to
276 -- Comperr.Compiler_Abort), the GNATBUG message is not given if
277 -- there is a previous error. This debug switch bypasses this test
278 -- and gives the message unconditionally (useful for debugging).
280 -- dl Generate unit load trace messages. A line of traceback output is
281 -- generated each time a request is made to the library manager to
284 -- dm Prevent special frontend inlining in GNATprove mode. In some cases,
285 -- some subprogram calls are inlined in GNATprove mode in order to
286 -- facilitate formal verification. This debug switch prevents that
287 -- inlining to happen.
289 -- dn Generate messages for node/list allocation. Each time a node or
290 -- list header is allocated, a line of output is generated. Certain
291 -- other basic tree operations also cause a line of output to be
292 -- generated. This option is useful in seeing where the parser is
295 -- do Print the source recreated from the generated tree. In the case
296 -- where the tree has been rewritten, this output includes only the
297 -- original code, not the generated code (see also df,dg,ds,dz).
299 -- dp Generate messages for parser scope stack push/pops. A line of
300 -- output by the parser each time the parser scope stack is either
301 -- pushed or popped. Useful in debugging situations where the
302 -- parser scope stack ends up incorrectly synchronized
304 -- dq In layout version 1.38, 2002/01/12, a circuit was implemented
305 -- to give decent default alignment to short records that had no
306 -- specific alignment set. This debug option restores the previous
307 -- behavior of giving such records poor alignments, typically 1.
308 -- This may be useful in dealing with transition.
310 -- dr Generate parser resynchronization messages. Normally the parser
311 -- resynchronizes quietly. With this debug option, two messages
312 -- are generated, one when the parser starts a resynchronization
313 -- skip, and another when it resumes parsing. Useful in debugging
314 -- inadequate error recovery situations.
316 -- ds Print the source recreated from the generated tree. In the case
317 -- where the tree has been rewritten this output includes both the
318 -- generated code and the original code with the generated code
319 -- being enlosed in curly brackets (see also df,do,ds,dz)
321 -- dt Print full tree. The generated tree is output (see also df,dy)
323 -- du Uncheck categorization pragmas. This debug switch causes the
324 -- elaboration control pragmas (Pure, Preelaborate, etc.) and the
325 -- categorization pragmas (Shared_Passive, Remote_Types, etc.) to be
326 -- ignored, so that normal checks are not made (this is particularly
327 -- useful for adding temporary debugging code to units that have
328 -- pragmas that are inconsistent with the debugging code added).
330 -- dv Output trace of overload resolution. Outputs messages for
331 -- overload attempts that involve cascaded errors, or where
332 -- an interpretation is incompatible with the context.
334 -- dw Write semantic scope stack messages. Each time a scope is created
335 -- or removed, a message is output (see the Sem_Ch8.Push_Scope and
336 -- Sem_Ch8.Pop_Scope subprograms).
338 -- dx Force expansion on, even if no code being generated. Normally the
339 -- expander is inhibited if no code is generated. This switch forces
340 -- expansion to proceed normally even if the backend is not being
341 -- called. This is particularly useful for debugging purposes when
342 -- using the front-end only version of the compiler (which normally
343 -- would never do any expansion).
345 -- dy Print tree of package Standard. Normally the tree print out does
346 -- not include package Standard, even if the -df switch is set. This
347 -- switch forces output of the internal tree built for Standard.
349 -- dz Print source of package Standard. Normally the source print out
350 -- does not include package Standard, even if the -df switch is set.
351 -- This switch forces output of the source recreated from the internal
352 -- tree built for Standard. Note that this differs from -gnatS in
353 -- that it prints from the actual tree using the normal Sprint
354 -- circuitry for printing trees.
356 -- dA Forces output of representation information, including full
357 -- information for all internal type and object entities, as well
358 -- as all user defined type and object entities including private
359 -- and incomplete types. This debug switch also automatically sets
360 -- the equivalent of -gnatRm.
362 -- dB Output debug encodings for types and variants. See Exp_Dbug for
363 -- exact form of the generated output.
365 -- dC Output trace information showing the decisions made during
366 -- check suppression activity in unit Checks.
368 -- dD Delete new elaboration checks. This flag causes GNAT to return
369 -- to the 3.13a elaboration semantics, and to suppress the fixing
370 -- of two bugs. The first is in the context of inner routines in
371 -- dynamic elaboration mode, when the subprogram we are in was
372 -- called at elaboration time by a unit that was also compiled with
373 -- dynamic elaboration checks. In this case, if A calls B calls C,
374 -- and all are in different units, we need an elaboration check at
375 -- each call. These nested checks were only put in recently (see
376 -- version 1.80 of Sem_Elab) and we provide this debug flag to
377 -- revert to the previous behavior in case of regressions. The
378 -- other behavior reverted by this flag is the treatment of the
379 -- Elaborate_Body pragma in static elaboration mode. This used to
380 -- be treated as not needing elaboration checking, but in fact in
381 -- general Elaborate_All is still required because of nested calls.
383 -- dE Apply compile time elaboration checking for with relations between
384 -- predefined units. Normally no checks are made.
386 -- dG Generate all warnings. Normally Errout suppresses warnings on
387 -- units that are not part of the main extended source, and also
388 -- suppresses warnings on instantiations in the main extended
389 -- source that duplicate warnings already posted on the template.
390 -- This switch stops both kinds of deletion and causes Errout to
391 -- post all warnings sent to it.
393 -- dH Inhibit call to gigi. This is useful for testing front end data
394 -- layout, and may be useful in other debugging situations where
395 -- you do not want gigi to intefere with the testing.
397 -- dI Inhibit internal name numbering in gnatDG listing. Any sequence of
398 -- the form <uppercase-letter><digits><lowercase-letter> appearing in
399 -- a name is replaced by <uppercase-letter>...<lowercase-letter>. This
400 -- is used in the fixed bugs run to minimize system and version
401 -- dependency in filed -gnatD or -gnatG output.
403 -- dJ Prepend the name of the enclosing subprogram in compiler messages
404 -- (errors, warnings, style checks). This is useful in particular to
405 -- integrate compiler warnings in static analysis tools such as
408 -- dK Kill all error messages. This debug flag suppresses the output
409 -- of all error messages. It is used in regression tests where the
410 -- error messages are target dependent and irrelevant.
412 -- dL Output trace information on elaboration checking. This debug
413 -- switch causes output to be generated showing each call or
414 -- instantiation as it is checked, and the progress of the recursive
415 -- trace through elaboration calls at compile time.
417 -- dM Assume all variables have been modified, and ignore current value
418 -- indications. This debug flag disconnects the tracking of constant
419 -- values (see Exp_Ch2.Expand_Current_Value).
421 -- dN Do not generate file name information in exception messages
423 -- dO Output immediate error messages. This causes error messages to
424 -- be output as soon as they are generated (disconnecting several
425 -- circuits for improvement of messages, deletion of duplicate
426 -- messages etc). Useful to diagnose compiler bombs caused by
427 -- erroneous handling of error situations
429 -- dP Do not check for controlled objects in preelaborable packages.
430 -- RM 10.2.1(9) forbids the use of library level controlled objects
431 -- in preelaborable packages, but this restriction is a huge pain,
432 -- especially in the predefined library units.
434 -- dQ Use old method for determining what goes on the secondary stack.
435 -- This disables some newer optimizations. The intent is to use this
436 -- temporarily to measure before/after efficiency. ???Remove this
437 -- when we are done (see Sem_Util.Requires_Transient_Scope).
439 -- dR Bypass the check for a proper version of s-rpc being present
440 -- to use the -gnatz? switch. This allows debugging of the use
441 -- of stubs generation without needing to have GLADE (or some
442 -- other PCS installed).
444 -- dS Omit conversion of fpt numbers to exact machine numbers in
445 -- non-static evaluation contexts (see Check_Non_Static_Context).
446 -- This is intended for testing out timing problems with this
447 -- conversion circuit.
449 -- dT Similar to dS, but omits the conversions only in the case where
450 -- the parent is not a constant declaration.
452 -- dU Enable garbage collection of unreachable entities. This enables
453 -- both the reachability analysis and changing the Is_Public and
454 -- Is_Eliminated flags.
456 -- dV Enable viewing of all symbols in debugger. Causes debug information
457 -- to be generated for all symbols, including internal symbols. This
458 -- is enabled by default for -gnatD, but this switch allows this to
459 -- be enabled without generating modified source files. Note that the
460 -- use of -gnatdV ensures in the dwarf/elf case that all symbols that
461 -- are present in the elf tables are also in the dwarf tables (which
462 -- seems to be required by some tools). Another effect of dV is to
463 -- generate full qualified names, including internal names generated
464 -- for blocks and loops.
466 -- dW Disable warnings when a possibly uninitialized scalar value is
467 -- passed to an IN OUT parameter of a procedure. This usage is a
468 -- quite improper bounded error [erroneous in Ada 83] situation,
469 -- and would normally generate a warning. However, to ease the
470 -- task of transitioning incorrect legacy code, we provide this
471 -- undocumented feature for suppressing these warnings.
473 -- dY Enable configurable run-time mode, just as though the System file
474 -- had Configurable_Run_Time_Mode set to True. This is useful in
475 -- testing high integrity mode.
477 -- dZ Generate listing showing the contents of the dispatch tables. Each
478 -- line has an internally generated number used for references between
479 -- tagged types and primitives. For each primitive the output has the
482 -- - Letter 'P' or letter 's': The former indicates that this
483 -- primitive will be located in a primary dispatch table. The
484 -- latter indicates that it will be located in a secondary
487 -- - Name of the primitive. In case of predefined Ada primitives
488 -- the text "(predefined)" is added before the name, and these
489 -- acronyms are used: SR (Stream_Read), SW (Stream_Write), SI
490 -- (Stream_Input), SO (Stream_Output), DA (Deep_Adjust), DF
491 -- (Deep_Finalize). In addition Oeq identifies the equality
492 -- operator, and "_assign" the assignment.
494 -- - If the primitive covers interface types, two extra fields
495 -- referencing other primitives are generated: "Alias" references
496 -- the primitive of the tagged type that covers an interface
497 -- primitive, and "AI_Alias" references the covered interface
500 -- - The expression "at #xx" indicates the slot of the dispatch
501 -- table occupied by such primitive in its corresponding primary
502 -- or secondary dispatch table.
504 -- - In case of abstract subprograms the text "is abstract" is
505 -- added at the end of the line.
507 -- d.a Force Target_Strict_Alignment to True, even on targets where it
508 -- would normally be false. Can be used for testing strict alignment
509 -- circuitry in the compiler.
511 -- d.b Dump back end types. During Create_Standard, the back end is
512 -- queried for all available types. This option shows them.
514 -- d.c Generate inline concatenation, instead of calling one of the
515 -- System.Concat_n.Str_Concat_n routines in cases where the latter
516 -- routines would normally be called.
518 -- d.d Disable atomic synchronization for all atomic variable references.
519 -- Pragma Enable_Atomic_Synchronization is ignored.
521 -- d.e Enable atomic synchronization for all atomic variable references.
522 -- Pragma Disable_Atomic_Synchronization is ignored, and also the
523 -- compiler switch -gnated is ignored.
525 -- d.f Suppress folding of static expressions. This of course results
526 -- in seriously non-conforming behavior, but is useful sometimes
527 -- when tracking down handling of complex expressions.
529 -- d.g Enables conversion of a raise statement into a goto when the
530 -- relevant handler is statically determinable. For now we only try
531 -- this if this debug flag is set. Later we will enable this more
532 -- generally by default.
534 -- d.h Minimize the creation of public internal symbols for concatenation
535 -- by enforcing a secondary stack-like handling of the final result.
536 -- The target of the concatenation is thus constrained in place and
537 -- initialized with the result instead of acting as its alias.
539 -- d.i Ignore all occurrences of pragma Warnings in the sources. This can
540 -- be used in particular to disable Warnings (Off) to check if any of
541 -- these statements are inappropriate.
543 -- d.k If an error message contains a reference to a location in an
544 -- internal unit, then suppress the line number in this reference.
546 -- d.j Generate listing of frontend inlined calls and inline calls passed
547 -- to the backend. This is useful to locate skipped calls that must be
548 -- inlined by the frontend.
550 -- d.l Use Ada 95 semantics for limited function returns. This may be
551 -- used to work around the incompatibility introduced by AI-318-2.
552 -- It is useful only in Ada 2005 and later.
554 -- d.m When -gnatl is used, the normal output includes full listings of
555 -- all files in the extended main source (body/spec/subunits). If this
556 -- debug switch is used, then the full listing is given only for the
557 -- main source (this corresponds to a previous behavior of -gnatl and
558 -- is used for running the ACATS tests).
560 -- d.n Print source file names as they are loaded. This is useful if the
561 -- compiler has a bug -- these are the files that need to be included
564 -- d.o Conservative elaboration order for indirect calls. This causes
565 -- P'Access to be treated as a call in more cases.
567 -- d.p In Ada 95 (or 83) mode, use original Ada 95 behavior for the
568 -- interpretation of component clauses crossing byte boundaries when
569 -- using the non-default bit order (i.e. ignore AI95-0133).
571 -- d.q If an array variable or constant is not modified in Ada code, and
572 -- is passed to an 'in' parameter of a foreign-convention subprogram,
573 -- and that subprogram modifies the array, the Ada compiler normally
574 -- assumes that the array is not modified. This option suppresses such
575 -- optimizations. This option should not be used; the correct solution
576 -- is to declare the parameter 'in out'.
578 -- d.r Do not reorder components in record types.
580 -- d.s The compiler no longer attempts to optimize the calls to secondary
581 -- stack management routines SS_Mark and SS_Release. As a result, each
582 -- transient block tasked with secondary stack management will fulfill
583 -- its role unconditionally.
585 -- d.s The compiler does not generate calls to secondary stack management
586 -- routines SS_Mark and SS_Release for a transient block when there is
587 -- an enclosing scoping construct which already manages the secondary
590 -- d.t The compiler has been modified (a fairly extensive modification)
591 -- to generate static dispatch tables for library level tagged types.
592 -- This debug switch disables this modification and reverts to the
593 -- previous dynamic construction of tables. It is there as a possible
594 -- work around if we run into trouble with the new implementation.
596 -- d.u Sets Modify_Tree_For_C mode in which tree is modified to make it
597 -- easier to generate code using a C compiler.
599 -- d.w This flag turns off the scanning of loops to detect possible
602 -- d.x No exception handlers in generated code. This causes exception
603 -- handlers to be eliminated from the generated code. They are still
604 -- fully compiled and analyzed, they just get eliminated from the
605 -- code generation step.
607 -- d.y Disable implicit pragma Elaborate_All on task bodies. When a task
608 -- body calls a procedure in the same package, and that procedure
609 -- calls a procedure in another package, the static elaboration
610 -- machinery adds an implicit Elaborate_All on the other package. This
611 -- switch disables the addition of the implicit pragma in such cases.
613 -- d.z Restore previous front-end support for Inline_Always. In default
614 -- mode, for targets that use the GCC back end, Inline_Always is
615 -- handled by the back end. Use of this switch restores the previous
616 -- handling of Inline_Always by the front end on such targets. For the
617 -- targets that do not use the GCC back end, this switch is ignored.
619 -- d.A There seems to be a problem with ASIS if we activate the circuit
620 -- for reading and writing the aspect specification hash table, so
621 -- for now, this is controlled by the debug flag d.A. The hash table
622 -- is only written and read if this flag is set.
624 -- d.B Generate a bug box when we see an abort_statement, even though
625 -- there is no bug. Useful for testing Comperr.Compiler_Abort: write
626 -- some code containing an abort_statement, and compile it with
627 -- -gnatd.B. There is nothing special about abort_statements; it just
628 -- provides a way to control where the bug box is generated. See "when
629 -- N_Abort_Statement" in package body Expander.
631 -- d.C Generate call to System.Concat_n.Str_Concat_n routines in cases
632 -- where we would normally generate inline concatenation code.
634 -- d.D For compatibility with some Ada 95 compilers implementing only
635 -- one feature of Ada 2005 (overriding keyword), disable errors on use
636 -- of overriding keyword in Ada 95 mode.
638 -- d.E Turn selected errors into warnings. This debug switch causes a
639 -- specific set of error messages into warnings. Setting this switch
640 -- causes Opt.Error_To_Warning to be set to True. The intention is
641 -- that this be used for messages representing upwards incompatible
642 -- changes to Ada 2012 that cause previously correct programs to be
643 -- treated as illegal now. The following cases are affected:
645 -- Errors relating to overlapping subprogram parameters for cases
646 -- other than IN OUT parameters to functions.
648 -- Errors relating to the new rules about not defining equality
649 -- too late so that composition of equality can be assured.
651 -- Errors relating to overriding indicators on protected subprogram
652 -- bodies (not an Ada 2012 incompatibility, but might cause errors
653 -- for existing programs assuming they were legal because GNAT
654 -- formerly allowed them).
656 -- d.F Sets GNATprove_Mode to True. This allows debugging the frontend in
657 -- the special mode used by GNATprove.
659 -- d.G Previously the compiler ignored calls via generic formal parameters
660 -- when doing the analysis for the static elaboration model. This is
661 -- now fixed, but we provide this debug flag to revert to the previous
662 -- situation of ignoring such calls to aid in transition.
664 -- d.H Sets ASIS_GNSA_Mode to True. This signals the front end to suppress
665 -- the call to gigi in ASIS_Mode.
667 -- d.I Do not ignore enum representation clauses in CodePeer mode.
668 -- The default of ignoring representation clauses for enumeration
669 -- types in CodePeer is good for the majority of Ada code, but in some
670 -- cases being able to change this default might be useful to remove
671 -- some false positives.
673 -- d.J Relaxed rules for pragma No_Return. A pragma No_Return is illegal
674 -- if it applies to a body. This switch disables the legality check
675 -- for that. If the procedure does in fact return normally, execution
676 -- is erroneous, and therefore unpredictable.
678 -- d.K Enable generation of contract-only procedures in CodePeer mode and
679 -- report a warning on subprograms for which the contract-only body
680 -- cannot be built. Currently reported on subprograms defined in
681 -- nested package specs that have some formal (or return type) whose
682 -- type is a private type defined in some enclosing package and that
683 -- have pre/postconditions.
685 -- d.L Normally the front end generates special expansion for conditional
686 -- expressions of a limited type. This debug flag removes this special
687 -- case expansion, leaving it up to the back end to handle conditional
688 -- expressions correctly.
690 -- d.M Relaxed RM semantics. This flag sets Opt.Relaxed_RM_Semantics
691 -- See Opt.Relaxed_RM_Semantics for more details.
693 -- d.N Enlarge entities by one node (but don't attempt to use this extra
694 -- node for storage of any flags or fields). This can be used to do
695 -- experiments on the impact of increasing entity sizes.
697 -- d.O Dump internal SCO tables. Before outputting the SCO information to
698 -- the ALI file, the internal SCO tables (SCO_Table/SCO_Unit_Table)
699 -- are dumped for debugging purposes.
701 -- d.P Previous non-optimized handling of length comparisons. Setting this
702 -- flag inhibits the effect of Optimize_Length_Comparison in Exp_Ch4.
703 -- This is there in case we find a situation where the optimization
704 -- malfunctions, to provide a work around.
706 -- d.Q Previous incomplete style checks for binary operators. Style checks
707 -- for token separation rules were incomplete and have been made
708 -- compliant with the documentation. For example, no warning was
709 -- issued for expressions such as 16-One or "A"&"B". Setting this flag
710 -- inhibits these new checks.
712 -- d.R As documented in lib-writ.ads, restrictions in the ali file can
713 -- have two forms, positional and named. The named notation is the
714 -- current preferred form, but the use of this debug switch will force
715 -- the use of the obsolescent positional form.
717 -- d.S Force Optimize_Alignment (Space) mode as the default
719 -- d.T Force Optimize_Alignment (Time) mode as the default
721 -- d.U Ignore indirect calls for static elaboration. The static
722 -- elaboration model is conservative, especially regarding indirect
723 -- calls. If you say Proc'Access, it will assume you might call
724 -- Proc. This can cause elaboration cycles at bind time. This flag
725 -- reverts to the behavior of earlier compilers, which ignored
728 -- d.V Do not verify the validity of SCIL files (CodePeer mode). When
729 -- generating SCIL files for CodePeer, by default we verify that the
730 -- SCIL is well formed before saving it on disk. This switch can be
731 -- used to disable this checking, either to improve speed or to shut
732 -- down a false positive detected during the verification.
734 -- d.W Print out debugging information for Walk_Library_Items, including
735 -- the order in which units are walked. This is primarily for use in
736 -- debugging CodePeer mode.
738 -- d.X A previous version of GNAT allowed indexing aspects to be redefined
739 -- on derived container types, while the default iterator was
740 -- inherited from the parent type. This nonstandard extension is
741 -- preserved temporarily for use by the modeling project under debug
744 -- d.Z Normally we always enable expansion in configurable run-time mode
745 -- to make sure we get error messages about unsupported features even
746 -- when compiling in -gnatc mode. But expansion is turned off in this
747 -- case if debug flag -gnatd.Z is used. This is to deal with the case
748 -- where we discover difficulties in this new processing.
750 -- d1 Error messages have node numbers where possible. Normally error
751 -- messages have only source locations. This option is useful when
752 -- debugging errors caused by expanded code, where the source location
753 -- does not give enough information.
755 -- d2 Suppress output of the error position flags for verbose form error
756 -- messages. The messages are still interspersed in the listing, but
757 -- without any error flags or extra blank lines. Also causes an extra
758 -- <<< to be output at the right margin. This is intended to be the
759 -- easiest format for checking conformance of ACATS B tests. This
760 -- flag also suppresses the additional messages explaining why a
761 -- non-static expression is non-static (see Sem_Eval.Why_Not_Static).
762 -- This avoids having to worry about these messages in ACATS testing.
764 -- d3 Causes Comperr to dump the contents of the node for which an abort
765 -- was detected (normally only the Node_Id of the node is output).
767 -- d4 Inhibits automatic krunching of predefined library unit file names.
768 -- Normally, as described in the spec of package Krunch, such files
769 -- are automatically krunched to 8 characters, with special treatment
770 -- of the prefixes Ada, System, and Interfaces. Setting this debug
771 -- switch disables this special treatment.
773 -- d5 Causes the tree read/write circuit to output detailed information
774 -- tracking the data that is read and written element by element.
776 -- d6 Normally access-to-unconstrained-array types are represented
777 -- using fat (double) pointers. Using this debug flag causes them
778 -- to default to thin. This can be used to test the performance
779 -- implications of using thin pointers, and also to test that the
780 -- compiler functions correctly with this choice.
782 -- d7 Normally a -gnatl or -gnatv listing includes the time stamp of the
783 -- source file and the time of the compilation. This debug flag can
784 -- be used to suppress this output, and also suppresses the message
785 -- with the version of the compiler. This is useful for regression
786 -- tests which need to have consistent output.
788 -- d8 This forces the packed stuff to generate code assuming the
789 -- opposite endianness from the actual correct value. Useful in
790 -- testing out code generation from the packed routines.
792 -- d9 This allows lock free implementation for protected objects
795 -- d.1 Sets Opt.Unnest_Subprogram_Mode to enable unnesting of subprograms.
796 -- This special pass does not actually unnest things, but it ensures
797 -- that a nested procedure does not contain any uplevel references.
798 -- See spec of Exp_Unst for full details.
800 -- d.2 Allow statements within declarative parts. This is not usually
801 -- allowed, but in some debugging contexts (e.g. testing the circuit
802 -- for unnesting of procedures), it is useful to allow this.
804 -- d.3 Output debugging information from Exp_Unst, including the name of
805 -- any unreachable subprograms that get deleted.
807 -- d.4 By default in case of an error during C generation, the .c or .h
808 -- file is deleted. This flag keeps the C file.
810 -- d.5 By default a subprogram imported generates a subprogram profile.
811 -- This debug flag disables this generation when generating C code,
812 -- assuming a proper #include will be used instead.
814 -- d.6 By default the C back-end avoids declaring types that are not
815 -- referenced by the generated C code. This debug flag restores the
816 -- output of all the types.
818 ------------------------------------------
819 -- Documentation for Binder Debug Flags --
820 ------------------------------------------
822 -- da Normally if there is an elaboration circularity, then in describing
823 -- the cycle, links involving internal units are omitted, since they
824 -- are irrelevant and confusing. This debug flag causes all links to
825 -- be listed, and is useful when diagnosing circularities introduced
826 -- by incorrect changes to the run-time library itself.
828 -- db Output debug information from Better_Choice in Binde, which uses
829 -- various heuristics to determine elaboration order in cases where
830 -- multiple orders are valid.
832 -- dc List units as they are chosen. As units are selected for addition to
833 -- the elaboration order, a line of output is generated showing which
834 -- unit has been selected.
836 -- de Similar to the effect of -e (output complete list of elaboration
837 -- dependencies) except that internal units are included in the
840 -- di Normally gnatbind calls Read_Ali with Ignore_Errors set to
841 -- False, since the binder really needs correct version ALI
842 -- files to do its job. This debug flag causes Ignore_Errors
843 -- mode to be set for the binder (and is particularly useful
844 -- for testing ignore errors mode).
846 -- dn List details of manipulation of Num_Pred values during execution of
847 -- the algorithm used to determine a correct order of elaboration. This
848 -- is useful in diagnosing any problems in its behavior.
850 -- do Use older elaboration order preference. The new preference rules
851 -- prefer specs with no bodies to specs with bodies, and between two
852 -- specs with bodies, prefers the one whose body is closer to being
853 -- able to be elaborated. This is a clear improvement, but we provide
854 -- this debug flag in case of regressions. Note: -do is even older
857 -- dp Use old elaboration order preference. The new preference rules
858 -- elaborate all units within a strongly connected component together,
859 -- with no other units in between. In particular, if a spec/body pair
860 -- can be elaborated together, it will be. In the new order, the binder
861 -- behaves as if every pragma Elaborate_All that would be legal is
862 -- present, even if it does not appear in the source code.
864 -- du List unit name and file name for each unit as it is read in
866 -- dv Verbose debugging printouts
868 -- dx Force the binder to read (and then ignore) the xref information
869 -- in ali files (used to check that read circuit is working OK).
871 --------------------------------------------
872 -- Documentation for gnatmake Debug Flags --
873 --------------------------------------------
875 -- df Only output file names, not path names, in log
877 -- dh Generate listing showing loading of name table hash chains,
878 -- same as for the compiler.
880 -- dm Issue a message indicating the maximum number of simultaneous
883 -- dn Do not delete temporary files created by gnatmake at the end
884 -- of execution, such as temporary config pragma files, mapping
885 -- files or project path files. This debug switch is equivalent to
886 -- the standard switch --keep-temp-files. We retain the debug switch
887 -- for back compatibility with past usage.
889 -- dp Prints the Q used by routine Make.Compile_Sources every time
890 -- we go around the main compile loop of Make.Compile_Sources
892 -- dq Prints source files as they are enqueued and dequeued in the Q
893 -- used by routine Make.Compile_Sources. Useful to figure out the
894 -- order in which sources are recompiled.
896 -- dt When a time stamp mismatch has been found for an ALI file,
897 -- display the source file name, the time stamp expected and
898 -- the time stamp found.
900 -- du List unit name and file name for each unit as it is read in
902 -- dw Prints the list of units withed by the unit currently explored
903 -- during the main loop of Make.Compile_Sources.
905 ---------------------------------------------
906 -- Documentation for gprbuild Debug Flags --
907 ---------------------------------------------
909 -- dm Display the maximum number of simultaneous compilations.
911 -- dn Do not delete temporary files created by gprbuild at the end
912 -- of execution, such as temporary config pragma files, mapping
913 -- files or project path files. This debug switch is equivalent to
914 -- the standard switch --keep-temp-files. We retain the debug switch
915 -- for back compatibility with past usage.
917 -- dt When a time stamp mismatch has been found for an ALI file,
918 -- display the source file name, the time stamp expected and
919 -- the time stamp found.
925 procedure Set_Debug_Flag
(C
: Character; Val
: Boolean := True) is
926 subtype Dig
is Character range '1' .. '9';
927 subtype LLet
is Character range 'a' .. 'z';
928 subtype ULet
is Character range 'A' .. 'Z';
956 Debug_Flag_AA
:= Val
;
958 Debug_Flag_BB
:= Val
;
960 Debug_Flag_CC
:= Val
;
962 Debug_Flag_DD
:= Val
;
964 Debug_Flag_EE
:= Val
;
966 Debug_Flag_FF
:= Val
;
968 Debug_Flag_GG
:= Val
;
970 Debug_Flag_HH
:= Val
;
972 Debug_Flag_II
:= Val
;
974 Debug_Flag_JJ
:= Val
;
976 Debug_Flag_KK
:= Val
;
978 Debug_Flag_LL
:= Val
;
980 Debug_Flag_MM
:= Val
;
982 Debug_Flag_NN
:= Val
;
984 Debug_Flag_OO
:= Val
;
986 Debug_Flag_PP
:= Val
;
988 Debug_Flag_QQ
:= Val
;
990 Debug_Flag_RR
:= Val
;
992 Debug_Flag_SS
:= Val
;
994 Debug_Flag_TT
:= Val
;
996 Debug_Flag_UU
:= Val
;
998 Debug_Flag_VV
:= Val
;
1000 Debug_Flag_WW
:= Val
;
1002 Debug_Flag_XX
:= Val
;
1004 Debug_Flag_YY
:= Val
;
1006 Debug_Flag_ZZ
:= Val
;
1012 Debug_Flag_A
:= Val
;
1014 Debug_Flag_B
:= Val
;
1016 Debug_Flag_C
:= Val
;
1018 Debug_Flag_D
:= Val
;
1020 Debug_Flag_E
:= Val
;
1022 Debug_Flag_F
:= Val
;
1024 Debug_Flag_G
:= Val
;
1026 Debug_Flag_H
:= Val
;
1028 Debug_Flag_I
:= Val
;
1030 Debug_Flag_J
:= Val
;
1032 Debug_Flag_K
:= Val
;
1034 Debug_Flag_L
:= Val
;
1036 Debug_Flag_M
:= Val
;
1038 Debug_Flag_N
:= Val
;
1040 Debug_Flag_O
:= Val
;
1042 Debug_Flag_P
:= Val
;
1044 Debug_Flag_Q
:= Val
;
1046 Debug_Flag_R
:= Val
;
1048 Debug_Flag_S
:= Val
;
1050 Debug_Flag_T
:= Val
;
1052 Debug_Flag_U
:= Val
;
1054 Debug_Flag_V
:= Val
;
1056 Debug_Flag_W
:= Val
;
1058 Debug_Flag_X
:= Val
;
1060 Debug_Flag_Y
:= Val
;
1062 Debug_Flag_Z
:= Val
;
1067 ---------------------------
1068 -- Set_Dotted_Debug_Flag --
1069 ---------------------------
1071 procedure Set_Dotted_Debug_Flag
(C
: Character; Val
: Boolean := True) is
1072 subtype Dig
is Character range '1' .. '9';
1073 subtype LLet
is Character range 'a' .. 'z';
1074 subtype ULet
is Character range 'A' .. 'Z';
1080 Debug_Flag_Dot_1
:= Val
;
1082 Debug_Flag_Dot_2
:= Val
;
1084 Debug_Flag_Dot_3
:= Val
;
1086 Debug_Flag_Dot_4
:= Val
;
1088 Debug_Flag_Dot_5
:= Val
;
1090 Debug_Flag_Dot_6
:= Val
;
1092 Debug_Flag_Dot_7
:= Val
;
1094 Debug_Flag_Dot_8
:= Val
;
1096 Debug_Flag_Dot_9
:= Val
;
1099 elsif C
in ULet
then
1102 Debug_Flag_Dot_AA
:= Val
;
1104 Debug_Flag_Dot_BB
:= Val
;
1106 Debug_Flag_Dot_CC
:= Val
;
1108 Debug_Flag_Dot_DD
:= Val
;
1110 Debug_Flag_Dot_EE
:= Val
;
1112 Debug_Flag_Dot_FF
:= Val
;
1114 Debug_Flag_Dot_GG
:= Val
;
1116 Debug_Flag_Dot_HH
:= Val
;
1118 Debug_Flag_Dot_II
:= Val
;
1120 Debug_Flag_Dot_JJ
:= Val
;
1122 Debug_Flag_Dot_KK
:= Val
;
1124 Debug_Flag_Dot_LL
:= Val
;
1126 Debug_Flag_Dot_MM
:= Val
;
1128 Debug_Flag_Dot_NN
:= Val
;
1130 Debug_Flag_Dot_OO
:= Val
;
1132 Debug_Flag_Dot_PP
:= Val
;
1134 Debug_Flag_Dot_QQ
:= Val
;
1136 Debug_Flag_Dot_RR
:= Val
;
1138 Debug_Flag_Dot_SS
:= Val
;
1140 Debug_Flag_Dot_TT
:= Val
;
1142 Debug_Flag_Dot_UU
:= Val
;
1144 Debug_Flag_Dot_VV
:= Val
;
1146 Debug_Flag_Dot_WW
:= Val
;
1148 Debug_Flag_Dot_XX
:= Val
;
1150 Debug_Flag_Dot_YY
:= Val
;
1152 Debug_Flag_Dot_ZZ
:= Val
;
1158 Debug_Flag_Dot_A
:= Val
;
1160 Debug_Flag_Dot_B
:= Val
;
1162 Debug_Flag_Dot_C
:= Val
;
1164 Debug_Flag_Dot_D
:= Val
;
1166 Debug_Flag_Dot_E
:= Val
;
1168 Debug_Flag_Dot_F
:= Val
;
1170 Debug_Flag_Dot_G
:= Val
;
1172 Debug_Flag_Dot_H
:= Val
;
1174 Debug_Flag_Dot_I
:= Val
;
1176 Debug_Flag_Dot_J
:= Val
;
1178 Debug_Flag_Dot_K
:= Val
;
1180 Debug_Flag_Dot_L
:= Val
;
1182 Debug_Flag_Dot_M
:= Val
;
1184 Debug_Flag_Dot_N
:= Val
;
1186 Debug_Flag_Dot_O
:= Val
;
1188 Debug_Flag_Dot_P
:= Val
;
1190 Debug_Flag_Dot_Q
:= Val
;
1192 Debug_Flag_Dot_R
:= Val
;
1194 Debug_Flag_Dot_S
:= Val
;
1196 Debug_Flag_Dot_T
:= Val
;
1198 Debug_Flag_Dot_U
:= Val
;
1200 Debug_Flag_Dot_V
:= Val
;
1202 Debug_Flag_Dot_W
:= Val
;
1204 Debug_Flag_Dot_X
:= Val
;
1206 Debug_Flag_Dot_Y
:= Val
;
1208 Debug_Flag_Dot_Z
:= Val
;
1211 end Set_Dotted_Debug_Flag
;