Commit d506f649 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Makefile.in (toplev.o, halfpic.o): Depend on halfpic.h

	* Makefile.in (toplev.o, halfpic.o): Depend on halfpic.h
	* i386/osfrose.h (SUBTARGET_SWITCHES): Add missing comma.
	(FUNCTION_PROFILER): Const-ify.
	* halfpic.c: Include "expr.h", "output.h" and "halfpic.h".
	(eliminate_constant_term, assemble_name, output_addr_const):
	Remove declarations.
	(ptr_half_pic_address_p, half_pic_hash): Prototype.
	(all_refs, half_pic_prefix, half_pic_hash, half_pic_declare,
	half_pic_external, half_pic_address_p, half_pic_ptr): Const-ify.
	* halfpic.h (ptr_half_pic_address_p, half_pic_finish): Prototype.
	(half_pic_declare, half_pic_external): Const-ify.
	* toplev.c: Include "halfpic.h".

From-SVN: r46583
parent f710504c
2001-10-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (toplev.o, halfpic.o): Depend on halfpic.h
* i386/osfrose.h (SUBTARGET_SWITCHES): Add missing comma.
(FUNCTION_PROFILER): Const-ify.
* halfpic.c: Include "expr.h", "output.h" and "halfpic.h".
(eliminate_constant_term, assemble_name, output_addr_const):
Remove declarations.
(ptr_half_pic_address_p, half_pic_hash): Prototype.
(all_refs, half_pic_prefix, half_pic_hash, half_pic_declare,
half_pic_external, half_pic_address_p, half_pic_ptr): Const-ify.
* halfpic.h (ptr_half_pic_address_p, half_pic_finish): Prototype.
(half_pic_declare, half_pic_external): Const-ify.
* toplev.c: Include "halfpic.h".
2001-10-28 Joseph S. Myers <jsm28@cam.ac.uk> 2001-10-28 Joseph S. Myers <jsm28@cam.ac.uk>
* config/alpha/alpha.md, config/arm/arm.c, config/arm/arm.h, * config/alpha/alpha.md, config/arm/arm.c, config/arm/arm.h,
......
...@@ -1370,7 +1370,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \ ...@@ -1370,7 +1370,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \
debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \ debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \ graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) halfpic.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DTARGET_NAME=\"$(target_alias)\" \ -DTARGET_NAME=\"$(target_alias)\" \
-c $(srcdir)/toplev.c -c $(srcdir)/toplev.c
...@@ -1616,7 +1616,7 @@ mips-tdump: mips-tdump.o version.o $(LIBDEPS) ...@@ -1616,7 +1616,7 @@ mips-tdump: mips-tdump.o version.o $(LIBDEPS)
mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H)
# Build file to support OSF/rose half-pic format. # Build file to support OSF/rose half-pic format.
halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(SYSTEM_H) halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) $(SYSTEM_H) halfpic.h
# #
# Generate header and source files from the machine description, # Generate header and source files from the machine description,
......
...@@ -58,7 +58,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -58,7 +58,7 @@ Boston, MA 02111-1307, USA. */
#define SUBTARGET_SWITCHES \ #define SUBTARGET_SWITCHES \
{ "half-pic", MASK_HALF_PIC, \ { "half-pic", MASK_HALF_PIC, \
N_("Emit half-PIC code") }, \ N_("Emit half-PIC code") }, \
{ "no-half-pic", -MASK_HALF_PIC, "" } \ { "no-half-pic", -MASK_HALF_PIC, "" }, \
{ "debug-half-pic", MASK_HALF_PIC_DEBUG, \ { "debug-half-pic", MASK_HALF_PIC_DEBUG, \
0 /* intentionally undoc */ }, \ 0 /* intentionally undoc */ }, \
{ "debugb", MASK_HALF_PIC_DEBUG, \ { "debugb", MASK_HALF_PIC_DEBUG, \
...@@ -209,8 +209,8 @@ do \ ...@@ -209,8 +209,8 @@ do \
{ \ { \
if (!OSF_PROFILE_BEFORE_PROLOGUE) \ if (!OSF_PROFILE_BEFORE_PROLOGUE) \
{ \ { \
char *prefix = (TARGET_UNDERSCORES) ? "_" : ""; \ const char *const prefix = (TARGET_UNDERSCORES) ? "_" : ""; \
char *lprefix = LPREFIX; \ const char *const lprefix = LPREFIX; \
int labelno = LABELNO; \ int labelno = LABELNO; \
\ \
/* Note that OSF/rose blew it in terms of calling mcount, \ /* Note that OSF/rose blew it in terms of calling mcount, \
......
...@@ -35,19 +35,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -35,19 +35,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "system.h" #include "system.h"
#include "tree.h" #include "tree.h"
#include "rtl.h" #include "rtl.h"
#include "expr.h"
#include "output.h"
#include "obstack.h" #include "obstack.h"
#include "halfpic.h"
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
extern rtx eliminate_constant_term ();
extern void assemble_name ();
extern void output_addr_const ();
int flag_half_pic = 0; /* Global half-pic flag. */ int flag_half_pic = 0; /* Global half-pic flag. */
int half_pic_number_ptrs = 0; /* # distinct pointers found */ int half_pic_number_ptrs = 0; /* # distinct pointers found */
int half_pic_number_refs = 0; /* # half-pic references */ int half_pic_number_refs = 0; /* # half-pic references */
int (*ptr_half_pic_address_p)() = half_pic_address_p; int (*ptr_half_pic_address_p) PARAMS ((rtx)) = half_pic_address_p;
/* Obstack to hold generated pic names. */ /* Obstack to hold generated pic names. */
static struct obstack half_pic_obstack; static struct obstack half_pic_obstack;
...@@ -59,15 +58,15 @@ struct all_refs { ...@@ -59,15 +58,15 @@ struct all_refs {
struct all_refs *next; /* next name created */ struct all_refs *next; /* next name created */
int external_p; /* name is an external reference */ int external_p; /* name is an external reference */
int pointer_p; /* pointer created. */ int pointer_p; /* pointer created. */
char *ref_name; /* reference name to ptr to real_name */ const char *ref_name; /* reference name to ptr to real_name */
int ref_len; /* reference name length */ int ref_len; /* reference name length */
char *real_name; /* real function/data name */ const char *real_name; /* real function/data name */
int real_len; /* strlen (real_name) */ int real_len; /* strlen (real_name) */
}; };
static struct all_refs *half_pic_names; static struct all_refs *half_pic_names;
static char *half_pic_prefix; static const char *half_pic_prefix;
static int half_pic_prefix_len; static int half_pic_prefix_len;
...@@ -83,16 +82,18 @@ static int half_pic_prefix_len; ...@@ -83,16 +82,18 @@ static int half_pic_prefix_len;
#define HASHBITS 30 #define HASHBITS 30
static struct all_refs *half_pic_hash PARAMS ((const char *, int, int));
static struct all_refs * static struct all_refs *
half_pic_hash (name, len, create_p) half_pic_hash (name, len, create_p)
char *name; /* name to hash */ const char *name; /* name to hash */
int len; /* length of the name (or 0 to call strlen) */ int len; /* length of the name (or 0 to call strlen) */
int create_p; /* != 0 to create new hash bucket if new */ int create_p; /* != 0 to create new hash bucket if new */
{ {
static struct all_refs *hash_table[MAX_HASH_TABLE]; static struct all_refs *hash_table[MAX_HASH_TABLE];
static struct all_refs zero_all_refs; static struct all_refs zero_all_refs;
unsigned char *uname; const unsigned char *uname;
int hash; int hash;
int i; int i;
int ch; int ch;
...@@ -103,7 +104,7 @@ half_pic_hash (name, len, create_p) ...@@ -103,7 +104,7 @@ half_pic_hash (name, len, create_p)
len = strlen (name); len = strlen (name);
/* Compute hash code */ /* Compute hash code */
uname = (unsigned char *)name; uname = (const unsigned char *)name;
ch = uname[0]; ch = uname[0];
hash = len * 613 + ch; hash = len * 613 + ch;
for (i = 1; i < len; i += 2) for (i = 1; i < len; i += 2)
...@@ -246,7 +247,7 @@ half_pic_encode (decl) ...@@ -246,7 +247,7 @@ half_pic_encode (decl)
void void
half_pic_declare (name) half_pic_declare (name)
char *name; const char *name;
{ {
struct all_refs *ptr; struct all_refs *ptr;
...@@ -270,7 +271,7 @@ half_pic_declare (name) ...@@ -270,7 +271,7 @@ half_pic_declare (name)
void void
half_pic_external (name) half_pic_external (name)
char *name; const char *name;
{ {
struct all_refs *ptr; struct all_refs *ptr;
...@@ -296,7 +297,7 @@ int ...@@ -296,7 +297,7 @@ int
half_pic_address_p (addr) half_pic_address_p (addr)
rtx addr; rtx addr;
{ {
char *name; const char *name;
int len; int len;
struct all_refs *ptr; struct all_refs *ptr;
...@@ -363,7 +364,7 @@ struct rtx_def * ...@@ -363,7 +364,7 @@ struct rtx_def *
half_pic_ptr (operand) half_pic_ptr (operand)
rtx operand; rtx operand;
{ {
char *name; const char *name;
struct all_refs *p; struct all_refs *p;
int len; int len;
......
...@@ -35,18 +35,19 @@ struct rtx_def; ...@@ -35,18 +35,19 @@ struct rtx_def;
be true in the gen* programs). */ be true in the gen* programs). */
int flag_half_pic; /* Global half-pic flag. */ int flag_half_pic; /* Global half-pic flag. */
int (*ptr_half_pic_address_p) (); /* ptr to half_pic_address_p () */ int (*ptr_half_pic_address_p) PARAMS ((struct rtx_def *)); /* ptr to half_pic_address_p () */
extern int half_pic_number_ptrs; /* # distinct pointers found */ extern int half_pic_number_ptrs; /* # distinct pointers found */
extern int half_pic_number_refs; /* # half-pic references */ extern int half_pic_number_refs; /* # half-pic references */
extern void half_pic_encode PARAMS ((union tree_node *)); /* encode whether half-pic */ extern void half_pic_encode PARAMS ((union tree_node *)); /* encode whether half-pic */
extern void half_pic_declare PARAMS ((char *)); /* declare object local */ extern void half_pic_declare PARAMS ((const char *)); /* declare object local */
extern void half_pic_external PARAMS ((char *)); /* declare object external */ extern void half_pic_external PARAMS ((const char *)); /* declare object external */
extern void half_pic_init PARAMS ((void)); /* half_pic initialization */ extern void half_pic_init PARAMS ((void)); /* half_pic initialization */
extern int half_pic_address_p PARAMS ((struct rtx_def *)); /* true if an address is half-pic */ extern int half_pic_address_p PARAMS ((struct rtx_def *)); /* true if an address is half-pic */
extern struct rtx_def *half_pic_ptr PARAMS ((struct rtx_def *)); /* return RTX for half-pic pointer */ extern struct rtx_def *half_pic_ptr PARAMS ((struct rtx_def *)); /* return RTX for half-pic pointer */
/* Can't use prototype since FILE isn't defined yet. */ #ifdef BUFSIZ
extern void half_pic_finish (/* FILE * */); /* half_pic termination */ extern void half_pic_finish PARAMS ((FILE *)); /* half_pic termination */
#endif
/* Macros to provide access to the half-pic stuff (so they can easily /* Macros to provide access to the half-pic stuff (so they can easily
be stubbed out. */ be stubbed out. */
......
...@@ -85,6 +85,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -85,6 +85,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "xcoffout.h" /* Needed for external data #include "xcoffout.h" /* Needed for external data
declarations for e.g. AIX 4.x. */ declarations for e.g. AIX 4.x. */
#endif #endif
#ifdef HALF_PIC_DEBUG
#include "halfpic.h"
#endif
#ifdef VMS #ifdef VMS
/* The extra parameters substantially improve the I/O performance. */ /* The extra parameters substantially improve the I/O performance. */
......
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