summaryrefslogtreecommitdiff
path: root/gcc/ada/comperr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-31 09:24:32 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-31 09:24:32 +0000
commit06eec79f7a90b99d20f1ef37bab7232579b17e97 (patch)
treed7cbb2015383eadc95cb3ad402303d45cff77cea /gcc/ada/comperr.adb
parentf56578295717025ee266066527da6d28dd856699 (diff)
downloadgcc-06eec79f7a90b99d20f1ef37bab7232579b17e97.tar.gz
2011-08-31 Robert Dewar <dewar@adacore.com>
* exp_ch5.adb, exp_ch7.ads, sem_ch5.adb, put_scos.adb, s-rannum.adb, a-rbtgbo.adb, exp_intr.adb, a-cbdlli.adb, a-cbdlli.ads: Minor reformatting. 2011-08-31 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Find_Protection_Type): Do not look for fields _object if the corresponding type is malformed due to restriction violations. 2011-08-31 Robert Dewar <dewar@adacore.com> * s-ransee.ads, s-ransee.adb: Minor reformatting. 2011-08-31 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Expand_N_Allocator): Correct faulty condition which would cause the generation of Set_Finalize_Address if the target is a VM and the designated type is not derived from [Limited_]Controlled. 2011-08-31 Arnaud Charlet <charlet@adacore.com> * comperr.adb, comperr.ads, gnat1drv.adb (Delete_SCIL_Files): New subprogram. (Compiler_Abort, Gnat1drv): Call Delete_SCIL_Files in codepeer mode in case of a compilation error. 2011-08-31 Hristian Kirtchev <kirtchev@adacore.com> * init.c (__gnat_error_handler): Standardize the stack overflow or erroneous memory access message. * seh_init.c (__gnat_SEH_error_handler): Standardize the stack overflow or erroneous memory access message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/comperr.adb')
-rw-r--r--gcc/ada/comperr.adb70
1 files changed, 54 insertions, 16 deletions
diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb
index da6c8a688ed..676995fef1c 100644
--- a/gcc/ada/comperr.adb
+++ b/gcc/ada/comperr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
-- --
-- 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- --
@@ -27,20 +27,23 @@
-- error is detected. Calls to these routines cause termination of the
-- current compilation with appropriate error output.
-with Atree; use Atree;
-with Debug; use Debug;
-with Errout; use Errout;
-with Gnatvsn; use Gnatvsn;
-with Namet; use Namet;
-with Opt; use Opt;
-with Osint; use Osint;
-with Output; use Output;
-with Sinput; use Sinput;
-with Sprint; use Sprint;
-with Sdefault; use Sdefault;
-with Targparm; use Targparm;
-with Treepr; use Treepr;
-with Types; use Types;
+with Atree; use Atree;
+with Debug; use Debug;
+with Errout; use Errout;
+with Gnatvsn; use Gnatvsn;
+with Lib; use Lib;
+with Namet; use Namet;
+with Opt; use Opt;
+with Osint; use Osint;
+with Output; use Output;
+with Sinfo; use Sinfo;
+with Sinput; use Sinput;
+with Sprint; use Sprint;
+with Sdefault; use Sdefault;
+with System.OS_Lib; use System.OS_Lib;
+with Targparm; use Targparm;
+with Treepr; use Treepr;
+with Types; use Types;
with Ada.Exceptions; use Ada.Exceptions;
@@ -144,6 +147,10 @@ package body Comperr is
end if;
end if;
+ if CodePeer_Mode then
+ Delete_SCIL_Files;
+ end if;
+
-- If any errors have already occurred, then we guess that the abort
-- may well be caused by previous errors, and we don't make too much
-- fuss about it, since we want to let programmer fix the errors first.
@@ -422,9 +429,40 @@ package body Comperr is
Source_Dump;
raise Unrecoverable_Error;
end if;
-
end Compiler_Abort;
+ -----------------------
+ -- Delete_SCIL_Files --
+ -----------------------
+
+ procedure Delete_SCIL_Files is
+ Main : Node_Id;
+ Success : Boolean;
+ pragma Unreferenced (Success);
+ begin
+ -- If parsing was not successful, no Main_Unit is available, so return
+ -- immediately.
+
+ if Main_Source_File = No_Source_File then
+ return;
+ end if;
+
+ -- Retrieve unit name, and remove old versions of SCIL/<unit>.scil and
+ -- SCIL/<unit>__body.scil
+
+ Main := Unit (Cunit (Main_Unit));
+
+ if Nkind (Main) = N_Subprogram_Body then
+ Get_Name_String (Chars (Defining_Unit_Name (Specification (Main))));
+ else
+ Get_Name_String (Chars (Defining_Unit_Name (Main)));
+ end if;
+
+ Delete_File ("SCIL/" & Name_Buffer (1 .. Name_Len) & ".scil", Success);
+ Delete_File
+ ("SCIL/" & Name_Buffer (1 .. Name_Len) & "__body.scil", Success);
+ end Delete_SCIL_Files;
+
-----------------
-- Repeat_Char --
-----------------