Commit 831f44c6 by Eric Botcazou Committed by Eric Botcazou

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
parent f08863f9
2010-04-14 Eric Botcazou <ebotcazou@adacore.com> 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 * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Class_Wide_Type>: Fix
comment. comment.
* gcc-interface/trans.c (process_freeze_entity): Use local copy of * gcc-interface/trans.c (process_freeze_entity): Use local copy of
......
...@@ -1254,7 +1254,8 @@ ada/trans.o : ada/gcc-interface/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ...@@ -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 \ $(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/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/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 $@ $(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
......
/****************************************************************************
* *
* 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 */
...@@ -168,12 +168,18 @@ extern tree create_concat_name (Entity_Id gnat_entity, const char *suffix); ...@@ -168,12 +168,18 @@ extern tree create_concat_name (Entity_Id gnat_entity, const char *suffix);
the name followed by "___" and the specified suffix. */ the name followed by "___" and the specified suffix. */
extern tree concat_name (tree gnu_name, const char *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 /* Highest number in the front-end node table. */
the only purpose of the call is to properly annotate types with extern int max_gnat_nodes;
representation information. */
/* 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; extern bool type_annotate_only;
/* Current file name without path */ /* Current file name without path. */
extern const char *ref_filename; extern const char *ref_filename;
/* This structure must be kept synchronized with Call_Back_End. */ /* This structure must be kept synchronized with Call_Back_End. */
...@@ -184,11 +190,9 @@ struct File_Info_Type ...@@ -184,11 +190,9 @@ struct File_Info_Type
}; };
/* This is the main program of the back-end. It sets up all the table /* This is the main program of the back-end. It sets up all the table
structures and then generates code. structures and then generates code. */
extern void gigi (Node_Id gnat_root, int max_gnat_node,
??? Needs parameter descriptions */ int number_name ATTRIBUTE_UNUSED,
extern void gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
struct Node *nodes_ptr, Node_Id *next_node_ptr, struct Node *nodes_ptr, Node_Id *next_node_ptr,
Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr, Node_Id *prev_node_ptr, struct Elist_Header *elists_ptr,
struct Elmt_Item *elmts_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, ...@@ -257,13 +261,6 @@ extern void post_error_ne_tree_2 (const char *msg, Node_Id node, Entity_Id ent,
if none. */ if none. */
extern tree get_exception_label (char kind); 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. */ /* If nonzero, pretend we are allocating at global level. */
extern int force_global; extern int force_global;
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "fe.h" #include "fe.h"
#include "sinfo.h" #include "sinfo.h"
#include "einfo.h" #include "einfo.h"
#include "gadaint.h"
#include "ada-tree.h" #include "ada-tree.h"
#include "gigi.h" #include "gigi.h"
...@@ -75,11 +76,7 @@ ...@@ -75,11 +76,7 @@
#endif #endif
#endif #endif
extern char *__gnat_to_canonical_file_spec (char *); /* Pointers to front-end tables accessed through macros. */
int max_gnat_nodes;
int number_names;
int number_files;
struct Node *Nodes_Ptr; struct Node *Nodes_Ptr;
Node_Id *Next_Node_Ptr; Node_Id *Next_Node_Ptr;
Node_Id *Prev_Node_Ptr; Node_Id *Prev_Node_Ptr;
...@@ -89,14 +86,20 @@ struct String_Entry *Strings_Ptr; ...@@ -89,14 +86,20 @@ struct String_Entry *Strings_Ptr;
Char_Code *String_Chars_Ptr; Char_Code *String_Chars_Ptr;
struct List_Header *List_Headers_Ptr; struct List_Header *List_Headers_Ptr;
/* Current filename without path. */ /* Highest number in the front-end node table. */
const char *ref_filename; 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 /* True when gigi is being called on an analyzed but unexpanded
tree, and the only purpose of the call is to properly annotate tree, and the only purpose of the call is to properly annotate
types with representation information. */ types with representation information. */
bool type_annotate_only; bool type_annotate_only;
/* Current filename without path. */
const char *ref_filename;
/* When not optimizing, we cache the 'First, 'Last and 'Length attributes /* When not optimizing, we cache the 'First, 'Last and 'Length attributes
of unconstrained array IN parameters to avoid emitting a great deal of of unconstrained array IN parameters to avoid emitting a great deal of
redundant instructions to recompute them each time. */ redundant instructions to recompute them each time. */
...@@ -183,9 +186,6 @@ static GTY(()) tree gnu_program_error_label_stack; ...@@ -183,9 +186,6 @@ static GTY(()) tree gnu_program_error_label_stack;
/* Map GNAT tree codes to GCC tree codes for simple expressions. */ /* Map GNAT tree codes to GCC tree codes for simple expressions. */
static enum tree_code gnu_codes[Number_Node_Kinds]; 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 init_code_table (void);
static void Compilation_Unit_to_gnu (Node_Id); static void Compilation_Unit_to_gnu (Node_Id);
static void record_code_position (Node_Id); static void record_code_position (Node_Id);
...@@ -226,7 +226,7 @@ static const char *decode_name (const char *) ATTRIBUTE_UNUSED; ...@@ -226,7 +226,7 @@ static const char *decode_name (const char *) ATTRIBUTE_UNUSED;
structures and then generates code. */ structures and then generates code. */
void 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 Node *nodes_ptr, Node_Id *next_node_ptr, Node_Id *prev_node_ptr,
struct Elist_Header *elists_ptr, struct Elmt_Item *elmts_ptr, struct Elist_Header *elists_ptr, struct Elmt_Item *elmts_ptr,
struct String_Entry *strings_ptr, Char_Code *string_chars_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, ...@@ -242,8 +242,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
int i; int i;
max_gnat_nodes = max_gnat_node; max_gnat_nodes = max_gnat_node;
number_names = number_name;
number_files = number_file;
Nodes_Ptr = nodes_ptr; Nodes_Ptr = nodes_ptr;
Next_Node_Ptr = next_node_ptr; Next_Node_Ptr = next_node_ptr;
Prev_Node_Ptr = prev_node_ptr; Prev_Node_Ptr = prev_node_ptr;
...@@ -262,7 +261,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, ...@@ -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); t = create_concat_name (Defining_Entity (Unit (gnat_root)), NULL);
first_global_object_name = ggc_strdup (IDENTIFIER_POINTER (t)); 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 /* 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 the name table gets reallocated after Gigi returns but before all the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment