aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/misc.cc4
-rw-r--r--gcc/ada/gcc-interface/trans.cc14
-rw-r--r--gcc/ada/gcc-interface/utils.cc31
3 files changed, 25 insertions, 24 deletions
diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc
index 128040e..7711f8b 100644
--- a/gcc/ada/gcc-interface/misc.cc
+++ b/gcc/ada/gcc-interface/misc.cc
@@ -271,7 +271,7 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* No caret by default for Ada. */
if (!OPTION_SET_P (flag_diagnostics_show_caret))
- global_dc->m_source_printing.enabled = false;
+ global_dc->get_source_printing_options ().enabled = false;
/* Copy global settings to local versions. */
gnat_encodings = global_options.x_gnat_encodings;
@@ -292,7 +292,7 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* Here is the function to handle the compiler error processing in GCC. */
static void
-internal_error_function (diagnostic_context *context, const char *msgid,
+internal_error_function (diagnostics::context *context, const char *msgid,
va_list *ap)
{
char *buffer, *p, *loc;
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index cd480ef..fd1d39c 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -1510,7 +1510,7 @@ Pragma_to_gnu (Node_Id gnat_node)
const location_t location = input_location;
struct cl_option_handlers handlers;
unsigned int option_index;
- diagnostic_t kind;
+ enum diagnostics::kind kind;
bool imply;
gnat_temp = First (Pragma_Argument_Associations (gnat_node));
@@ -1521,12 +1521,12 @@ Pragma_to_gnu (Node_Id gnat_node)
switch (id)
{
case Pragma_Warning_As_Error:
- kind = DK_ERROR;
+ kind = diagnostics::kind::error;
imply = false;
break;
case Pragma_Warnings:
- kind = DK_WARNING;
+ kind = diagnostics::kind::warning;
imply = true;
break;
@@ -1543,11 +1543,11 @@ Pragma_to_gnu (Node_Id gnat_node)
switch (Chars (Expression (gnat_temp)))
{
case Name_Off:
- kind = DK_IGNORED;
+ kind = diagnostics::kind::ignored;
break;
case Name_On:
- kind = DK_WARNING;
+ kind = diagnostics::kind::warning;
break;
default:
@@ -1569,7 +1569,7 @@ Pragma_to_gnu (Node_Id gnat_node)
gnat_expr = Empty;
/* For pragma Warnings (Off), we save the current state... */
- if (kind == DK_IGNORED)
+ if (kind == diagnostics::kind::ignored)
diagnostic_push_diagnostics (global_dc, location);
/* ...so that, for pragma Warnings (On), we do not enable all
@@ -8753,7 +8753,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* Set the location information on the result if it's not a simple name
or something that contains a simple name, for example a tag, because
- we don"t want all the references to get the location of the first use.
+ we don't want all the references to get the location of the first use.
Note that we may have no result if we tried to build a CALL_EXPR node
to a procedure with no side-effects and optimization is enabled. */
else if (kind != N_Identifier
diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index 7324bee..f501915 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -4510,8 +4510,8 @@ build_unc_object_type_from_ptr (tree thin_fat_ptr_type, tree object_type,
void
update_pointer_to (tree old_type, tree new_type)
{
- tree ptr = TYPE_POINTER_TO (old_type);
- tree ref = TYPE_REFERENCE_TO (old_type);
+ const tree old_ptr = TYPE_POINTER_TO (old_type);
+ const tree old_ref = TYPE_REFERENCE_TO (old_type);
tree t;
/* If this is the main variant, process all the other variants first. */
@@ -4520,7 +4520,7 @@ update_pointer_to (tree old_type, tree new_type)
update_pointer_to (t, new_type);
/* If no pointers and no references, we are done. */
- if (!ptr && !ref)
+ if (!old_ptr && !old_ref)
return;
/* Merge the old type qualifiers in the new type.
@@ -4554,12 +4554,13 @@ update_pointer_to (tree old_type, tree new_type)
if (TREE_CODE (new_type) != UNCONSTRAINED_ARRAY_TYPE)
{
tree new_ptr, new_ref;
+ tree ptr, ref;
/* If pointer or reference already points to new type, nothing to do.
This can happen as update_pointer_to can be invoked multiple times
on the same couple of types because of the type variants. */
- if ((ptr && TREE_TYPE (ptr) == new_type)
- || (ref && TREE_TYPE (ref) == new_type))
+ if ((old_ptr && TREE_TYPE (old_ptr) == new_type)
+ || (old_ref && TREE_TYPE (old_ref) == new_type))
return;
/* Chain PTR and its variants at the end. */
@@ -4568,13 +4569,13 @@ update_pointer_to (tree old_type, tree new_type)
{
while (TYPE_NEXT_PTR_TO (new_ptr))
new_ptr = TYPE_NEXT_PTR_TO (new_ptr);
- TYPE_NEXT_PTR_TO (new_ptr) = ptr;
+ TYPE_NEXT_PTR_TO (new_ptr) = old_ptr;
}
else
- TYPE_POINTER_TO (new_type) = ptr;
+ TYPE_POINTER_TO (new_type) = old_ptr;
/* Now adjust them. */
- for (; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
+ for (ptr = old_ptr; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
for (t = TYPE_MAIN_VARIANT (ptr); t; t = TYPE_NEXT_VARIANT (t))
{
TREE_TYPE (t) = new_type;
@@ -4589,13 +4590,13 @@ update_pointer_to (tree old_type, tree new_type)
{
while (TYPE_NEXT_REF_TO (new_ref))
new_ref = TYPE_NEXT_REF_TO (new_ref);
- TYPE_NEXT_REF_TO (new_ref) = ref;
+ TYPE_NEXT_REF_TO (new_ref) = old_ref;
}
else
- TYPE_REFERENCE_TO (new_type) = ref;
+ TYPE_REFERENCE_TO (new_type) = old_ref;
/* Now adjust them. */
- for (; ref; ref = TYPE_NEXT_REF_TO (ref))
+ for (ref = old_ref; ref; ref = TYPE_NEXT_REF_TO (ref))
for (t = TYPE_MAIN_VARIANT (ref); t; t = TYPE_NEXT_VARIANT (t))
{
TREE_TYPE (t) = new_type;
@@ -4614,20 +4615,20 @@ update_pointer_to (tree old_type, tree new_type)
{
tree new_ptr = TYPE_POINTER_TO (new_type);
- gcc_assert (TYPE_IS_FAT_POINTER_P (ptr));
+ gcc_assert (TYPE_IS_FAT_POINTER_P (old_ptr));
/* If PTR already points to NEW_TYPE, nothing to do. This can happen
since update_pointer_to can be invoked multiple times on the same
couple of types because of the type variants. */
- if (TYPE_UNCONSTRAINED_ARRAY (ptr) == new_type)
+ if (TYPE_UNCONSTRAINED_ARRAY (old_ptr) == new_type)
return;
update_pointer_to
- (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (ptr))),
+ (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (old_ptr))),
TREE_TYPE (TREE_TYPE (TYPE_FIELDS (new_ptr))));
update_pointer_to
- (TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (ptr)))),
+ (TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (old_ptr)))),
TREE_TYPE (TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (new_ptr)))));
update_pointer_to (TYPE_OBJECT_RECORD_TYPE (old_type),