aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-04-14 08:14:54 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-04-14 08:14:54 +0000
commit831f44c63804ff9e47d570529b547bc9edead1b7 (patch)
tree7672ff83aceea65a73de3d64f2428443ed25f7a0 /gcc/ada
parentf08863f97b94e6429ee8923bf6d2936aef81be4b (diff)
downloadgcc-831f44c63804ff9e47d570529b547bc9edead1b7.zip
gcc-831f44c63804ff9e47d570529b547bc9edead1b7.tar.gz
gcc-831f44c63804ff9e47d570529b547bc9edead1b7.tar.bz2
gigi.h: Reorder declarations and tweak comments.
* gcc-interface/gigi.h: Reorder declarations and tweak comments. (gigi): Adjust ATTRIBUTE_UNUSED markers. * gcc-interface/gadaint.h: New file. * gcc-interface/trans.c: Include it in lieu of adaint.h. Reorder. (__gnat_to_canonical_file_spec): Remove declaration. (number_names): Delete. (number_files): Likewise. (gigi): Adjust. * gcc-interface/Make-lang.in (ada/trans.o): Adjust dependencies to above change. From-SVN: r158296
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog13
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in3
-rw-r--r--gcc/ada/gcc-interface/gadaint.h35
-rw-r--r--gcc/ada/gcc-interface/gigi.h29
-rw-r--r--gcc/ada/gcc-interface/trans.c27
5 files changed, 76 insertions, 31 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 79c4721..1ec190e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,18 @@
2010-04-14 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/gigi.h: Reorder declarations and tweak comments.
+ (gigi): Adjust ATTRIBUTE_UNUSED markers.
+ * gcc-interface/gadaint.h: New file.
+ * gcc-interface/trans.c: Include it in lieu of adaint.h. Reorder.
+ (__gnat_to_canonical_file_spec): Remove declaration.
+ (number_names): Delete.
+ (number_files): Likewise.
+ (gigi): Adjust.
+ * gcc-interface/Make-lang.in (ada/trans.o): Adjust dependencies to
+ above change.
+
+2010-04-14 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Class_Wide_Type>: Fix
comment.
* gcc-interface/trans.c (process_freeze_entity): Use local copy of
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 467c43c..25c0964 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -1254,7 +1254,8 @@ ada/trans.o : ada/gcc-interface/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(GIMPLE_H) ada/gcc-interface/ada.h ada/adadecode.h ada/types.h \
ada/atree.h ada/elists.h ada/namet.h ada/nlists.h ada/snames.h \
ada/stringt.h ada/uintp.h ada/urealp.h ada/fe.h ada/sinfo.h ada/einfo.h \
- $(ADA_TREE_H) ada/gcc-interface/gigi.h gt-ada-trans.h
+ ada/gcc-interface/gadaint.h $(ADA_TREE_H) ada/gcc-interface/gigi.h \
+ gt-ada-trans.h
$(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
diff --git a/gcc/ada/gcc-interface/gadaint.h b/gcc/ada/gcc-interface/gadaint.h
new file mode 100644
index 0000000..57503f0
--- /dev/null
+++ b/gcc/ada/gcc-interface/gadaint.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ * *
+ * GNAT COMPILER COMPONENTS *
+ * *
+ * G A D A I N T *
+ * *
+ * C Header File *
+ * *
+ * Copyright (C) 2010, 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- *
+ * 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 see *
+ * <http://www.gnu.org/licenses/>. *
+ * *
+ * GNAT was originally developed by the GNAT team at New York University. *
+ * Extensive contributions were provided by Ada Core Technologies Inc. *
+ * *
+ ****************************************************************************/
+
+/* This file contains the declarations of adaint.c material used in gigi.
+ It should be used in lieu of adaint.h in gigi because the latter drags
+ a lot of stuff on Windows and this pollutes the namespace of macros. */
+
+#ifndef GCC_ADAINT_H
+#define GCC_ADAINT_H
+
+extern char *__gnat_to_canonical_file_spec (char *);
+
+#endif /* GCC_ADAINT_H */
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index d9459e5..6b7790b 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -168,12 +168,18 @@ extern tree create_concat_name (Entity_Id gnat_entity, const char *suffix);
the name followed by "___" and the specified suffix. */
extern tree concat_name (tree gnu_name, const char *suffix);
-/* If true, then gigi is being called on an analyzed but unexpanded tree, and
- the only purpose of the call is to properly annotate types with
- representation information. */
+/* Highest number in the front-end node table. */
+extern int max_gnat_nodes;
+
+/* Current node being treated, in case abort called. */
+extern Node_Id error_gnat_node;
+
+/* True when gigi is being called on an analyzed but unexpanded
+ tree, and the only purpose of the call is to properly annotate
+ types with representation information. */
extern bool type_annotate_only;
-/* Current file name without path */
+/* Current file name without path. */
extern const char *ref_filename;
/* This structure must be kept synchronized with Call_Back_End. */
@@ -184,11 +190,9 @@ struct File_Info_Type
};
/* This is the main program of the back-end. It sets up all the table
- structures and then generates code.
-
- ??? Needs parameter descriptions */
-
-extern void gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
+ structures and then generates code. */
+extern void gigi (Node_Id gnat_root, int max_gnat_node,
+ int number_name ATTRIBUTE_UNUSED,
struct Node *nodes_ptr, Node_Id *next_node_ptr,
Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr,
struct Elmt_Item *elmts_ptr,
@@ -257,13 +261,6 @@ extern void post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent,
if none. */
extern tree get_exception_label (char kind);
-/* Current node being treated, in case gigi_abort or Check_Elaboration_Code
- called. */
-extern Node_Id error_gnat_node;
-
-/* Highest number in the front-end node table. */
-extern int max_gnat_nodes;
-
/* If nonzero, pretend we are allocating at global level. */
extern int force_global;
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 7716061..ec2b8ca 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -49,6 +49,7 @@
#include "fe.h"
#include "sinfo.h"
#include "einfo.h"
+#include "gadaint.h"
#include "ada-tree.h"
#include "gigi.h"
@@ -75,11 +76,7 @@
#endif
#endif
-extern char *__gnat_to_canonical_file_spec (char *);
-
-int max_gnat_nodes;
-int number_names;
-int number_files;
+/* Pointers to front-end tables accessed through macros. */
struct Node *Nodes_Ptr;
Node_Id *Next_Node_Ptr;
Node_Id *Prev_Node_Ptr;
@@ -89,14 +86,20 @@ struct String_Entry *Strings_Ptr;
Char_Code *String_Chars_Ptr;
struct List_Header *List_Headers_Ptr;
-/* Current filename without path. */
-const char *ref_filename;
+/* Highest number in the front-end node table. */
+int max_gnat_nodes;
+
+/* Current node being treated, in case abort called. */
+Node_Id error_gnat_node;
/* True when gigi is being called on an analyzed but unexpanded
tree, and the only purpose of the call is to properly annotate
types with representation information. */
bool type_annotate_only;
+/* Current filename without path. */
+const char *ref_filename;
+
/* When not optimizing, we cache the 'First, 'Last and 'Length attributes
of unconstrained array IN parameters to avoid emitting a great deal of
redundant instructions to recompute them each time. */
@@ -183,9 +186,6 @@ static GTY(()) tree gnu_program_error_label_stack;
/* Map GNAT tree codes to GCC tree codes for simple expressions. */
static enum tree_code gnu_codes[Number_Node_Kinds];
-/* Current node being treated, in case abort called. */
-Node_Id error_gnat_node;
-
static void init_code_table (void);
static void Compilation_Unit_to_gnu (Node_Id);
static void record_code_position (Node_Id);
@@ -226,7 +226,7 @@ static const char *decode_name (const char *) ATTRIBUTE_UNUSED;
structures and then generates code. */
void
-gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
+gigi (Node_Id gnat_root, int max_gnat_node, int number_name ATTRIBUTE_UNUSED,
struct Node *nodes_ptr, Node_Id *next_node_ptr, Node_Id *prev_node_ptr,
struct Elist_Header *elists_ptr, struct Elmt_Item *elmts_ptr,
struct String_Entry *strings_ptr, Char_Code *string_chars_ptr,
@@ -242,8 +242,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
int i;
max_gnat_nodes = max_gnat_node;
- number_names = number_name;
- number_files = number_file;
+
Nodes_Ptr = nodes_ptr;
Next_Node_Ptr = next_node_ptr;
Prev_Node_Ptr = prev_node_ptr;
@@ -262,7 +261,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
t = create_concat_name (Defining_Entity (Unit (gnat_root)), NULL);
first_global_object_name = ggc_strdup (IDENTIFIER_POINTER (t));
- for (i = 0; i < number_files; i++)
+ for (i = 0; i < number_file; i++)
{
/* Use the identifier table to make a permanent copy of the filename as
the name table gets reallocated after Gigi returns but before all the