aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/raise-gcc.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 11:48:45 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 11:48:45 +0200
commit6cbfce7e87651d5e7272bad48dfc63e71c1bb27a (patch)
tree1b8bba33017bf56868f71410e9917dde0ac8c621 /gcc/ada/raise-gcc.c
parentde3b531c9aa93592f98ebd99c6b35be632e3c1b3 (diff)
downloadgcc-6cbfce7e87651d5e7272bad48dfc63e71c1bb27a.zip
gcc-6cbfce7e87651d5e7272bad48dfc63e71c1bb27a.tar.gz
gcc-6cbfce7e87651d5e7272bad48dfc63e71c1bb27a.tar.bz2
[multiple changes]
2017-04-27 Claire Dross <dross@adacore.com> * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to modifications in functional containers. * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat to improve readablity. Subprograms are separated between basic operations, constructors and properties. Universally quantified formulas in contracts are factorized in independant functions with a name and a comment. Names of parameters are improved. 2017-04-27 Gary Dismukes <dismukes@adacore.com> * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix. 2017-04-27 Hristian Kirtchev <kirtchev@adacore.com> * sem_res.adb (Resolve_Type_Conversion): Do not install a predicate check here since this is already done during the expansion phase. Verify whether the operand satisfies the static predicate (if any) of the target type. * sem_ch3.adb (Analyze_Object_Declaration): Do not install a predicate check if the object is initialized by means of a type conversion because the conversion is subjected to the same check. 2017-04-27 Tristan Gingold <gingold@adacore.com> * raise.c (__gnat_builtin_longjmp): Remove. (__gnat_bracktrace): Add a dummy definition for the compiler (__gnat_eh_personality, __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19, __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30, __gnat_rcheck_31, __gnat_rcheck_32): Likewise. * a-exexpr.adb: Renamed from a-exexpr-gcc.adb * a-except.ads, a-except.adb: Renamed from a-except-2005.ads and a-except-2005.adb. * raise-gcc.c: Allow build in compiler, compiled as a C++ file. (__gnat_Unwind_ForcedUnwind): Adjust prototype. (db): Constify msg_format. (get_call_site_action_for): Don't use void arithmetic. * system.ads (Frontend_Exceptions): Set to False. (ZCX_By_Default): Set to True. (GCC_ZC_Support): Set to True. * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and a-except.ad[sb]. * gcc-interface/Make-lang.in: Add support for backend zcx exceptions in gnat1 and gnatbind. * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o, s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o * s-excmac.ads, s-excmac.adb: Copy of variants. * a-except.o: Adjust preequisites. Add handling of s-excmac-arm.adb and s-excmac-gcc.adb. From-SVN: r247301
Diffstat (limited to 'gcc/ada/raise-gcc.c')
-rw-r--r--gcc/ada/raise-gcc.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c
index 0074ad53f..cb35842 100644
--- a/gcc/ada/raise-gcc.c
+++ b/gcc/ada/raise-gcc.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2016, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2017, 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- *
@@ -32,10 +32,6 @@
/* Code related to the integration of the GCC mechanism for exception
handling. */
-#ifndef IN_RTS
-#error "RTS unit only"
-#endif
-
#ifndef CERT
#include "tconfig.h"
#include "tsystem.h"
@@ -45,9 +41,14 @@
#endif
#include <stdarg.h>
+
+#ifdef __cplusplus
+# include <cstdlib>
+#else
typedef char bool;
# define true 1
# define false 0
+#endif
#include "raise.h"
@@ -72,6 +73,10 @@ typedef char bool;
#include "unwind.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct _Unwind_Context _Unwind_Context;
typedef struct _Unwind_Exception _Unwind_Exception;
@@ -79,7 +84,7 @@ _Unwind_Reason_Code
__gnat_Unwind_RaiseException (_Unwind_Exception *);
_Unwind_Reason_Code
-__gnat_Unwind_ForcedUnwind (_Unwind_Exception *, void *, void *);
+__gnat_Unwind_ForcedUnwind (_Unwind_Exception *, _Unwind_Stop_Fn, void *);
extern struct Exception_Occurrence *__gnat_setup_current_excep
(_Unwind_Exception *);
@@ -209,7 +214,7 @@ db_indent (int requests)
}
static void ATTRIBUTE_PRINTF_2
-db (int db_code, char * msg_format, ...)
+db (int db_code, const char * msg_format, ...)
{
if (db_accepted_codes () & db_code)
{
@@ -816,8 +821,8 @@ get_call_site_action_for (_Unwind_Ptr ip,
db (DB_CSITE,
"c_site @ %p (+%p), len = %p, lpad @ %p (+%p)\n",
- (void *)region->base + cs_start, (void *)cs_start, (void *)cs_len,
- (void *)region->lp_base + cs_lp, (void *)cs_lp);
+ (char *)region->base + cs_start, (void *)cs_start, (void *)cs_len,
+ (char *)region->lp_base + cs_lp, (void *)cs_lp);
/* The table is sorted, so if we've passed the IP, stop. */
if (ip < region->base + cs_start)
@@ -1399,7 +1404,7 @@ __gnat_Unwind_RaiseException (_Unwind_Exception *e)
_Unwind_Reason_Code
__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e ATTRIBUTE_UNUSED,
- void *handler ATTRIBUTE_UNUSED,
+ _Unwind_Stop_Fn handler ATTRIBUTE_UNUSED,
void *argument ATTRIBUTE_UNUSED)
{
#ifdef __USING_SJLJ_EXCEPTIONS__
@@ -1609,3 +1614,7 @@ __gnat_personality_seh0 (PEXCEPTION_RECORD ms_exc, void *this_frame,
const int __gnat_unwind_exception_size = sizeof (_Unwind_Exception);
#endif
+
+#ifdef __cplusplus
+}
+#endif