2009-07-22 17:35:52 +02:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
-- --
|
|
|
|
-- GNAT COMPILER COMPONENTS --
|
|
|
|
-- --
|
|
|
|
-- S C O S --
|
|
|
|
-- --
|
|
|
|
-- S p e c --
|
|
|
|
-- --
|
[multiple changes]
2015-11-12 Bob Duff <duff@adacore.com>
* impunit.adb, lib-xref.ads, restrict.ads, scos.ads, sem_attr.ads,
types.ads: Get rid of some global variables.
* output.adb, output.ads: Move some global variables to the body.
2015-11-12 Yannick Moy <moy@adacore.com>
* lib-xref-spark_specific.adb
(Is_Constant_Object_Without_Variable_Input): Add special case
for imported constants.
2015-11-12 Philippe Gil <gil@adacore.com>
* g-debpoo.adb (Allocate): Avoid having allocations not handled.
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Apply_Scalar_Range_Check): If the expression is
a real literal and the context type has static bounds, remove
range check when possible.
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Collect_Primitive_Operations): If the type is
derived from a type declared elsewhere that has an incomplete
type declaration, the primitives are found in the scope of the
type nat that of its ancestor.
2015-11-12 Arnaud Charlet <charlet@adacore.com>
* switch-c.adb, debug.adb, osint-c.adb, gnat1drv.adb: Remove -gnatd.V
debug switch.
* exp_aggr.adb, exp_util.adb: Fix typos.
2015-11-12 Jerome Lambourg <lambourg@adacore.com>
* init.c: Properly adjust PC values in case of signals.
2015-11-12 Bob Duff <duff@adacore.com>
* sem_prag.adb (Check_Arg_Is_Library_Level_Local_Name): A
pragma that comes from an aspect does not "come from source",
so we need to test whether it comes from an aspect.
From-SVN: r230253
2015-11-12 14:25:40 +01:00
|
|
|
-- Copyright (C) 2009-2015, Free Software Foundation, Inc. --
|
2009-07-22 17:35:52 +02:00
|
|
|
-- --
|
|
|
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
|
|
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
|
|
|
-- ware Foundation; either version 3, or (at your option) any later ver- --
|
|
|
|
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
|
|
|
|
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
|
|
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
|
|
|
|
-- for more details. You should have received a copy of the GNU General --
|
|
|
|
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
|
|
|
|
-- http://www.gnu.org/licenses for a complete copy of the license. --
|
|
|
|
-- --
|
|
|
|
-- GNAT was originally developed by the GNAT team at New York University. --
|
|
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
|
|
|
-- --
|
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-- This package defines tables used to store Source Coverage Obligations. It
|
|
|
|
-- is used by Par_SCO to build the SCO information before writing it out to
|
|
|
|
-- the ALI file, and by Get_SCO/Put_SCO to read and write the text form that
|
|
|
|
-- is used in the ALI file.
|
|
|
|
|
2012-12-05 12:15:35 +01:00
|
|
|
with Namet; use Namet;
|
|
|
|
with Types; use Types;
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
with GNAT.Table;
|
|
|
|
|
|
|
|
package SCOs is
|
|
|
|
|
|
|
|
-- SCO information can exist in one of two forms. In the ALI file, it is
|
|
|
|
-- represented using a text format that is described in this specification.
|
|
|
|
-- Internally it is stored using two tables SCO_Table and SCO_Unit_Table,
|
|
|
|
-- which are also defined in this unit.
|
|
|
|
|
|
|
|
-- Par_SCO is part of the compiler. It scans the parsed source tree and
|
|
|
|
-- populates the internal tables.
|
|
|
|
|
|
|
|
-- Get_SCO reads the text lines in ALI format and populates the internal
|
|
|
|
-- tables with corresponding information.
|
|
|
|
|
|
|
|
-- Put_SCO reads the internal tables and generates text lines in the ALI
|
|
|
|
-- format.
|
|
|
|
|
[multiple changes]
2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb (Build_Discrete_Static_Predicate): New name
for Build_Static_Predicate (Build_Predicate_Functions):
Don't try to build discrete predicate for real type.
(Build_Predicate_Functions): Report attempt to use
Static_Predicate function on real type as unimplemented.
* sem_util.adb (Check_Expression_Against_Static_Predicate):
Add guard to prevent blow up on predicate for real type.
2014-07-18 Ed Schonberg <schonberg@adacore.com>
* einfo.adb (Set_Static_Predicate): Simplify assertion to handle
properly static predicate on enumeration types and modular types
(not subtypes).
2014-07-18 Pierre-Marie Derodat <derodat@adacore.com>
* scos.ads (SCO_Unit_Table_Entry): Add a field to keep track of
the corresponding source file index.
* get_scos.ads (Get_SCOs): Add a default value for it.
* par_sco.adb (SCO_Record): Fill the corresponding value.
* scos.h: New.
2014-07-18 Vincent Celier <celier@adacore.com>
* a-strunb-shared.adb, s-auxdec.ads, s-rannum.adb, atree.ads,
urealp.adb, vms_data.ads, lib.ads, s-auxdec-vms_64.ads: Minor
reformatting.
* gnat_ugn.texi: Add documentation for new gnatmem switch -t.
2014-07-18 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads (Set): document possible data loss.
2014-07-18 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference, cases Input,
Output, Read, Write): If the restriction No_Streams is active,
replace each occurrence of a stream attribute by an explicit
Raise statement.
From-SVN: r212782
2014-07-18 11:20:28 +02:00
|
|
|
-- WARNING: There are C bindings for this package. Any changes to this
|
|
|
|
-- source file must be properly reflected in the C header file scos.h
|
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
--------------------
|
|
|
|
-- SCO ALI Format --
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
-- Source coverage obligations are generated on a unit-by-unit basis in the
|
|
|
|
-- ALI file, using lines that start with the identifying character C. These
|
2009-11-30 14:52:35 +01:00
|
|
|
-- lines are generated if the -gnateS switch is set.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
-- Sloc Ranges
|
|
|
|
|
|
|
|
-- In several places in the SCO lines, Sloc ranges appear. These are used
|
|
|
|
-- to indicate the first and last Sloc of some construct in the tree and
|
|
|
|
-- they have the form:
|
|
|
|
|
|
|
|
-- line:col-line:col
|
|
|
|
|
|
|
|
-- Note that SCO's are generated only for generic templates, not for
|
|
|
|
-- generic instances (since only the first are part of the source). So
|
|
|
|
-- we don't need generic instantiation stuff in these line:col items.
|
|
|
|
|
|
|
|
-- SCO File headers
|
|
|
|
|
|
|
|
-- The SCO information follows the cross-reference information, so it
|
|
|
|
-- need not be read by tools like gnatbind, gnatmake etc. The SCO output
|
|
|
|
-- is divided into sections, one section for each unit for which SCO's
|
|
|
|
-- are generated. A SCO section has a header of the form:
|
|
|
|
|
2009-11-30 14:52:35 +01:00
|
|
|
-- C dependency-number filename
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
-- This header precedes SCO information for the unit identified by
|
|
|
|
-- dependency number and file name. The dependency number is the
|
|
|
|
-- index into the generated D lines and is ones origin (i.e. 2 =
|
|
|
|
-- reference to second generated D line).
|
|
|
|
|
|
|
|
-- Note that the filename here will reflect the original name if
|
|
|
|
-- a Source_Reference pragma was encountered (since all line number
|
|
|
|
-- references will be with respect to the original file).
|
|
|
|
|
2009-07-23 14:41:47 +02:00
|
|
|
-- Note: the filename is redundant in that it could be deduced from
|
|
|
|
-- the corresponding D line, but it is convenient at least for human
|
|
|
|
-- reading of the SCO information, and means that the SCO information
|
|
|
|
-- can stand on its own without needing other parts of the ALI file.
|
2009-07-23 12:03:21 +02:00
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
-- Statements
|
|
|
|
|
|
|
|
-- For the purpose of SCO generation, the notion of statement includes
|
|
|
|
-- simple statements and also the following declaration types:
|
|
|
|
|
|
|
|
-- type_declaration
|
|
|
|
-- subtype_declaration
|
|
|
|
-- object_declaration
|
|
|
|
-- renaming_declaration
|
|
|
|
-- generic_instantiation
|
|
|
|
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- and the following regions of the syntax tree:
|
|
|
|
|
|
|
|
-- the part of a case_statement from CASE up to the expression
|
2010-01-26 14:29:46 +01:00
|
|
|
-- the part of a FOR loop iteration scheme from FOR up to the
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- loop_parameter_specification
|
2010-01-26 14:29:46 +01:00
|
|
|
-- the part of a WHILE loop up to the condition
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- the part of an extended_return_statement from RETURN up to the
|
|
|
|
-- expression (if present) or to the return_subtype_indication (if
|
|
|
|
-- no expression)
|
|
|
|
|
2010-01-25 15:21:16 +01:00
|
|
|
-- and any pragma that occurs at a place where a statement or declaration
|
|
|
|
-- is allowed.
|
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
-- Statement lines
|
|
|
|
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- These lines correspond to one or more successive statements (in the
|
|
|
|
-- sense of the above list) which are always executed in sequence (in the
|
|
|
|
-- absence of exceptions or other external interruptions).
|
2009-07-22 17:35:52 +02:00
|
|
|
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- Entry points to such sequences are:
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2010-01-25 15:21:16 +01:00
|
|
|
-- the first declaration of any declarative_part
|
|
|
|
-- the first statement of any sequence_of_statements that is not in a
|
|
|
|
-- body or block statement that has a non-empty declarative part
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- the first statement after a compound statement
|
|
|
|
-- the first statement after an EXIT, RAISE or GOTO statement
|
2010-01-26 11:55:29 +01:00
|
|
|
-- any statement with a label (the label itself is not part of the
|
|
|
|
-- entry point that is recorded).
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2011-12-05 11:31:58 +01:00
|
|
|
-- Each entry point must appear as the first statement entry on a CS
|
|
|
|
-- line. Thus, if any simple statement on a CS line is known to have
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- been executed, then all statements that appear before it on the same
|
|
|
|
-- CS line are certain to also have been executed.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- The form of a statement line in the ALI file is:
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2011-12-05 11:31:58 +01:00
|
|
|
-- CS [dominance] *sloc-range [*sloc-range...]
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
|
|
|
|
-- where each sloc-range corresponds to a single statement, and * is
|
|
|
|
-- one of:
|
|
|
|
|
2011-08-29 10:49:48 +02:00
|
|
|
-- t type declaration
|
|
|
|
-- s subtype declaration
|
|
|
|
-- o object declaration
|
|
|
|
-- r renaming declaration
|
|
|
|
-- i generic instantiation
|
2012-07-12 12:49:10 +02:00
|
|
|
-- A ACCEPT statement (from ACCEPT to end of parameter profile)
|
|
|
|
-- C CASE statement (from CASE to end of expression)
|
2011-08-29 10:49:48 +02:00
|
|
|
-- E EXIT statement
|
2012-07-12 12:49:10 +02:00
|
|
|
-- F FOR loop (from FOR to end of iteration scheme)
|
|
|
|
-- I IF statement (from IF to end of condition)
|
2011-08-29 10:49:48 +02:00
|
|
|
-- P[name:] PRAGMA with the indicated name
|
2012-01-23 10:39:27 +01:00
|
|
|
-- p[name:] disabled PRAGMA with the indicated name
|
2011-08-29 10:49:48 +02:00
|
|
|
-- R extended RETURN statement
|
2012-07-12 12:49:10 +02:00
|
|
|
-- S SELECT statement
|
|
|
|
-- W WHILE loop statement (from WHILE to end of condition)
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
|
|
|
|
-- Note: for I and W, condition above is in the RM syntax sense (this
|
|
|
|
-- condition is a decision in SCO terminology).
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2010-09-10 17:08:53 +02:00
|
|
|
-- and is omitted for all other cases
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
|
2011-12-05 11:31:58 +01:00
|
|
|
-- The optional dominance marker is of the form gives additional
|
|
|
|
-- information as to how the sequence of statements denoted by the CS
|
|
|
|
-- line can be entered:
|
|
|
|
|
|
|
|
-- >F<sloc>
|
|
|
|
-- sequence is entered only if the decision at <sloc> is False
|
|
|
|
-- >T<sloc>
|
|
|
|
-- sequence is entered only if the decision at <sloc> is True
|
|
|
|
|
|
|
|
-- >S<sloc>
|
|
|
|
-- sequence is entered only if the statement at <sloc> has been
|
|
|
|
-- executed
|
|
|
|
|
|
|
|
-- >E<sloc-range>
|
|
|
|
-- sequence is the sequence of statements for a exception_handler
|
|
|
|
-- with the given sloc range
|
|
|
|
|
[multiple changes]
2010-06-18 Thomas Quinot <quinot@adacore.com>
* types.ads: Clean up obsolete comments
* tbuild.adb: Minor reformatting.
* exp_ch5.adb, sem_intr.adb, sem_ch10.adb, rtsfind.adb, s-shasto.adb,
exp_strm.adb, aa_drive.adb: Minor reformatting.
* sem_res.adb (Is_Predefined_Operator): An operator that is an imported
intrinsic with an Interface_Name denotes an imported back-end builtin,
and must be rewritten into a call, not left in the tree as an operator,
so return False in that case.
2010-06-18 Eric Botcazou <ebotcazou@adacore.com>
* exp_util.adb (Remove_Side_Effects): Make a copy for an allocator.
2010-06-18 Robert Dewar <dewar@adacore.com>
* scos.ads: Add proposed output for case expression
2010-06-18 Jose Ruiz <ruiz@adacore.com>
* gnat_ugn.texi: Document that, when using the RTX compiler to generate
RTSS modules, we need to use the Microsoft linker.
From-SVN: r160974
2010-06-18 11:53:00 +02:00
|
|
|
-- Note: up to 6 entries can appear on a single CS line. If more than 6
|
|
|
|
-- entries appear in one logical statement sequence, continuation lines
|
|
|
|
-- are marked by Cs and appear immediately after the CS line.
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
|
2011-08-02 12:06:14 +02:00
|
|
|
-- Implementation permission: a SCO generator is permitted to emit a
|
|
|
|
-- narrower SLOC range for a statement if the corresponding code
|
|
|
|
-- generation circuitry ensures that all debug information for the code
|
|
|
|
-- implementing the statement will be labeled with SLOCs that fall within
|
|
|
|
-- that narrower range.
|
|
|
|
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- Decisions
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2010-01-25 15:21:16 +01:00
|
|
|
-- Note: in the following description, logical operator includes only the
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- short-circuited forms and NOT (so can be only NOT, AND THEN, OR ELSE).
|
2010-01-26 11:02:11 +01:00
|
|
|
-- The reason that we can exclude AND/OR/XOR is that we expect SCO's to
|
2010-01-26 11:13:33 +01:00
|
|
|
-- be generated using the restriction No_Direct_Boolean_Operators if we
|
|
|
|
-- are interested in decision coverage, which does not permit the use of
|
|
|
|
-- AND/OR/XOR on boolean operands. These are permitted on modular integer
|
|
|
|
-- types, but such operations do not count as decisions in any case. If
|
|
|
|
-- we are generating SCO's only for simple coverage, then we are not
|
|
|
|
-- interested in decisions in any case.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- Note: the reason we include NOT is for informational purposes. The
|
|
|
|
-- presence of NOT does not generate additional coverage obligations,
|
|
|
|
-- but if we know where the NOT's are, the coverage tool can generate
|
|
|
|
-- more accurate diagnostics on uncovered tests.
|
|
|
|
|
|
|
|
-- A top level boolean expression is a boolean expression that is not an
|
|
|
|
-- operand of a logical operator.
|
|
|
|
|
|
|
|
-- Decisions are either simple or complex. A simple decision is a top
|
Fix typos in gcc/ada.
gcc/ada/:
* projects.texi: Fix typos.
* gnat_rm.texi: Likewise.
* gnat_ugn.texi: Likewise.
* sem_util.adb: Fix typo in variable, typos in comments.
* a-btgbso.adb: Fix typos in comments.
* a-cbdlli.adb, a-cbhase.ads, a-cdlili.adb, a-cobove.adb,
a-coinve.adb, a-convec.adb, a-direct.ads, a-strunb-shared.adb,
a-strunb-shared.ads, a-stuten.ads, a-stwiun-shared.adb,
a-stwiun-shared.ads, a-stzunb-shared.adb, a-stzunb-shared.ads,
a-suenco.adb, a-suenst.adb, a-suewst.adb, a-suezst.adb, ali.ads,
aspects.ads, atree.ads, binde.adb, bindgen.adb, checks.adb,
checks.ads, einfo.ads, err_vars.ads, errout.adb, errout.ads,
exp_aggr.adb, exp_attr.adb, exp_cg.adb, exp_ch3.adb,
exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb,
exp_dbug.ads, exp_disp.adb, exp_fixd.ads, freeze.adb,
g-altive.ads, g-comlin.ads, g-excact.ads, g-mbdira.adb,
g-sechas.ads, g-sehash.ads, g-sha1.ads, g-sha224.ads,
g-sha256.ads, g-sha384.ads, g-sha512.ads, g-shsh32.ads,
g-shsh64.ads, g-socket.adb, g-socket.ads, g-sothco.ads,
gcc-interface/decl.c, gcc-interface/trans.c,
gcc-interface/utils2.c, gnat1drv.adb, init.c, inline.adb,
link.c, locales.c, make.adb, mingw32.h, namet.ads, osint.adb,
par-ch12.adb, par-ch13.adb, par-ch3.adb, par-ch4.adb,
par-prag.adb, par.adb, par_sco.adb, prepcomp.adb,
prj-conf.ads, prj-dect.adb, prj-env.adb, prj-env.ads,
prj-nmsc.adb, prj-tree.ads, prj-util.ads, prj.adb, prj.ads,
s-auxdec-vms-alpha.adb, s-auxdec-vms_64.ads, s-oscons-tmplt.c,
s-osinte-vxworks.ads, s-osprim-mingw.adb, s-regexp.adb,
s-stusta.adb, s-taprop-mingw.adb, s-taprop-solaris.adb,
scn.adb, scos.ads, sem.adb, sem_aggr.adb, sem_attr.adb,
sem_aux.adb, sem_aux.ads, sem_ch12.adb, sem_ch12.ads,
sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch4.adb,
sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_disp.adb,
sem_disp.ads, sem_eval.adb, sem_intr.adb, sem_prag.adb,
sem_res.adb, sem_scil.adb, sem_util.ads, sem_warn.adb,
sem_warn.ads, sinfo.ads, socket.c, styleg.adb, switch.ads,
sysdep.c, tb-alvxw.c, xoscons.adb: Likewise.
From-SVN: r168082
2010-12-20 08:26:57 +01:00
|
|
|
-- level boolean expression that has only one condition and that occurs
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- in the context of a control structure in the source program, including
|
[multiple changes]
2011-08-05 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Set_All_DT_Position): Cleanup code and improve support
for renamings of predefined primitives.
(In_Predef_Prims_DT): New subprogram.
2011-08-05 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb, sem_util.ads (Check_Implicit_Dereference): If a
possible interpretation of name is a reference type, add an
interpretation that is the designated type of the reference
discriminant of that type.
* sem_res.adb (resolve): If the interpretation imposed by context is an
implicit dereference, rewrite the node as the deference of the
reference discriminant.
* sem_ch3.adb (Analyze_Subtype_Declaration, Build_Derived_Record_Type,
Build_Discriminated_Subtype): Inherit Has_Implicit_Dereference from
parent type or base type.
* sem_ch4.adb (Process_Indexed_Component,
Process_Overloaded_Indexed_Component, Indicate_Name_And_Type,
Analyze_Overloaded_Selected_Component, Analyze_Selected_Component):
Check for implicit dereference.
(List_Operand_Interps): Indicate when an implicit dereference is
ambiguous.
* sem_ch8.adb (Find_Direct_Name): Check for implicit dereference.
2011-08-05 Thomas Quinot <quinot@adacore.com>
* scos.ads: Update documentation of SCO table. Pragma statements can now
be marked as disabled (using 'p' instead of 'P' as the statement kind).
* par_sco.ads, par_sco.adb: Implement the above change.
(Process_Decisions_Defer): Generate a P decision for the first parameter
of a dyadic pragma Debug.
* sem_prag.adb (Analyze_Pragma, case Debug): Mark pragma as enabled if
necessary.
* put_scos.adb: Code simplification based on above change.
From-SVN: r177442
2011-08-05 16:18:09 +02:00
|
|
|
-- WHILE, IF, EXIT WHEN, or immediately within an Assert, Check,
|
|
|
|
-- Pre_Condition or Post_Condition pragma, or as the first argument of a
|
|
|
|
-- dyadic pragma Debug. Note that a top level boolean expression with
|
|
|
|
-- only one condition that occurs in any other context, for example as
|
|
|
|
-- right hand side of an assignment, is not considered to be a (simple)
|
|
|
|
-- decision.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- A complex decision is a top level boolean expression that has more
|
|
|
|
-- than one condition. A complex decision may occur in any boolean
|
|
|
|
-- expression context.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
-- So for example, if we have
|
|
|
|
|
|
|
|
-- A, B, C, D : Boolean;
|
|
|
|
-- function F (Arg : Boolean) return Boolean);
|
|
|
|
-- ...
|
|
|
|
-- A and then (B or else F (C and then D))
|
|
|
|
|
|
|
|
-- There are two (complex) decisions here:
|
|
|
|
|
|
|
|
-- 1. X and then (Y or else Z)
|
|
|
|
|
|
|
|
-- where X = A, Y = B, and Z = F (C and then D)
|
|
|
|
|
|
|
|
-- 2. C and then D
|
|
|
|
|
|
|
|
-- For each decision, a decision line is generated with the form:
|
|
|
|
|
[multiple changes]
2012-10-01 Vincent Pucci <pucci@adacore.com>
* s-gearop.adb (Vector_Matrix_Product): Dimensions check fixed. Index
of Left in S evaluation fixed.
2012-10-01 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Avoid
premature freezing caused by the internally generated subprogram
_postconditions.
* checks.adb (Expr_Known_Valid): Float literals are assumed to be valid
in VM targets.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* sinput.ads, sinput.adb, sinput-l.adb sinput-c.adb (Sinput): New
Instances table, tracking all generic instantiations. Source file
attribute Instance replaces previous Instantiation attribute with an
index into the Instances table.
(Iterate_On_Instances): New generic procedure.
(Create_Instantiation_Source): Record instantiations in Instances.
(Tree_Read, Tree_Write): Read/write the instance table.
* scils.ads, scos.adb (SCO_Instance_Table): New table, contains
information copied from Sinput.Instance_Table, but self-contained
within the SCO data structures.
* par_sco.ads, par_sco.adb (To_Source_Location): Move to library level.
(Record_Instance): New subprogram, used by...
(Populate_SCO_Instance_Table): New subprogram to fill
the SCO instance table from the Sinput one (called by SCO_Output).
* opt.ads (Generate_SCO_Instance_Table): New option.
* put_scos.adb (Write_Instance_Table): New subprogram, used by...
(Put_SCOs): Dump the instance table at the end of SCO information
if requested.
* get_scos.adb (Get_SCOs): Read SCO_Instance_Table.
* types.h: Add declaration for Instance_Id.
* back_end.adb (Call_Back_End): Pass instance ids in source file
information table.
(Scan_Back_End_Switches): -fdebug-instances sets
Opt.Generate_SCO_Instance_Table.
* gcc-interface/gigi.h: File_Info_Type includes instance id.
* gcc-interface/trans.c: Under -fdebug-instances, set instance
id in line map from same in file info.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* sem_elab.adb: Minor reformatting
(Check_Elab_Call): Minor fix to debugging code
(add special circuit for the valid case where a 'Access attribute
reference is passed to Check_Elab_Call).
2012-10-01 Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb: Minor reformatting.
From-SVN: r191904
2012-10-01 11:21:46 +02:00
|
|
|
-- C* sloc expression
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2012-12-05 12:15:35 +01:00
|
|
|
-- Here * is one of the following:
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2012-12-05 12:15:35 +01:00
|
|
|
-- E decision in EXIT WHEN statement
|
|
|
|
-- G decision in entry guard
|
|
|
|
-- I decision in IF statement or if expression
|
|
|
|
-- P decision in pragma Assert / Check / Pre/Post_Condition
|
|
|
|
-- A[name] decision in aspect Pre/Post (aspect name optional)
|
|
|
|
-- W decision in WHILE iteration scheme
|
|
|
|
-- X decision in some other expression context
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2011-08-29 10:40:53 +02:00
|
|
|
-- For E, G, I, P, W, sloc is the source location of the EXIT, ENTRY, IF,
|
|
|
|
-- PRAGMA or WHILE token, respectively
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
|
2012-12-05 12:15:35 +01:00
|
|
|
-- For A sloc is the source location of the aspect identifier
|
|
|
|
|
2010-09-10 17:08:53 +02:00
|
|
|
-- For X, sloc is omitted
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
-- The expression is a prefix polish form indicating the structure of
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- the decision, including logical operators and short-circuit forms.
|
2009-07-22 17:35:52 +02:00
|
|
|
-- The following is a grammar showing the structure of expression:
|
|
|
|
|
|
|
|
-- expression ::= term (if expr is not logical operator)
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- expression ::= &sloc term term (if expr is AND or AND THEN)
|
|
|
|
-- expression ::= |sloc term term (if expr is OR or OR ELSE)
|
|
|
|
-- expression ::= !sloc term (if expr is NOT)
|
|
|
|
|
2010-10-25 15:50:29 +02:00
|
|
|
-- In the last three cases, sloc is the source location of the AND, OR,
|
2010-01-26 11:02:11 +01:00
|
|
|
-- or NOT token, respectively.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
-- term ::= element
|
|
|
|
-- term ::= expression
|
|
|
|
|
2011-08-02 12:06:14 +02:00
|
|
|
-- element ::= *sloc-range
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2011-08-02 12:06:14 +02:00
|
|
|
-- where * is one of the following letters:
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
-- c condition
|
|
|
|
-- t true condition
|
|
|
|
-- f false condition
|
|
|
|
|
2011-08-02 12:06:14 +02:00
|
|
|
-- t/f are used to mark a condition that has been recognized by the
|
|
|
|
-- compiler as always being true or false. c is the normal case of
|
|
|
|
-- conditions whose value is not known at compile time.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2010-09-10 17:08:53 +02:00
|
|
|
-- & indicates AND THEN connecting two conditions
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2010-09-10 17:08:53 +02:00
|
|
|
-- | indicates OR ELSE connecting two conditions
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2010-09-10 17:08:53 +02:00
|
|
|
-- ! indicates NOT applied to the expression
|
2009-07-22 17:35:52 +02:00
|
|
|
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- Note that complex decisions do NOT include non-short-circuited logical
|
|
|
|
-- operators (AND/XOR/OR). In the context of existing coverage tools the
|
|
|
|
-- No_Direct_Boolean_Operators restriction is assumed, so these operators
|
|
|
|
-- cannot appear in the source in any case.
|
|
|
|
|
|
|
|
-- The SCO line for a decision always occurs after the CS line for the
|
|
|
|
-- enclosing statement. The SCO line for a nested decision always occurs
|
|
|
|
-- after the line for the enclosing decision.
|
2010-01-25 15:21:16 +01:00
|
|
|
|
2010-06-22 14:42:24 +02:00
|
|
|
-- Note that membership tests are considered to be a single simple
|
|
|
|
-- condition, and that is true even if the Ada 2005 set membership
|
|
|
|
-- form is used, e.g. A in (2,7,11.15).
|
|
|
|
|
2011-08-02 12:06:14 +02:00
|
|
|
-- Implementation permission: a SCO generator is permitted to emit a
|
|
|
|
-- narrower SLOC range for a condition if the corresponding code
|
|
|
|
-- generation circuitry ensures that all debug information for the code
|
|
|
|
-- evaluating the condition will be labeled with SLOCs that fall within
|
|
|
|
-- that narrower range.
|
|
|
|
|
[multiple changes]
2010-06-18 Thomas Quinot <quinot@adacore.com>
* types.ads: Clean up obsolete comments
* tbuild.adb: Minor reformatting.
* exp_ch5.adb, sem_intr.adb, sem_ch10.adb, rtsfind.adb, s-shasto.adb,
exp_strm.adb, aa_drive.adb: Minor reformatting.
* sem_res.adb (Is_Predefined_Operator): An operator that is an imported
intrinsic with an Interface_Name denotes an imported back-end builtin,
and must be rewritten into a call, not left in the tree as an operator,
so return False in that case.
2010-06-18 Eric Botcazou <ebotcazou@adacore.com>
* exp_util.adb (Remove_Side_Effects): Make a copy for an allocator.
2010-06-18 Robert Dewar <dewar@adacore.com>
* scos.ads: Add proposed output for case expression
2010-06-18 Jose Ruiz <ruiz@adacore.com>
* gnat_ugn.texi: Document that, when using the RTX compiler to generate
RTSS modules, we need to use the Microsoft linker.
From-SVN: r160974
2010-06-18 11:53:00 +02:00
|
|
|
-- Case Expressions
|
|
|
|
|
|
|
|
-- For case statements, we rely on statement coverage to make sure that
|
|
|
|
-- all branches of a case statement are covered, but that does not work
|
|
|
|
-- for case expressions, since the entire expression is contained in a
|
|
|
|
-- single statement. However, for complete coverage we really should be
|
|
|
|
-- able to check that every branch of the case statement is covered, so
|
|
|
|
-- we generate a SCO of the form:
|
|
|
|
|
|
|
|
-- CC sloc-range sloc-range ...
|
|
|
|
|
2010-09-10 17:08:53 +02:00
|
|
|
-- where sloc-range covers the range of the case expression
|
[multiple changes]
2010-06-18 Thomas Quinot <quinot@adacore.com>
* types.ads: Clean up obsolete comments
* tbuild.adb: Minor reformatting.
* exp_ch5.adb, sem_intr.adb, sem_ch10.adb, rtsfind.adb, s-shasto.adb,
exp_strm.adb, aa_drive.adb: Minor reformatting.
* sem_res.adb (Is_Predefined_Operator): An operator that is an imported
intrinsic with an Interface_Name denotes an imported back-end builtin,
and must be rewritten into a call, not left in the tree as an operator,
so return False in that case.
2010-06-18 Eric Botcazou <ebotcazou@adacore.com>
* exp_util.adb (Remove_Side_Effects): Make a copy for an allocator.
2010-06-18 Robert Dewar <dewar@adacore.com>
* scos.ads: Add proposed output for case expression
2010-06-18 Jose Ruiz <ruiz@adacore.com>
* gnat_ugn.texi: Document that, when using the RTX compiler to generate
RTSS modules, we need to use the Microsoft linker.
From-SVN: r160974
2010-06-18 11:53:00 +02:00
|
|
|
|
|
|
|
-- Note: up to 6 entries can appear on a single CC line. If more than 6
|
|
|
|
-- entries appear in one logical statement sequence, continuation lines
|
|
|
|
-- are marked by Cc and appear immediately after the CC line.
|
|
|
|
|
[multiple changes]
2012-10-01 Vincent Pucci <pucci@adacore.com>
* s-gearop.adb (Vector_Matrix_Product): Dimensions check fixed. Index
of Left in S evaluation fixed.
2012-10-01 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Avoid
premature freezing caused by the internally generated subprogram
_postconditions.
* checks.adb (Expr_Known_Valid): Float literals are assumed to be valid
in VM targets.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* sinput.ads, sinput.adb, sinput-l.adb sinput-c.adb (Sinput): New
Instances table, tracking all generic instantiations. Source file
attribute Instance replaces previous Instantiation attribute with an
index into the Instances table.
(Iterate_On_Instances): New generic procedure.
(Create_Instantiation_Source): Record instantiations in Instances.
(Tree_Read, Tree_Write): Read/write the instance table.
* scils.ads, scos.adb (SCO_Instance_Table): New table, contains
information copied from Sinput.Instance_Table, but self-contained
within the SCO data structures.
* par_sco.ads, par_sco.adb (To_Source_Location): Move to library level.
(Record_Instance): New subprogram, used by...
(Populate_SCO_Instance_Table): New subprogram to fill
the SCO instance table from the Sinput one (called by SCO_Output).
* opt.ads (Generate_SCO_Instance_Table): New option.
* put_scos.adb (Write_Instance_Table): New subprogram, used by...
(Put_SCOs): Dump the instance table at the end of SCO information
if requested.
* get_scos.adb (Get_SCOs): Read SCO_Instance_Table.
* types.h: Add declaration for Instance_Id.
* back_end.adb (Call_Back_End): Pass instance ids in source file
information table.
(Scan_Back_End_Switches): -fdebug-instances sets
Opt.Generate_SCO_Instance_Table.
* gcc-interface/gigi.h: File_Info_Type includes instance id.
* gcc-interface/trans.c: Under -fdebug-instances, set instance
id in line map from same in file info.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* sem_elab.adb: Minor reformatting
(Check_Elab_Call): Minor fix to debugging code
(add special circuit for the valid case where a 'Access attribute
reference is passed to Check_Elab_Call).
2012-10-01 Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb: Minor reformatting.
From-SVN: r191904
2012-10-01 11:21:46 +02:00
|
|
|
-- Generic instances
|
|
|
|
|
|
|
|
-- A table of all generic instantiations in the compilation is generated
|
|
|
|
-- whose entries have the form:
|
|
|
|
|
|
|
|
-- C i index dependency-number|sloc [enclosing]
|
|
|
|
|
|
|
|
-- Where index is the 1-based index of the entry in the table,
|
|
|
|
-- dependency-number and sloc indicate the source location of the
|
|
|
|
-- instantiation, and enclosing is the index of the enclosing
|
|
|
|
-- instantiation in the table (for a nested instantiation), or is
|
|
|
|
-- omitted for an outer instantiation.
|
|
|
|
|
[multiple changes]
2011-08-05 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Set_All_DT_Position): Cleanup code and improve support
for renamings of predefined primitives.
(In_Predef_Prims_DT): New subprogram.
2011-08-05 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb, sem_util.ads (Check_Implicit_Dereference): If a
possible interpretation of name is a reference type, add an
interpretation that is the designated type of the reference
discriminant of that type.
* sem_res.adb (resolve): If the interpretation imposed by context is an
implicit dereference, rewrite the node as the deference of the
reference discriminant.
* sem_ch3.adb (Analyze_Subtype_Declaration, Build_Derived_Record_Type,
Build_Discriminated_Subtype): Inherit Has_Implicit_Dereference from
parent type or base type.
* sem_ch4.adb (Process_Indexed_Component,
Process_Overloaded_Indexed_Component, Indicate_Name_And_Type,
Analyze_Overloaded_Selected_Component, Analyze_Selected_Component):
Check for implicit dereference.
(List_Operand_Interps): Indicate when an implicit dereference is
ambiguous.
* sem_ch8.adb (Find_Direct_Name): Check for implicit dereference.
2011-08-05 Thomas Quinot <quinot@adacore.com>
* scos.ads: Update documentation of SCO table. Pragma statements can now
be marked as disabled (using 'p' instead of 'P' as the statement kind).
* par_sco.ads, par_sco.adb: Implement the above change.
(Process_Decisions_Defer): Generate a P decision for the first parameter
of a dyadic pragma Debug.
* sem_prag.adb (Analyze_Pragma, case Debug): Mark pragma as enabled if
necessary.
* put_scos.adb: Code simplification based on above change.
From-SVN: r177442
2011-08-05 16:18:09 +02:00
|
|
|
-- Disabled pragmas
|
|
|
|
|
par_sco.adb, [...]: Minor reformatting.
2011-08-05 Robert Dewar <dewar@adacore.com>
* par_sco.adb, sem_ch3.adb, scos.ads, a-iteint.ads, sem_ch12.adb,
a-cimutr.adb, a-cimutr.ads, sem_util.ads, sem_res.adb, a-fihema.adb,
sem_ch4.adb, lib-xref-alfa.adb, exp_disp.adb, a-comutr.adb,
a-comutr.ads, lib-xref.adb: Minor reformatting.
2011-08-05 Robert Dewar <dewar@adacore.com>
* sem_ch11.adb (Analyze_Raise_Statement): Kill assignment to formal
warning if there is an exception handler present.
From-SVN: r177451
2011-08-05 17:10:50 +02:00
|
|
|
-- No SCO is generated for disabled pragmas
|
[multiple changes]
2011-08-05 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Set_All_DT_Position): Cleanup code and improve support
for renamings of predefined primitives.
(In_Predef_Prims_DT): New subprogram.
2011-08-05 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb, sem_util.ads (Check_Implicit_Dereference): If a
possible interpretation of name is a reference type, add an
interpretation that is the designated type of the reference
discriminant of that type.
* sem_res.adb (resolve): If the interpretation imposed by context is an
implicit dereference, rewrite the node as the deference of the
reference discriminant.
* sem_ch3.adb (Analyze_Subtype_Declaration, Build_Derived_Record_Type,
Build_Discriminated_Subtype): Inherit Has_Implicit_Dereference from
parent type or base type.
* sem_ch4.adb (Process_Indexed_Component,
Process_Overloaded_Indexed_Component, Indicate_Name_And_Type,
Analyze_Overloaded_Selected_Component, Analyze_Selected_Component):
Check for implicit dereference.
(List_Operand_Interps): Indicate when an implicit dereference is
ambiguous.
* sem_ch8.adb (Find_Direct_Name): Check for implicit dereference.
2011-08-05 Thomas Quinot <quinot@adacore.com>
* scos.ads: Update documentation of SCO table. Pragma statements can now
be marked as disabled (using 'p' instead of 'P' as the statement kind).
* par_sco.ads, par_sco.adb: Implement the above change.
(Process_Decisions_Defer): Generate a P decision for the first parameter
of a dyadic pragma Debug.
* sem_prag.adb (Analyze_Pragma, case Debug): Mark pragma as enabled if
necessary.
* put_scos.adb: Code simplification based on above change.
From-SVN: r177442
2011-08-05 16:18:09 +02:00
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
---------------------------------------------------------------------
|
|
|
|
-- Internal table used to store Source Coverage Obligations (SCOs) --
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
|
|
|
type Source_Location is record
|
|
|
|
Line : Logical_Line_Number;
|
|
|
|
Col : Column_Number;
|
|
|
|
end record;
|
|
|
|
|
[multiple changes]
2015-11-12 Bob Duff <duff@adacore.com>
* impunit.adb, lib-xref.ads, restrict.ads, scos.ads, sem_attr.ads,
types.ads: Get rid of some global variables.
* output.adb, output.ads: Move some global variables to the body.
2015-11-12 Yannick Moy <moy@adacore.com>
* lib-xref-spark_specific.adb
(Is_Constant_Object_Without_Variable_Input): Add special case
for imported constants.
2015-11-12 Philippe Gil <gil@adacore.com>
* g-debpoo.adb (Allocate): Avoid having allocations not handled.
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Apply_Scalar_Range_Check): If the expression is
a real literal and the context type has static bounds, remove
range check when possible.
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Collect_Primitive_Operations): If the type is
derived from a type declared elsewhere that has an incomplete
type declaration, the primitives are found in the scope of the
type nat that of its ancestor.
2015-11-12 Arnaud Charlet <charlet@adacore.com>
* switch-c.adb, debug.adb, osint-c.adb, gnat1drv.adb: Remove -gnatd.V
debug switch.
* exp_aggr.adb, exp_util.adb: Fix typos.
2015-11-12 Jerome Lambourg <lambourg@adacore.com>
* init.c: Properly adjust PC values in case of signals.
2015-11-12 Bob Duff <duff@adacore.com>
* sem_prag.adb (Check_Arg_Is_Library_Level_Local_Name): A
pragma that comes from an aspect does not "come from source",
so we need to test whether it comes from an aspect.
From-SVN: r230253
2015-11-12 14:25:40 +01:00
|
|
|
No_Source_Location : constant Source_Location :=
|
2015-11-13 14:08:51 +01:00
|
|
|
(No_Line_Number, No_Column_Number);
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
type SCO_Table_Entry is record
|
2011-08-29 10:49:48 +02:00
|
|
|
From : Source_Location := No_Source_Location;
|
|
|
|
To : Source_Location := No_Source_Location;
|
|
|
|
C1 : Character := ' ';
|
|
|
|
C2 : Character := ' ';
|
|
|
|
Last : Boolean := False;
|
2011-08-04 11:48:09 +02:00
|
|
|
|
|
|
|
Pragma_Sloc : Source_Ptr := No_Location;
|
2013-10-13 18:21:32 +02:00
|
|
|
-- For the decision SCO of a pragma, or for the decision SCO of any
|
|
|
|
-- expression nested in a pragma Debug/Assert/PPC, location of PRAGMA
|
|
|
|
-- token (used for control of SCO output, value not recorded in ALI
|
|
|
|
-- file). Similarly, for the decision SCO of an aspect, or for the
|
|
|
|
-- decision SCO of any expression nested in an aspect, location of
|
|
|
|
-- aspect identifier token.
|
2011-08-29 10:49:48 +02:00
|
|
|
|
2012-12-05 12:15:35 +01:00
|
|
|
Pragma_Aspect_Name : Name_Id := No_Name;
|
|
|
|
-- For the SCO for a pragma/aspect, gives the pragma/apsect name
|
2009-07-22 17:35:52 +02:00
|
|
|
end record;
|
|
|
|
|
|
|
|
package SCO_Table is new GNAT.Table (
|
|
|
|
Table_Component_Type => SCO_Table_Entry,
|
|
|
|
Table_Index_Type => Nat,
|
|
|
|
Table_Low_Bound => 1,
|
|
|
|
Table_Initial => 500,
|
|
|
|
Table_Increment => 300);
|
|
|
|
|
2012-12-05 12:15:35 +01:00
|
|
|
Is_Decision : constant array (Character) of Boolean :=
|
2013-01-02 10:24:58 +01:00
|
|
|
('E' | 'G' | 'I' | 'P' | 'a' | 'A' | 'W' | 'X' => True,
|
|
|
|
others => False);
|
2012-12-05 12:15:35 +01:00
|
|
|
-- Indicates which C1 values correspond to decisions
|
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
-- The SCO_Table_Entry values appear as follows:
|
|
|
|
|
|
|
|
-- Statements
|
2011-12-05 11:31:58 +01:00
|
|
|
-- C1 = 'S'
|
2010-01-26 14:49:56 +01:00
|
|
|
-- C2 = statement type code to appear on CS line (or ' ' if none)
|
2009-07-22 17:35:52 +02:00
|
|
|
-- From = starting source location
|
|
|
|
-- To = ending source location
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- Last = False for all but the last entry, True for last entry
|
2009-07-22 17:35:52 +02:00
|
|
|
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- Note: successive statements (possibly interspersed with entries of
|
|
|
|
-- other kinds, that are ignored for this purpose), starting with one
|
|
|
|
-- labeled with C1 = 'S', up to and including the first one labeled with
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- Last = True, indicate the sequence to be output for a sequence of
|
|
|
|
-- statements on a single CS line (possibly followed by Cs continuation
|
|
|
|
-- lines).
|
|
|
|
|
2011-08-29 10:40:53 +02:00
|
|
|
-- Note: for a pragma that may be disabled (Debug, Assert, PPC, Check),
|
|
|
|
-- the entry is initially created with C2 = 'p', to mark it as disabled.
|
|
|
|
-- Later on during semantic analysis, if the pragma is enabled,
|
|
|
|
-- Set_SCO_Pragma_Enabled changes C2 to 'P' to cause the entry to be
|
|
|
|
-- emitted in Put_SCOs.
|
|
|
|
|
2011-12-05 11:31:58 +01:00
|
|
|
-- Dominance marker
|
|
|
|
-- C1 = '>'
|
|
|
|
-- C2 = 'F'/'T'/'S'/'E'
|
|
|
|
-- From = Decision/statement sloc ('F'/'T'/'S'),
|
|
|
|
-- handler first sloc ('E')
|
|
|
|
-- To = No_Source_Location ('F'/'T'/'S'), handler last sloc ('E')
|
|
|
|
|
2011-12-12 11:30:49 +01:00
|
|
|
-- Note: A dominance marker is always followed by a statement entry
|
2011-12-05 11:31:58 +01:00
|
|
|
|
2011-08-29 10:40:53 +02:00
|
|
|
-- Decision (EXIT/entry guard/IF/WHILE)
|
|
|
|
-- C1 = 'E'/'G'/'I'/'W' (for EXIT/entry Guard/IF/WHILE)
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- C2 = ' '
|
2011-08-29 10:40:53 +02:00
|
|
|
-- From = EXIT/ENTRY/IF/WHILE token
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- To = No_Source_Location
|
|
|
|
-- Last = unused
|
|
|
|
|
|
|
|
-- Decision (PRAGMA)
|
|
|
|
-- C1 = 'P'
|
[multiple changes]
2011-08-05 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Set_All_DT_Position): Cleanup code and improve support
for renamings of predefined primitives.
(In_Predef_Prims_DT): New subprogram.
2011-08-05 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb, sem_util.ads (Check_Implicit_Dereference): If a
possible interpretation of name is a reference type, add an
interpretation that is the designated type of the reference
discriminant of that type.
* sem_res.adb (resolve): If the interpretation imposed by context is an
implicit dereference, rewrite the node as the deference of the
reference discriminant.
* sem_ch3.adb (Analyze_Subtype_Declaration, Build_Derived_Record_Type,
Build_Discriminated_Subtype): Inherit Has_Implicit_Dereference from
parent type or base type.
* sem_ch4.adb (Process_Indexed_Component,
Process_Overloaded_Indexed_Component, Indicate_Name_And_Type,
Analyze_Overloaded_Selected_Component, Analyze_Selected_Component):
Check for implicit dereference.
(List_Operand_Interps): Indicate when an implicit dereference is
ambiguous.
* sem_ch8.adb (Find_Direct_Name): Check for implicit dereference.
2011-08-05 Thomas Quinot <quinot@adacore.com>
* scos.ads: Update documentation of SCO table. Pragma statements can now
be marked as disabled (using 'p' instead of 'P' as the statement kind).
* par_sco.ads, par_sco.adb: Implement the above change.
(Process_Decisions_Defer): Generate a P decision for the first parameter
of a dyadic pragma Debug.
* sem_prag.adb (Analyze_Pragma, case Debug): Mark pragma as enabled if
necessary.
* put_scos.adb: Code simplification based on above change.
From-SVN: r177442
2011-08-05 16:18:09 +02:00
|
|
|
-- C2 = ' '
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- From = PRAGMA token
|
|
|
|
-- To = No_Source_Location
|
|
|
|
-- Last = unused
|
2009-07-22 17:35:52 +02:00
|
|
|
|
2011-08-29 10:40:53 +02:00
|
|
|
-- Note: when the parse tree is first scanned, we unconditionally build a
|
|
|
|
-- pragma decision entry for any decision in a pragma (here as always in
|
|
|
|
-- SCO contexts, the only pragmas with decisions are Assert, Check,
|
|
|
|
-- dyadic Debug, Precondition and Postcondition). These entries will
|
|
|
|
-- be omitted in output if the pragma is disabled (see comments for
|
2015-01-06 10:30:31 +01:00
|
|
|
-- statement entries): this filtering is achieved during the second pass
|
|
|
|
-- of SCO generation (Par_SCO.SCO_Record_Filtered).
|
2012-12-05 12:15:35 +01:00
|
|
|
|
|
|
|
-- Decision (ASPECT)
|
|
|
|
-- C1 = 'A'
|
|
|
|
-- C2 = ' '
|
|
|
|
-- From = aspect identifier
|
|
|
|
-- To = No_Source_Location
|
|
|
|
-- Last = unused
|
|
|
|
|
|
|
|
-- Note: when the parse tree is first scanned, we unconditionally build a
|
|
|
|
-- pragma decision entry for any decision in an aspect (Pre/Post/
|
|
|
|
-- [Type_]Invariant/[Static_|Dynamic_]Predicate). Entries for disabled
|
|
|
|
-- Pre/Post aspects will be omitted from output.
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
|
|
|
|
-- Decision (Expression)
|
|
|
|
-- C1 = 'X'
|
2009-07-22 17:35:52 +02:00
|
|
|
-- C2 = ' '
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- From = No_Source_Location
|
2009-07-23 12:03:21 +02:00
|
|
|
-- To = No_Source_Location
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- Last = unused
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
-- Operator
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- C1 = '!', '&', '|'
|
2015-01-06 10:30:31 +01:00
|
|
|
-- C2 = ' '/'?'/ (Logical operator/Putative one)
|
2010-01-26 11:02:11 +01:00
|
|
|
-- From = location of NOT/AND/OR token
|
2009-07-23 12:03:21 +02:00
|
|
|
-- To = No_Source_Location
|
2009-07-22 17:35:52 +02:00
|
|
|
-- Last = False
|
|
|
|
|
[multiple changes]
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Clarify use of Is_Private_Primitive.
* sem_ch6.adb (Analyze_Subprogram_Declaration): An operation is a
private primitive operation only if it is declared in the scope of the
private controlling type.
* exp_ch9.adb (Build_Wrapper_Spec): Build wrappers for private
protected operations as well.
2009-12-01 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Disable front-end
optimizations in CodePeer mode, to keep the tree as close to the source
code as possible, and also to avoid inconsistencies between trees when
using different optimization switches.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* scos.ads: Updated specification of source coverage obligation
information.
2009-12-01 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads, g-sercom-mingw.adb, g-sercom-linux.adb,
a-ststio.adb, s-commun.adb, s-commun.ads, g-socket.adb,
g-socket.ads (System.Communications.Last_Index): For the case where no
element has been transferred and Item'First =
Stream_Element_Offset'First, raise CONSTRAINT_ERROR.
2009-12-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Install_Siblings): A private with_clause on some child
unit U in an ancestor of the current unit must be ignored if the
current unit has a regular with_clause on U.
From-SVN: r154868
2009-12-01 10:52:51 +01:00
|
|
|
-- Element (condition)
|
2009-07-22 17:35:52 +02:00
|
|
|
-- C1 = ' '
|
|
|
|
-- C2 = 'c', 't', or 'f' (condition/true/false)
|
|
|
|
-- From = starting source location
|
|
|
|
-- To = ending source location
|
|
|
|
-- Last = False for all but the last entry, True for last entry
|
|
|
|
|
|
|
|
-- Note: the sequence starting with a decision, and continuing with
|
|
|
|
-- operators and elements up to and including the first one labeled with
|
get_scos.adb, [...]: Code clean up, update documentation.
* get_scos.adb, par_sco.adb, par_sco.ads, put_scos.adb, scos.adb,
scos.ads, exp_ch4.adb, sem_warn.adb: Code clean up, update
documentation.
From-SVN: r160849
2010-06-16 18:30:48 +02:00
|
|
|
-- Last = True, indicate the sequence to be output on one decision line.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
----------------
|
|
|
|
-- Unit Table --
|
|
|
|
----------------
|
|
|
|
|
|
|
|
-- This table keeps track of the units and the corresponding starting and
|
|
|
|
-- ending indexes (From, To) in the SCO table. Note that entry zero is
|
2011-08-31 11:18:57 +02:00
|
|
|
-- present but unused, it is for convenience in calling the sort routine.
|
|
|
|
-- Thus the lower bound for real entries is 1.
|
2009-07-22 17:35:52 +02:00
|
|
|
|
|
|
|
type SCO_Unit_Index is new Int;
|
|
|
|
-- Used to index values in this table. Values start at 1 and are assigned
|
|
|
|
-- sequentially as entries are constructed.
|
|
|
|
|
|
|
|
type SCO_Unit_Table_Entry is record
|
|
|
|
File_Name : String_Ptr;
|
|
|
|
-- Pointer to file name in ALI file
|
|
|
|
|
[multiple changes]
2014-07-18 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb (Build_Discrete_Static_Predicate): New name
for Build_Static_Predicate (Build_Predicate_Functions):
Don't try to build discrete predicate for real type.
(Build_Predicate_Functions): Report attempt to use
Static_Predicate function on real type as unimplemented.
* sem_util.adb (Check_Expression_Against_Static_Predicate):
Add guard to prevent blow up on predicate for real type.
2014-07-18 Ed Schonberg <schonberg@adacore.com>
* einfo.adb (Set_Static_Predicate): Simplify assertion to handle
properly static predicate on enumeration types and modular types
(not subtypes).
2014-07-18 Pierre-Marie Derodat <derodat@adacore.com>
* scos.ads (SCO_Unit_Table_Entry): Add a field to keep track of
the corresponding source file index.
* get_scos.ads (Get_SCOs): Add a default value for it.
* par_sco.adb (SCO_Record): Fill the corresponding value.
* scos.h: New.
2014-07-18 Vincent Celier <celier@adacore.com>
* a-strunb-shared.adb, s-auxdec.ads, s-rannum.adb, atree.ads,
urealp.adb, vms_data.ads, lib.ads, s-auxdec-vms_64.ads: Minor
reformatting.
* gnat_ugn.texi: Add documentation for new gnatmem switch -t.
2014-07-18 Thomas Quinot <quinot@adacore.com>
* g-sercom.ads (Set): document possible data loss.
2014-07-18 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference, cases Input,
Output, Read, Write): If the restriction No_Streams is active,
replace each occurrence of a stream attribute by an explicit
Raise statement.
From-SVN: r212782
2014-07-18 11:20:28 +02:00
|
|
|
File_Index : Source_File_Index;
|
|
|
|
-- Index for the source file
|
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
Dep_Num : Nat;
|
|
|
|
-- Dependency number in ALI file
|
|
|
|
|
|
|
|
From : Nat;
|
|
|
|
-- Starting index in SCO_Table of SCO information for this unit
|
|
|
|
|
|
|
|
To : Nat;
|
|
|
|
-- Ending index in SCO_Table of SCO information for this unit
|
2015-01-06 10:30:31 +01:00
|
|
|
|
|
|
|
-- Warning: SCOs generation (in Par_SCO) is done in two passes, which
|
|
|
|
-- communicate through an intermediate table (Par_SCO.SCO_Raw_Table).
|
|
|
|
-- Before the second pass executes, From and To actually reference index
|
|
|
|
-- in the internal table: SCO_Table is empty. Then, at the end of the
|
|
|
|
-- second pass, these indexes are updated in order to reference indexes
|
|
|
|
-- in SCO_Table.
|
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
end record;
|
|
|
|
|
|
|
|
package SCO_Unit_Table is new GNAT.Table (
|
|
|
|
Table_Component_Type => SCO_Unit_Table_Entry,
|
|
|
|
Table_Index_Type => SCO_Unit_Index,
|
2009-07-22 17:56:47 +02:00
|
|
|
Table_Low_Bound => 0, -- see note above on sorting
|
2009-07-22 17:35:52 +02:00
|
|
|
Table_Initial => 20,
|
|
|
|
Table_Increment => 200);
|
|
|
|
|
[multiple changes]
2012-10-01 Vincent Pucci <pucci@adacore.com>
* s-gearop.adb (Vector_Matrix_Product): Dimensions check fixed. Index
of Left in S evaluation fixed.
2012-10-01 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Analyze_Declarations): Avoid
premature freezing caused by the internally generated subprogram
_postconditions.
* checks.adb (Expr_Known_Valid): Float literals are assumed to be valid
in VM targets.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* sinput.ads, sinput.adb, sinput-l.adb sinput-c.adb (Sinput): New
Instances table, tracking all generic instantiations. Source file
attribute Instance replaces previous Instantiation attribute with an
index into the Instances table.
(Iterate_On_Instances): New generic procedure.
(Create_Instantiation_Source): Record instantiations in Instances.
(Tree_Read, Tree_Write): Read/write the instance table.
* scils.ads, scos.adb (SCO_Instance_Table): New table, contains
information copied from Sinput.Instance_Table, but self-contained
within the SCO data structures.
* par_sco.ads, par_sco.adb (To_Source_Location): Move to library level.
(Record_Instance): New subprogram, used by...
(Populate_SCO_Instance_Table): New subprogram to fill
the SCO instance table from the Sinput one (called by SCO_Output).
* opt.ads (Generate_SCO_Instance_Table): New option.
* put_scos.adb (Write_Instance_Table): New subprogram, used by...
(Put_SCOs): Dump the instance table at the end of SCO information
if requested.
* get_scos.adb (Get_SCOs): Read SCO_Instance_Table.
* types.h: Add declaration for Instance_Id.
* back_end.adb (Call_Back_End): Pass instance ids in source file
information table.
(Scan_Back_End_Switches): -fdebug-instances sets
Opt.Generate_SCO_Instance_Table.
* gcc-interface/gigi.h: File_Info_Type includes instance id.
* gcc-interface/trans.c: Under -fdebug-instances, set instance
id in line map from same in file info.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* sem_elab.adb: Minor reformatting
(Check_Elab_Call): Minor fix to debugging code
(add special circuit for the valid case where a 'Access attribute
reference is passed to Check_Elab_Call).
2012-10-01 Thomas Quinot <quinot@adacore.com>
* exp_ch3.adb: Minor reformatting.
From-SVN: r191904
2012-10-01 11:21:46 +02:00
|
|
|
-----------------------
|
|
|
|
-- Generic instances --
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
type SCO_Instance_Index is new Nat;
|
|
|
|
|
|
|
|
type SCO_Instance_Table_Entry is record
|
|
|
|
Inst_Dep_Num : Nat;
|
|
|
|
Inst_Loc : Source_Location;
|
|
|
|
-- File and source location of instantiation
|
|
|
|
|
|
|
|
Enclosing_Instance : SCO_Instance_Index;
|
|
|
|
end record;
|
|
|
|
|
|
|
|
package SCO_Instance_Table is new GNAT.Table (
|
|
|
|
Table_Component_Type => SCO_Instance_Table_Entry,
|
|
|
|
Table_Index_Type => SCO_Instance_Index,
|
|
|
|
Table_Low_Bound => 1,
|
|
|
|
Table_Initial => 20,
|
|
|
|
Table_Increment => 200);
|
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
-----------------
|
|
|
|
-- Subprograms --
|
|
|
|
-----------------
|
|
|
|
|
2009-07-22 17:56:47 +02:00
|
|
|
procedure Initialize;
|
|
|
|
-- Reset tables for a new compilation
|
|
|
|
|
2009-07-22 17:35:52 +02:00
|
|
|
end SCOs;
|