/* Mode whose width is BITS_PER_WORD */
extern enum machine_mode word_mode;
-/* Vector indexed by opcode giving info about the args for each opcode. */
+/* Vector indexed by opcode giving info about the args for each opcode. */
static struct arityvec arityvec[] = {
#include "bc-arity.h"
};
/* How to print a symbol name for the assembler. */
+
static void
prsym (file, s)
FILE *file;
}
-/* Maintain a bucket hash table for symbol names. */
+/* Maintain a bucket hash table for symbol names. */
#define HASH_BITS 32
#define HASH_SIZE 509
}
-/* Look up the named symbol, creating it if it doesn't exist. */
+/* Look up the named symbol, creating it if it doesn't exist. */
+
struct bc_sym *
sym_lookup (name)
char *name;
/* Write out .globl and common symbols to the named file. */
+
static void
bc_sym_write (file)
FILE *file;
\f
-/* Create and initialize a new segment. */
+/* Create and initialize a new segment. */
+
static struct bc_seg *
seg_create ()
{
}
-/* Advance the segment index to the next alignment boundary. */
+/* Advance the segment index to the next alignment boundary. */
+
static void
seg_align (seg, log)
struct bc_seg *seg;
}
-/* Append the given data to the given segment. */
+/* Append the given data to the given segment. */
+
static void
seg_data (seg, data, size)
struct bc_seg *seg;
/* Append a zero-filled skip to the given segment. */
+
static void
seg_skip (seg, size)
struct bc_seg *seg;
/* Define the given name as the current offset in the given segment. It
is an error if the name is already defined. Return 0 or 1 indicating
- failure or success respectively. */
+ failure or success respectively. */
+
static int
seg_defsym (seg, name)
struct bc_seg *seg;
/* Generate in seg's data a reference to the given sym, adjusted by
- the given offset. */
+ the given offset. */
+
static void
seg_refsym (seg, name, offset)
struct bc_seg *seg;
}
-/* Concatenate the contents of given segments into the first argument. */
+/* Concatenate the contents of given segments into the first argument. */
+
static void
seg_concat (result, seg)
struct bc_seg *result, *seg;
free (seg->data);
/* Go through the symbols and relocs of SEG, adjusting their offsets
- for their new location in RESULT. */
+ for their new location in RESULT. */
if (seg->syms)
{
segsym = seg->syms;
}
/* Write a segment to a file. */
+
static void
bc_seg_write (seg, file)
struct bc_seg *seg;
\f
-/* Text and data segments of the object file in making. */
+/* Text and data segments of the object file in making. */
static struct bc_seg *bc_text_seg;
static struct bc_seg *bc_data_seg;
-/* Called before anything else in this module. */
+/* Called before anything else in this module. */
+
void
bc_initialize ()
{
require us to provide hairy location info and possibly obey alignment
rules imposed by the architecture) we build an auxiliary table of
pointer constants, and encode just offsets into this table into the
- actual bytecode. */
+ actual bytecode. */
static struct bc_seg *ptrconsts;
/* Trampoline code for the function entry. */
struct bc_seg *trampoline;
-/* Actual byte code of the function. */
+/* Actual byte code of the function. */
struct bc_seg *bytecode;
-/* List of labels defined in the function. */
+/* List of labels defined in the function. */
struct bc_label *labels;
-/* List of label references in the function. */
+/* List of label references in the function. */
struct bc_labelref *labelrefs;
/* Add symbol to pointer table. Return offset into table where
pointer was stored. The offset usually goes into the bytecode
- stream as a constP literal. */
+ stream as a constP literal. */
+
int
bc_define_pointer (p)
char *p;
/* Begin a bytecoded function. */
+
int
bc_begin_function (name)
char *name;
/* Force alignment in inline bytecode. */
+
void
bc_align_bytecode (align)
int align;
/* Emit data inline into bytecode. */
+
void
bc_emit_bytecode_const (data, size)
char *data;
/* Create a new "bytecode label", to have its value defined later.
Bytecode labels have nothing to do with the object file symbol table,
- and are purely local to a given bytecoded function. */
+ and are purely local to a given bytecoded function. */
+
struct bc_label *
bc_get_bytecode_label ()
{
}
-/* Define the given label with the current location counter. */
+/* Define the given label with the current location counter. */
+
int
bc_emit_bytecode_labeldef (label)
struct bc_label *label;
/* Generate a location-relative reference to the given bytecode label.
- It need not be defined yet; label references will be backpatched later. */
+ It need not be defined yet; label references will be backpatched later. */
+
void
bc_emit_bytecode_labelref (label)
struct bc_label *label;
/* Emit a reference to an external address; generate the reference in the
- ptrconst area, and emit an offset in the bytecode. */
+ ptrconst area, and emit an offset in the bytecode. */
+
void
bc_emit_code_labelref (name, offset)
char *name;
/* Backpatch label references in the byte code, and concatenate the bytecode
and pointer constant segments to the cumulative text for the object file.
Return a label name for the pointer constants region. */
+
char *
bc_end_function ()
{
char ptrconsts_label[20];
static int nlab;
- /* Backpatch bytecode label references. */
+ /* Backpatch bytecode label references. */
for (ref = labelrefs; ref; ref = ref->next)
if (ref->label->defined)
{
bcopy ((char *) &addr, bytecode->data + ref->offset, sizeof addr);
}
- /* Free the chains of labelrefs and labeldefs. */
+ /* Free the chains of labelrefs and labeldefs. */
for (ref = labelrefs; ref; ref = nextref)
{
nextref = ref->next;
return sym_lookup (ptrconsts_label)->name;
}
-/* Force alignment in const data. */
+/* Force alignment in const data. */
+
void
bc_align_const (align)
int align;
seg_align (bc_text_seg, align);
}
-/* Emit const data. */
+/* Emit const data. */
+
void
bc_emit_const (data, size)
char *data;
seg_data (bc_text_seg, data, size);
}
-/* Emit a zero-filled constant skip. */
+/* Emit a zero-filled constant skip. */
+
void
bc_emit_const_skip (size)
unsigned int size;
seg_skip (bc_text_seg, size);
}
-/* Emit a label definition in const data. */
+/* Emit a label definition in const data. */
+
int
bc_emit_const_labeldef (name)
char *name;
return seg_defsym (bc_text_seg, name);
}
-/* Emit a label reference in const data. */
+/* Emit a label reference in const data. */
+
void
bc_emit_const_labelref (name, offset)
char *name;
seg_refsym (bc_text_seg, name, offset);
}
-/* Force alignment in data. */
+/* Force alignment in data. */
+
void
bc_align_data (align)
int align;
seg_align (bc_data_seg, align);
}
-/* Emit data. */
+/* Emit data. */
+
void
bc_emit_data (data, size)
char *data;
}
/* Emit a zero-filled data skip. */
+
void
bc_emit_data_skip (size)
unsigned int size;
seg_skip (bc_data_seg, size);
}
-/* Emit label definition in data. */
+/* Emit label definition in data. */
+
int
bc_emit_data_labeldef (name)
char *name;
return seg_defsym (bc_data_seg, name);
}
-/* Emit label reference in data. */
+/* Emit label reference in data. */
+
void
bc_emit_data_labelref (name, offset)
char *name;
/* Emit a common block of the given name and size. Note that
when the .o file is actually written non-global "common"
blocks will have to be turned into space in the data section. */
+
int
bc_emit_common (name, size)
char *name;
return 1;
}
-/* Globalize the given label. */
+/* Globalize the given label. */
+
void
bc_globalize_label (name)
char *name;
/* Print bytecode rtx */
+
void
bc_print_rtl (fp, r)
FILE *fp;
/* Emit a bytecode, keeping a running tally of the stack depth. */
+
void
bc_emit_bytecode (bytecode)
enum bytecode_opcode bytecode;
will cause an interpreter stack undeflow when executed. Instead of
dumping core on such occasions, we omit the bytecode. Erroneous code
should not be executed, regardless. This makes life much easier, since
- we don't have to deceive ourselves about the known stack depth. */
+ we don't have to deceive ourselves about the known stack depth. */
bc_emit_bytecode_const (&byte, 1);
/* Emit a complete bytecode instruction, expecting the correct number
of literal values in the call. First argument is the instruction, the
- remaining arguments are literals of size HOST_WIDE_INT or smaller. */
+ remaining arguments are literals of size HOST_WIDE_INT or smaller. */
+
void
bc_emit_instruction VPROTO((enum bytecode_opcode opcode, ...))
{
coded function. The argument is a label name of the interpreter
bytecode callinfo structure; the return value is a label name for
the beginning of the actual bytecode. */
+
char *
bc_emit_trampoline (callinfo)
char *callinfo;
static struct conversion_recipe
{
unsigned char *opcodes; /* Bytecodes to emit in order. */
- int nopcodes; /* Count of bytecodes. */
- int cost; /* A rather arbitrary cost function. */
+ int nopcodes; /* Count of bytecodes. */
+ int cost; /* A rather arbitrary cost function. */
} conversion_recipe[NUM_TYPECODES][NUM_TYPECODES];
/* Binary operator tables. */
* Either sign extensions or zero extensions may be present, but not both.
* No widening conversions occur after a signed/unsigned conversion.
* The sequence of sizes must be strict nonincreasing or nondecreasing. */
+
static int
conversion_reasonable_p (conversion, list)
struct conversion_info *conversion;
/* Exhaustively search all reasonable conversions to find one to
convert the given types. */
+
static struct conversion_recipe
deduce_conversion (from, to)
enum typecode from, to;
/* Emit a conversion between the given scalar types. */
+
void
emit_typecode_conversion (from, to)
enum typecode from, to;
/* Initialize mode_to_code_map[] */
+
void
bc_init_mode_to_code_map ()
{
}
/* Given a machine mode return the preferred typecode. */
+
enum typecode
preferred_typecode (mode, unsignedp)
enum machine_mode mode;
/* Expand a conversion between the given types. */
+
void
bc_expand_conversion (from, to)
tree from, to;
}
/* Expand a conversion of the given type to a truth value. */
+
void
bc_expand_truth_conversion (from)
tree from;
}
/* Emit an appropriate binary operation. */
+
void
bc_expand_binary_operation (optab, resulttype, arg0, arg1)
struct binary_operator optab[];
}
/* Emit an appropriate unary operation. */
+
void
bc_expand_unary_operation (optab, resulttype, arg0)
struct unary_operator optab[];
/* Emit an appropriate increment. */
+
void
bc_expand_increment (optab, type)
struct increment_operator optab[];
}
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
- memory. */
+ memory. */
+
char *
xmalloc (nbytes)
int nbytes;
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
- memory. */
+ memory. */
static char *
xmalloc (nbytes)
/* Safely reallocate BLOCK so its size becomes NBYTES.
- The block returned may be different from the one supplied. */
+ The block returned may be different from the one supplied. */
static char *
xrealloc (block, nbytes)
purposes here, a sequence of characters that starts with the regexp
``[^ #\t\n(),]'' and is then followed by the regexp ``[^#(),]*''. Any
character is accepted if preceded by a backslash, "\\". It is assumed
- that the first character has already been checked by the main loop. */
+ that the first character has already been checked by the main loop. */
static char *
scan_string ()
}
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
- memory. */
+ memory. */
+
char *
xmalloc (nbytes)
int nbytes;
}
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
- memory. */
+ memory. */
+
char *
xmalloc (nbytes)
int nbytes;
#include "tree.h"
#include "c-tree.h"
-extern char* xmalloc ();
+extern char *xmalloc ();
enum formals_style_enum {
ansi,
typedef enum formals_style_enum formals_style;
-static char* data_type;
+static char *data_type;
-static char * concat ();
-static char * concat3 ();
-static char * gen_formal_list_for_type ();
-static int deserves_ellipsis ();
-static char * gen_formal_list_for_func_def ();
-static char * gen_type ();
-static char * gen_decl ();
+static char *concat ();
+static char *concat3 ();
+static char *gen_formal_list_for_type ();
+static int deserves_ellipsis ();
+static char *gen_formal_list_for_func_def ();
+static char *gen_type ();
+static char *gen_decl ();
void gen_aux_info_record ();
\f
/* Take two strings and mash them together into a newly allocated area. */
-static char*
+static char *
concat (s1, s2)
- char* s1;
- char* s2;
+ char *s1;
+ char *s2;
{
int size1, size2;
- char* ret_val;
+ char *ret_val;
if (!s1)
s1 = "";
/* Take three strings and mash them together into a newly allocated area. */
-static char*
+static char *
concat3 (s1, s2, s3)
- char* s1;
- char* s2;
- char* s3;
+ char *s1;
+ char *s2;
+ char *s3;
{
int size1, size2, size3;
- char* ret_val;
+ char *ret_val;
if (!s1)
s1 = "";
`const char *foo;' and *not* `char const *foo;' so we try to create types
that look as expected. */
-static char*
+static char *
affix_data_type (type_or_decl)
char *type_or_decl;
{
this function type. Return the whole formal parameter list (including
a pair of surrounding parens) as a string. Note that if the style
we are currently aiming for is non-ansi, then we just return a pair
- of empty parens here. */
+ of empty parens here. */
-static char*
+static char *
gen_formal_list_for_type (fntype, style)
tree fntype;
formals_style style;
{
- char* formal_list = "";
+ char *formal_list = "";
tree formal_type;
if (style != ansi)
formal_type = TYPE_ARG_TYPES (fntype);
while (formal_type && TREE_VALUE (formal_type) != void_type_node)
{
- char* this_type;
+ char *this_type;
if (*formal_list)
formal_list = concat (formal_list, ", ");
This routine returns a string which is the source form for the entire
function formal parameter list. */
-static char*
+static char *
gen_formal_list_for_func_def (fndecl, style)
tree fndecl;
formals_style style;
{
- char* formal_list = "";
+ char *formal_list = "";
tree formal_decl;
formal_decl = DECL_ARGUMENTS (fndecl);
to do at this point is for the initial caller to prepend the "data_type"
string onto the returned "seed". */
-static char*
+static char *
gen_type (ret_val, t, style)
- char* ret_val;
+ char *ret_val;
tree t;
formals_style style;
{
associated with a function definition. In this case, we can assume that
an attached list of DECL nodes for function formal arguments is present. */
-static char*
+static char *
gen_decl (decl, is_func_definition, style)
tree decl;
int is_func_definition;
formals_style style;
{
- char* ret_val;
+ char *ret_val;
if (DECL_NAME (decl))
ret_val = IDENTIFIER_POINTER (DECL_NAME (decl));
return ret_val;
}
-extern FILE* aux_info_file;
+extern FILE *aux_info_file;
/* Generate and write a new line of info to the aux-info (.X) file. This
routine is called once for each function declaration, and once for each
/* Process the attributes listed in ATTRIBUTES and PREFIX_ATTRIBUTES
and install them in NODE, which is either a DECL (including a TYPE_DECL)
or a TYPE. PREFIX_ATTRIBUTES can appear after the declaration specifiers
- and declaration modifiers but before the declaration proper. */
+ and declaration modifiers but before the declaration proper. */
void
decl_attributes (node, attributes, prefix_attributes)
if (first_arg_num != 0)
{
/* Verify that first_arg_num points to the last arg,
- the ... */
+ the ... */
while (argument)
arg_num++, argument = TREE_CHAIN (argument);
if (arg_num != first_arg_num)
if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE
|| TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
break;
- /* fall through... */
+ /* fall through... */
case NOP_EXPR:
/* If this is widening the argument, we can ignore it. */
if (TYPE_PRECISION (TREE_TYPE (expr))
if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
&& TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE)
break;
- /* fall through... */
+ /* fall through... */
case BIT_XOR_EXPR:
/* This and MINUS_EXPR can be changed into a comparison of the
two objects. */
int flag_traditional;
/* Nonzero means to allow single precision math even if we're generally
- being traditional. */
+ being traditional. */
int flag_allow_single_precision = 0;
/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
int warn_nested_externs = 0;
-/* Warn about *printf or *scanf format/argument anomalies. */
+/* Warn about *printf or *scanf format/argument anomalies. */
int warn_format;
}
\f
/* Create the predefined scalar types of C,
- and some nodes representing standard constants (0, 1, (void *)0).
+ and some nodes representing standard constants (0, 1, (void *) 0).
Initialize the global binding level.
Make definitions for built-in primitive functions. */
tree restype;
int old_immediate_size_expand = immediate_size_expand;
- current_function_returns_value = 0; /* Assume, until we see it does. */
+ current_function_returns_value = 0; /* Assume, until we see it does. */
current_function_returns_null = 0;
warn_about_return_type = 0;
current_extern_inline = 0;
push_iterator_stack ()
{
struct iter_stack_node *new_top
- = (struct iter_stack_node*)
+ = (struct iter_stack_node *)
obstack_alloc (&ixp_obstack, sizeof (struct iter_stack_node));
new_top->first = 0;
tree idecl;
rtx pro_start, pro_end, epi_start, epi_end;
{
- struct ixpansion* newix;
+ struct ixpansion *newix;
/* Do nothing if we are not inside "({...})",
as in that case this expansion can't need subsequent RTL modification. */
if (iter_stack == 0)
return;
- newix = (struct ixpansion*) obstack_alloc (&ixp_obstack,
- sizeof (struct ixpansion));
+ newix = (struct ixpansion *) obstack_alloc (&ixp_obstack,
+ sizeof (struct ixpansion));
newix->ixdecl = idecl;
newix->ixprologue_start = pro_start;
newix->ixprologue_end = pro_end;
delete_ixpansion (idecl)
tree idecl;
{
- struct ixpansion* previx = 0, *ix;
+ struct ixpansion *previx = 0, *ix;
for (ix = sublevel_ixpansions.first; ix; ix = ix->next)
if (ix->ixdecl == idecl)
return head;
}
-/* Print Iterator Stack*/
+/* Print Iterator Stack. */
void
pis ()
fatal ("GCC does not yet support XREF");
}
-/* called at end of parsing, but before end-of-file processing. */
+/* Called at end of parsing, but before end-of-file processing. */
+
void
finish_file ()
{
/* When structure field packing is in effect, this variable is the
number of bits to use as the maximum alignment. When packing is not
- in effect, this is zero. */
+ in effect, this is zero. */
extern int maximum_field_alignment;
/* This represents the value which the identifier has in the
file-scope namespace. */
#define IDENTIFIER_GLOBAL_VALUE(NODE) \
- (((struct lang_identifier *)(NODE))->global_value)
+ (((struct lang_identifier *) (NODE))->global_value)
/* This represents the value which the identifier has in the current
scope. */
#define IDENTIFIER_LOCAL_VALUE(NODE) \
- (((struct lang_identifier *)(NODE))->local_value)
+ (((struct lang_identifier *) (NODE))->local_value)
/* This represents the value which the identifier has as a label in
the current label scope. */
#define IDENTIFIER_LABEL_VALUE(NODE) \
- (((struct lang_identifier *)(NODE))->label_value)
+ (((struct lang_identifier *) (NODE))->label_value)
/* This records the extern decl of this identifier, if it has had one
at any point in this compilation. */
#define IDENTIFIER_LIMBO_VALUE(NODE) \
- (((struct lang_identifier *)(NODE))->limbo_value)
+ (((struct lang_identifier *) (NODE))->limbo_value)
/* This records the implicit function decl of this identifier, if it
has had one at any point in this compilation. */
#define IDENTIFIER_IMPLICIT_DECL(NODE) \
- (((struct lang_identifier *)(NODE))->implicit_decl)
+ (((struct lang_identifier *) (NODE))->implicit_decl)
/* This is the last function in which we printed an "undefined variable"
message for this identifier. Value is a FUNCTION_DECL or null. */
#define IDENTIFIER_ERROR_LOCUS(NODE) \
- (((struct lang_identifier *)(NODE))->error_locus)
+ (((struct lang_identifier *) (NODE))->error_locus)
/* In identifiers, C uses the following fields in a special way:
TREE_PUBLIC to record that there was a previous local extern decl.
/* Store a value in that field. */
#define C_SET_EXP_ORIGINAL_CODE(exp, code) \
- (TREE_COMPLEXITY (exp) = (int)(code))
+ (TREE_COMPLEXITY (exp) = (int) (code))
/* Record whether a typedef for type `int' was actually `signed int'. */
#define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
}
t1 = build_function_type (valtype, newargs);
- /* ... falls through ... */
+ /* ... falls through ... */
}
default:
}
parmval = convert_for_assignment (type, val,
- (char *)0, /* arg passing */
+ (char *) 0, /* arg passing */
fundecl, name, parmnum + 1);
#ifdef PROMOTE_PROTOTYPES
return 0;
}
- /* ... fall through ... */
+ /* ... fall through ... */
case ADDR_EXPR:
case ARRAY_REF:
if (! memb_types)
{
/* We have only a marginally acceptable member type;
- it needs a warning. */
+ it needs a warning. */
register tree ttl = TREE_TYPE (marginal_memb_type);
register tree ttr = TREE_TYPE (rhstype);
static int constructor_depth;
/* 0 if implicitly pushing constructor levels is allowed. */
-int constructor_no_implicit = 0; /* 0 for C; 1 for some other languages. */
+int constructor_no_implicit = 0; /* 0 for C; 1 for some other languages. */
/* 1 if this constructor level was entered implicitly. */
static int constructor_implicit;
break;
}
- /* In the case of [LO .. HI] = VALUE, only evaluate VALUE once. */
+ /* In the case of [LO .. HI] = VALUE, only evaluate VALUE once. */
if (constructor_range_end)
value = save_expr (value);
reg_save_code[i][j] = recog_memoized (saveinsn);
reg_restore_code[i][j] = recog_memoized (restinsn);
- /* Now extract both insns and see if we can meet their constraints. */
+ /* Now extract both insns and see if we can meet their
+ constraints. */
ok = (reg_save_code[i][j] != -1 && reg_restore_code[i][j] != -1);
if (ok)
{
ok &= (TEST_HARD_REG_BIT (hard_regs_used, regno) != 0);
}
- /* We have found an acceptable mode to store in. */
+ /* We have found an acceptable mode to store in. */
if (ok)
{
= assign_stack_local (regno_save_mode[i][j],
GET_MODE_SIZE (regno_save_mode[i][j]), 0);
- /* Setup single word save area just in case... */
+ /* Setup single word save area just in case... */
for (k = 0; k < j; k++)
{
/* This should not depend on WORDS_BIG_ENDIAN.
funexp = protect_from_queue (funexp, 0);
if (fndecl != 0)
- /* Get possible static chain value for nested function in C. */
+ /* Get possible static chain value for nested function in C. */
static_chain_value = lookup_static_chain (fndecl);
/* Make a valid memory address and copy constants thru pseudo-regs,
int needed = args_size.constant;
- /* Store the maximum argument space used. It will be pushed by the
- prologue (if ACCUMULATE_OUTGOING_ARGS, or stack overflow checking). */
+ /* Store the maximum argument space used. It will be pushed by
+ the prologue (if ACCUMULATE_OUTGOING_ARGS, or stack overflow
+ checking). */
if (needed > current_function_outgoing_args_size)
current_function_outgoing_args_size = needed;
}
/* Precompute all register parameters. It isn't safe to compute anything
- once we have started filling any specific hard regs. */
+ once we have started filling any specific hard regs. */
reg_parm_seen = 0;
for (i = 0; i < num_actuals; i++)
if (args[i].reg != 0 && ! args[i].pass_on_stack)
/* If this was alloca, record the new stack level for nonlocal gotos.
Check for the handler slots since we might not have a save area
- for non-local gotos. */
+ for non-local gotos. */
if (may_be_alloca && nonlocal_goto_handler_slot != 0)
emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, NULL_RTX);
abort ();
#endif
- FUNCTION_ARG_ADVANCE (args_so_far, mode, (tree)0, 1);
+ FUNCTION_ARG_ADVANCE (args_so_far, mode, (tree) 0, 1);
}
va_end (p);
)
args_size.constant += argvec[count].size.constant;
- FUNCTION_ARG_ADVANCE (args_so_far, Pmode, (tree)0, 1);
+ FUNCTION_ARG_ADVANCE (args_so_far, Pmode, (tree) 0, 1);
count++;
}
abort ();
#endif
- FUNCTION_ARG_ADVANCE (args_so_far, mode, (tree)0, 1);
+ FUNCTION_ARG_ADVANCE (args_so_far, mode, (tree) 0, 1);
}
va_end (p);
if (argblock && ! variable_size && arg->stack)
{
#ifdef ARGS_GROW_DOWNWARD
- /* stack_slot is negative, but we want to index stack_usage_map */
- /* with positive values. */
+ /* stack_slot is negative, but we want to index stack_usage_map
+ with positive values. */
if (GET_CODE (XEXP (arg->stack_slot, 0)) == PLUS)
upper_bound = -INTVAL (XEXP (XEXP (arg->stack_slot, 0), 1)) + 1;
else
#endif
#ifndef NULL_PTR
-#define NULL_PTR ((GENERIC_PTR)0)
+#define NULL_PTR ((GENERIC_PTR) 0)
#endif
#ifndef INCLUDE_LEN_FUDGE
/* Nonzero means we are inside an IF during a -pcp run. In this mode
macro expansion is done, and preconditions are output for all macro
- uses requiring them. */
+ uses requiring them. */
static int pcp_inside_if;
/* Nonzero means never to include precompiled files.
/* The output buffer. Its LENGTH field is the amount of room allocated
for the buffer, not the number of chars actually present. To get
- that, subtract outbuf.buf from outbuf.bufp. */
+ that, subtract outbuf.buf from outbuf.bufp. */
#define OUTBUF_SIZE 10 /* initial size of output buffer */
static FILE_BUF outbuf;
char fname[1];
};
-/* #include "file" looks in source file dir, then stack. */
-/* #include <file> just looks in the stack. */
-/* -I directories are added to the end, then the defaults are added. */
+/* #include "file" looks in source file dir, then stack. */
+/* #include <file> just looks in the stack. */
+/* -I directories are added to the end, then the defaults are added. */
/* The */
static struct default_include {
char *fname; /* The name of the directory. */
#define f(x) x+x+x+x+x+x+x would have replacement text "++++++" and
pattern list
{ (0, 1), (1, 1), (1, 1), ..., (1, 1), NULL }
- where (x, y) means (nchars, argno). */
+ where (x, y) means (nchars, argno). */
typedef struct definition DEFINITION;
struct definition {
};
/* different kinds of things that can appear in the value field
- of a hash node. Actually, this may be useless now. */
+ of a hash node. Actually, this may be useless now. */
union hashval {
char *cpval;
DEFINITION *defn;
plus some special tokens like __LINE__ (these each have their own
type, and the appropriate code is run when that type of node is seen.
It does not contain control words like "#define", which are recognized
- by a separate piece of code. */
+ by a separate piece of code. */
/* different flavors of hash nodes --- also used in keyword table */
enum node_type {
struct hashnode *prev;
struct hashnode **bucket_hdr; /* also, a back pointer to this node's hash
chain is kept, in case the node is the head
- of the chain and gets deleted. */
+ of the chain and gets deleted. */
enum node_type type; /* type of special token */
int length; /* length of token, for quick comparison */
U_CHAR *name; /* the actual name */
loop computes the hash value `on the fly' for most tokens,
in order to avoid the overhead of a lot of procedure calls to
the hashf () function. Hashf () only exists for the sake of
- politeness, for use when speed isn't so important. */
+ politeness, for use when speed isn't so important. */
#define HASHSIZE 1403
static HASHNODE *hashtab[HASHSIZE];
struct assertion_hashnode *prev;
/* also, a back pointer to this node's hash
chain is kept, in case the node is the head
- of the chain and gets deleted. */
+ of the chain and gets deleted. */
struct assertion_hashnode **bucket_hdr;
int length; /* length of token, for quick comparison */
U_CHAR *name; /* the actual name */
loop computes the hash value `on the fly' for most tokens,
in order to avoid the overhead of a lot of procedure calls to
the hashf function. hashf only exists for the sake of
- politeness, for use when speed isn't so important. */
+ politeness, for use when speed isn't so important. */
#define ASSERTION_HASHSIZE 37
static ASSERTION_HASHNODE *assertion_hashtab[ASSERTION_HASHSIZE];
int length; /* Length of name */
int (*func) DO_PROTO; /* Function to handle directive */
char *name; /* Name of directive */
- enum node_type type; /* Code which describes which directive. */
+ enum node_type type; /* Code which describes which directive. */
char angle_brackets; /* Nonzero => <...> is special. */
char traditional_comments; /* Nonzero: keep comments if -traditional. */
char pass_thru; /* Copy preprocessed directive to output file. */
this points to the # (or the : of the %:) that started the directive. */
U_CHAR *directive_start;
-/* table to tell if char can be part of a C identifier. */
+/* table to tell if char can be part of a C identifier. */
U_CHAR is_idchar[256];
-/* table to tell if char can be first char of a c identifier. */
+/* table to tell if char can be first char of a c identifier. */
U_CHAR is_idstart[256];
/* table to tell if c is horizontal space. */
U_CHAR is_hor_space[256];
struct rlimit rlim;
/* Set the stack limit huge so that alloca (particularly stringtab
- * in dbxread.c) does not fail. */
+ in dbxread.c) does not fail. */
getrlimit (RLIMIT_STACK, &rlim);
rlim.rlim_cur = rlim.rlim_max;
setrlimit (RLIMIT_STACK, &rlim);
done_initializing = 1;
- { /* read the appropriate environment variable and if it exists
- replace include_defaults with the listed path. */
+ { /* Read the appropriate environment variable and if it exists
+ replace include_defaults with the listed path. */
char *epath = 0;
switch ((objc << 1) + cplusplus)
{
Using an extra pass through the buffer takes a little extra time,
but is infinitely less hairy than trying to handle trigraphs inside
strings, etc. everywhere, and also makes sure that trigraphs are
- only translated in the top level of processing. */
+ only translated in the top level of processing. */
static void
trigraph_pcp (buf)
len = sptr - fptr - 2;
/* BSD doc says bcopy () works right for overlapping strings. In ANSI
- C, this will be memmove (). */
+ C, this will be memmove (). */
if (bptr != fptr && len > 0)
bcopy ((char *) fptr, (char *) bptr, len);
Upon return, any arg will be pointed to with argstart and will be
arglen long. Note that we don't parse that arg since it will just
- be printed out again.
-*/
+ be printed out again. */
static char *
get_lintcmd (ibp, limit, argstart, arglen, cmdlen)
if (ident_length)
goto specialchar;
/* Copy #foo (bar lose) without macro expansion. */
- obp[-1] = '#'; /* In case it was '%'. */
+ obp[-1] = '#'; /* In case it was '%'. */
SKIP_WHITE_SPACE (ibp);
while (is_idchar[*ibp])
*obp++ = *ibp++;
goto specialchar;
if (*ibp == '/') {
- /* C++ style comment... */
+ /* C++ style comment... */
start_line = ip->lineno;
- /* Comments are equivalent to spaces. */
+ /* Comments are equivalent to spaces. */
if (! put_out_comments)
obp[-1] = ' ';
start_line = ip->lineno;
- ++ibp; /* Skip the star. */
+ ++ibp; /* Skip the star. */
/* If this cpp is for lint, we peek inside the comments: */
if (for_lint) {
either the appropriate place in the input buffer, or to
the temp buffer if it was necessary to make one. cp
points to the first char after the contents of the (possibly
- copied) directive, in either case. */
+ copied) directive, in either case. */
(*kt->func) (buf, cp, op, kt);
check_expand (op, ip->length - (ip->bufp - ip->buf));
{
static struct tm *timebuf;
if (!timebuf) {
- time_t t = time ((time_t *)0);
+ time_t t = time ((time_t *) 0);
timebuf = localtime (&t);
}
return timebuf;
if (pcp_outfile && pcp_inside_if
&& (hp->type == T_CONST
|| (hp->type == T_MACRO && hp->value.defn->predefined)))
- /* Output a precondition for this macro use. */
+ /* Output a precondition for this macro use. */
fprintf (pcp_outfile, "#define %s\n", hp->name);
buf = " 1 ";
}
}
/* We have "filename". Figure out directory this source
- file is coming from and put it on the front of the list. */
+ file is coming from and put it on the front of the list. */
- /* If -I- was specified, don't search current dir, only spec'd ones. */
+ /* If -I- was specified, don't search current dir, only spec'd ones. */
if (ignore_srcdir) break;
for (fp = &instack[indepth]; fp >= instack; fp--)
* code from case '<' is repeated here) and generates a warning.
* (Note: macro expansion of `xyz' takes precedence.)
*/
- if (retried && isalpha(*(U_CHAR *)(--fbeg))) {
+ if (retried && isalpha(*(U_CHAR *) (--fbeg))) {
while (fin != limit && (!isspace(*fin)))
*fend++ = *fin++;
warning ("VAX-C-style include specification found, use '#include <filename.h>' !");
}
/* Yield nonzero if FILENAME is absolute (i.e. not relative). */
+
static int
absolute_filename (filename)
char *filename;
} else {
/* Cannot count its file size before reading.
First read the entire file into heap and
- copy them into buffer on stack. */
+ copy them into buffer on stack. */
int bsize = 2000;
int st_size = 0;
the address of the buffer following the preconditions. The buffer, in
this case, should never be freed because various pieces of it will
be referred to until all precompiled strings are output at the end of
- the run.
-*/
+ the run. */
+
static char *
check_precompiled (pcf, st, fname, limit)
int pcf;
*limit = buf + length;
- /* File is in core. Check the preconditions. */
+ /* File is in core. Check the preconditions. */
if (!check_preconditions (buf))
goto nope;
for (cp = buf; *cp; cp++)
precompiled header. These are a series of #define and #undef
lines which must match the current contents of the hash
table. */
+
static int
check_preconditions (prec)
char *prec;
/* Process the main body of a precompiled file. BUF points to the
string section of the file, following the preconditions. LIMIT is one
character past the end. NAME is the name of the file being read
- in. OP is the main output buffer */
+ in. OP is the main output buffer. */
+
static void
pcfinclude (buf, limit, name, op)
U_CHAR *buf, *limit, *name;
nstrings = (nstrings << 8) | *cp++;
nstrings = (nstrings << 8) | *cp++;
- /* Looping over each string... */
+ /* Looping over each string... */
while (nstrings--) {
U_CHAR *string_start;
U_CHAR *endofthiskey;
if ((HOST_WIDE_INT) cp & 3)
cp += 4 - ((HOST_WIDE_INT) cp & 3);
- /* Now get the string. */
+ /* Now get the string. */
str = (STRINGDEF *) (GENERIC_PTR) cp;
string_start = cp += sizeof (STRINGDEF);
/* We need to macro expand the string here to ensure that the
proper definition environment is in place. If it were only
expanded when we find out it is needed, macros necessary for
- its proper expansion might have had their definitions changed. */
+ its proper expansion might have had their definitions changed. */
tmpbuf = expand_to_temp_buffer (string_start, cp++, 0, 0);
/* Lineno is already set in the precompiled file */
str->contents = tmpbuf.buf;
*stringlist_tailp = str;
stringlist_tailp = &str->chain;
- /* Next comes a fourbyte number indicating the number of keys */
- /* for this string. */
+ /* Next comes a fourbyte number indicating the number of keys
+ for this string. */
nkeys = *cp++;
nkeys = (nkeys << 8) | *cp++;
nkeys = (nkeys << 8) | *cp++;
nkeys = (nkeys << 8) | *cp++;
- /* If this number is -1, then the string is mandatory. */
+ /* If this number is -1, then the string is mandatory. */
if (nkeys == -1)
str->writeflag = 1;
else
cp += sizeof (KEYDEF);
/* Find the end of the key. At the end of this for loop we
- advance CP to the start of the next key using this variable. */
+ advance CP to the start of the next key using this variable. */
endofthiskey = cp + strlen ((char *) cp);
kp->str = str;
- /* Expand the key, and enter it into the hash table. */
+ /* Expand the key, and enter it into the hash table. */
tmpbuf = expand_to_temp_buffer (cp, endofthiskey, 0, 0);
tmpbuf.bufp = tmpbuf.buf;
}
/* This output_line_directive serves to switch us back to the current
input file in case some of these strings get output (which will
- result in line directives for the header file being output). */
+ result in line directives for the header file being output). */
output_line_directive (&instack[indepth], op, 0, enter_file);
}
-/* Called from rescan when it hits a key for strings. Mark them all */
- /* used and clean up. */
+/* Called from rescan when it hits a key for strings. Mark them all
+ used and clean up. */
+
static void
pcstring_used (hp)
HASHNODE *hp;
delete_macro (hp);
}
-/* Write the output, interspersing precompiled strings in their */
- /* appropriate places. */
+/* Write the output, interspersing precompiled strings in their
+ appropriate places. */
+
static void
write_output ()
{
char *line_directive = xmalloc (line_directive_len);
int len;
- /* In each run through the loop, either cur_buf_loc == */
- /* next_string_loc, in which case we print a series of strings, or */
- /* it is less than next_string_loc, in which case we write some of */
- /* the buffer. */
+ /* In each run through the loop, either cur_buf_loc ==
+ next_string_loc, in which case we print a series of strings, or
+ it is less than next_string_loc, in which case we write some of
+ the buffer. */
cur_buf_loc = outbuf.buf;
next_string = stringlist;
appeared. So the arglist is just convenience data passed
between these two routines. It is not kept around after
the current #define has been processed and entered into the
- hash table. */
+ hash table. */
struct arglist {
struct arglist *next;
};
/* Create a DEFINITION node from a #define directive. Arguments are
- as for do_define. */
+ as for do_define. */
+
static MACRODEF
create_definition (buf, limit, op)
U_CHAR *buf, *limit;
/* Lossage will occur if identifiers or control keywords are broken
across lines using backslash. This is not the right place to take
- care of that. */
+ care of that. */
if (*bp == '(') {
struct arglist *arg_ptrs = NULL;
++bp; /* skip paren */
SKIP_WHITE_SPACE (bp);
- /* now everything from bp before limit is the definition. */
+ /* now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, argno, arg_ptrs);
defn->rest_args = rest_args;
}
}
}
- /* Now everything from bp before limit is the definition. */
+ /* Now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, -1, NULL_PTR);
defn->args.argnames = (U_CHAR *) "";
}
return sym_length;
}
-/*
- * return zero if two DEFINITIONs are isomorphic
- */
+/* Return zero if two DEFINITIONs are isomorphic. */
+
static int
compare_defs (d1, d2)
DEFINITION *d1, *d2;
/* Scan thru the replacement list, ignoring comments and quoted
strings, picking up on the macro calls. It does a linear search
thru the arg list on every potential symbol. Profiling might say
- that something smarter should happen. */
+ that something smarter should happen. */
if (end < buf)
abort ();
/* Lossage will occur if identifiers or control tokens are broken
across lines using backslash. This is not the right place to take
- care of that. */
+ care of that. */
if (*bp != '(') {
error ("missing token-sequence in `#assert'");
/* Lossage will occur if identifiers or control tokens are broken
across lines using backslash. This is not the right place to take
- care of that. */
+ care of that. */
if (*bp == '(') {
int error_flag = 0;
}
}
\f
-/*
- * Install a name in the assertion hash table.
- *
- * If LEN is >= 0, it is the length of the name.
- * Otherwise, compute the length by scanning the entire name.
- *
- * If HASH is >= 0, it is the precomputed hash code.
- * Otherwise, compute the hash code.
- */
+/* Install a name in the assertion hash table.
+
+ If LEN is >= 0, it is the length of the name.
+ Otherwise, compute the length by scanning the entire name.
+
+ If HASH is >= 0, it is the precomputed hash code.
+ Otherwise, compute the hash code. */
+
static ASSERTION_HASHNODE *
assertion_install (name, len, hash)
U_CHAR *name;
return hp;
}
-/*
- * find the most recent hash node for name name (ending with first
- * non-identifier char) installed by install
- *
- * If LEN is >= 0, it is the length of the name.
- * Otherwise, compute the length by scanning the entire name.
- *
- * If HASH is >= 0, it is the precomputed hash code.
- * Otherwise, compute the hash code.
- */
+/* Find the most recent hash node for name name (ending with first
+ non-identifier char) installed by install
+
+ If LEN is >= 0, it is the length of the name.
+ Otherwise, compute the length by scanning the entire name.
+
+ If HASH is >= 0, it is the precomputed hash code.
+ Otherwise, compute the hash code. */
+
static ASSERTION_HASHNODE *
assertion_lookup (name, len, hash)
U_CHAR *name;
if (hp->next != NULL)
hp->next->prev = hp->prev;
- /* make sure that the bucket chain header that
- the deleted guy was on points to the right thing afterwards. */
+ /* Make sure that the bucket chain header that the deleted guy was
+ on points to the right thing afterwards. */
if (hp == *hp->bucket_hdr)
*hp->bucket_hdr = hp->next;
return 0;
}
-/*
- * remove the definition of a symbol from the symbol table.
- * according to un*x /lib/cpp, it is not an error to undef
- * something that has no definitions, so it isn't one here either.
- */
+/* Remove the definition of a symbol from the symbol table.
+ according to un*x /lib/cpp, it is not an error to undef
+ something that has no definitions, so it isn't one here either. */
static int
do_undef (buf, limit, op, keyword)
return 0;
}
\f
-/*
- * Report an error detected by the program we are processing.
- * Use the text of the line in the error message.
- * (We use error because it prints the filename & line#.)
- */
+/* Report an error detected by the program we are processing.
+ Use the text of the line in the error message.
+ (We use error because it prints the filename & line#.) */
static int
do_error (buf, limit, op, keyword)
return 0;
}
-/*
- * Report a warning detected by the program we are processing.
- * Use the text of the line in the warning message, then continue.
- * (We use error because it prints the filename & line#.)
- */
+/* Report a warning detected by the program we are processing.
+ Use the text of the line in the warning message, then continue.
+ (We use error because it prints the filename & line#.) */
static int
do_warning (buf, limit, op, keyword)
/* This was a fun hack, but #pragma seems to start to be useful.
By failing to recognize it, we pass it through unchanged to cc1. */
-/*
- * the behavior of the #pragma directive is implementation defined.
- * this implementation defines it as follows.
- */
+/* The behavior of the #pragma directive is implementation defined.
+ this implementation defines it as follows. */
static int
do_pragma ()
#endif /* defined (SCCS_DIRECTIVE) */
\f
-/*
- * handle #if directive by
- * 1) inserting special `defined' keyword into the hash table
- * that gets turned into 0 or 1 by special_symbol (thus,
- * if the luser has a symbol called `defined' already, it won't
- * work inside the #if directive)
- * 2) rescan the input into a temporary output buffer
- * 3) pass the output buffer to the yacc parser and collect a value
- * 4) clean up the mess left from steps 1 and 2.
- * 5) call conditional_skip to skip til the next #endif (etc.),
- * or not, depending on the value from step 3.
- */
+/* Handle #if directive by
+ 1) inserting special `defined' keyword into the hash table
+ that gets turned into 0 or 1 by special_symbol (thus,
+ if the luser has a symbol called `defined' already, it won't
+ work inside the #if directive)
+ 2) rescan the input into a temporary output buffer
+ 3) pass the output buffer to the yacc parser and collect a value
+ 4) clean up the mess left from steps 1 and 2.
+ 5) call conditional_skip to skip til the next #endif (etc.),
+ or not, depending on the value from step 3. */
static int
do_if (buf, limit, op, keyword)
return 0;
}
-/*
- * handle a #elif directive by not changing if_stack either.
- * see the comment above do_else.
- */
+/* Handle a #elif directive by not changing if_stack either.
+ see the comment above do_else. */
static int
do_elif (buf, limit, op, keyword)
return 0;
}
-/*
- * evaluate a #if expression in BUF, of length LENGTH,
- * then parse the result as a C expression and return the value as an int.
- */
+/* Evaluate a #if expression in BUF, of length LENGTH, then parse the
+ result as a C expression and return the value as an int. */
+
static HOST_WIDE_INT
eval_if_expression (buf, length)
U_CHAR *buf;
return value;
}
-/*
- * routine to handle ifdef/ifndef. Try to look up the symbol,
- * then do or don't skip to the #endif/#else/#elif depending
- * on what directive is actually being processed.
- */
+/* routine to handle ifdef/ifndef. Try to look up the symbol, then do
+ or don't skip to the #endif/#else/#elif depending on what directive
+ is actually being processed. */
static int
do_xifdef (buf, limit, op, keyword)
}
}
-/*
- * skip to #endif, #else, or #elif. adjust line numbers, etc.
- * leaves input ptr at the sharp sign found.
- * If ANY is nonzero, return at next directive of any sort.
- */
+/* Skip to #endif, #else, or #elif. adjust line numbers, etc.
+ Leaves input ptr at the sharp sign found.
+ If ANY is nonzero, return at next directive of any sort. */
+
static void
skip_if_group (ip, any, op)
FILE_BUF *ip;
}
}
-/*
- * handle a #else directive. Do this by just continuing processing
- * without changing if_stack ; this is so that the error message
- * for missing #endif's etc. will point to the original #if. It
- * is possible that something different would be better.
- */
+/* Handle a #else directive. Do this by just continuing processing
+ without changing if_stack ; this is so that the error message
+ for missing #endif's etc. will point to the original #if. It
+ is possible that something different would be better. */
static int
do_else (buf, limit, op, keyword)
return 0;
}
-/*
- * unstack after #endif directive
- */
+/* Unstack after #endif directive. */
static int
do_endif (buf, limit, op, keyword)
/* When an #else or #endif is found while skipping failed conditional,
if -pedantic was specified, this is called to warn about text after
- the directive name. P points to the first char after the directive name. */
+ the directive name. P points to the first char after the directive
+ name. */
static void
validate_else (p, limit)
counter is not sufficient to deal with newlines in the string.
If NOWARN is nonzero, don't warn about slash-star inside a comment.
- This feature is useful when processing a comment that is going to be
- processed or was processed at another point in the preprocessor,
- to avoid a duplicate warning. Likewise for unterminated comment errors. */
+ This feature is useful when processing a comment that is going to
+ be processed or was processed at another point in the preprocessor,
+ to avoid a duplicate warning. Likewise for unterminated comment
+ errors. */
static U_CHAR *
skip_to_end_of_comment (ip, line_counter, nowarn)
return bp;
}
-/*
- * Skip over a quoted string. BP points to the opening quote.
- * Returns a pointer after the closing quote. Don't go past LIMIT.
- * START_LINE is the line number of the starting point (but it need
- * not be valid if the starting point is inside a macro expansion).
- *
- * The input stack state is not changed.
- *
- * If COUNT_NEWLINES is nonzero, it points to an int to increment
- * for each newline passed.
- *
- * If BACKSLASH_NEWLINES_P is nonzero, store 1 thru it
- * if we pass a backslash-newline.
- *
- * If EOFP is nonzero, set *EOFP to 1 if the string is unterminated.
- */
+/* Skip over a quoted string. BP points to the opening quote.
+ Returns a pointer after the closing quote. Don't go past LIMIT.
+ START_LINE is the line number of the starting point (but it need
+ not be valid if the starting point is inside a macro expansion).
+
+ The input stack state is not changed.
+
+ If COUNT_NEWLINES is nonzero, it points to an int to increment
+ for each newline passed.
+
+ If BACKSLASH_NEWLINES_P is nonzero, store 1 thru it
+ if we pass a backslash-newline.
+
+ If EOFP is nonzero, set *EOFP to 1 if the string is unterminated. */
+
static U_CHAR *
skip_quoted_string (bp, limit, start_line, count_newlines, backslash_newlines_p, eofp)
register U_CHAR *bp;
} else if (c == '\n') {
if (traditional) {
/* Unterminated strings and character constants are 'valid'. */
- bp--; /* Don't consume the newline. */
+ bp--; /* Don't consume the newline. */
if (eofp)
*eofp = 1;
break;
/* Place into DST a quoted string representing the string SRC.
Return the address of DST's terminating null. */
+
static char *
quote_string (dst, src)
char *dst, *src;
return p;
}
\f
-/*
- * write out a #line directive, for instance, after an #include file.
- * If CONDITIONAL is nonzero, we can omit the #line if it would
- * appear to be a no-op, and we can output a few newlines instead
- * if we want to increase the line number by a small amount.
- * FILE_CHANGE says whether we are entering a file, leaving, or neither.
- */
+/* Write out a #line directive, for instance, after an #include file.
+ If CONDITIONAL is nonzero, we can omit the #line if it would
+ appear to be a no-op, and we can output a few newlines instead
+ if we want to increase the line number by a small amount.
+ FILE_CHANGE says whether we are entering a file, leaving, or neither. */
static void
output_line_directive (ip, op, conditional, file_change)
if (rest_args)
continue;
if (i < nargs || (nargs == 0 && i == 0)) {
- /* if we are working on last arg which absorbs rest of args... */
+ /* If we are working on last arg which absorbs rest of args... */
if (i == nargs - 1 && defn->rest_args)
rest_args = 1;
parse_error = macarg (&args[i], rest_args);
abort ();
}
- /* if there is anything left of the definition
- after handling the arg list, copy that in too. */
+ /* If there is anything left of the definition after handling
+ the arg list, copy that in too. */
for (i = offset; i < defn->length; i++) {
/* if we've reached the end of the macro */
}
}
\f
-/*
- * Parse a macro argument and store the info on it into *ARGPTR.
- * REST_ARGS is passed to macarg1 to make it absorb the rest of the args.
- * Return nonzero to indicate a syntax error.
- */
+/* Parse a macro argument and store the info on it into *ARGPTR.
+ REST_ARGS is passed to macarg1 to make it absorb the rest of the args.
+ Return nonzero to indicate a syntax error. */
static char *
macarg (argptr, rest_args)
return obp - start;
}
\f
-/*
- * my_strerror - return the descriptive text associated with an `errno' code.
- */
+/* my_strerror - return the descriptive text associated with an
+ `errno' code. */
char *
my_strerror (errnum)
return result;
}
-/*
- * error - print error message and increment count of errors.
- */
+/* error - print error message and increment count of errors. */
void
error (PRINTF_ALIST (msg))
fprintf (stderr, "\n");
}
-/* print an error message and maybe count it. */
+/* Print an error message and maybe count it. */
void
pedwarn (PRINTF_ALIST (msg))
/* You might think void was cleaner for the return type,
but that would get type mismatch in check_expand in strict ANSI. */
+
static int
grow_outbuf (obuf, needed)
register FILE_BUF *obuf;
* Otherwise, compute the length by scanning the entire name.
*
* If HASH is >= 0, it is the precomputed hash code.
- * Otherwise, compute the hash code.
+ * Otherwise, compute the hash code.
*/
+
static HASHNODE *
install (name, len, type, value, hash)
U_CHAR *name;
* If HASH is >= 0, it is the precomputed hash code.
* Otherwise, compute the hash code.
*/
+
HASHNODE *
lookup (name, len, hash)
U_CHAR *name;
if (hp->next != NULL)
hp->next->prev = hp->prev;
- /* make sure that the bucket chain header that
- the deleted guy was on points to the right thing afterwards. */
+ /* Make sure that the bucket chain header that the deleted guy was
+ on points to the right thing afterwards. */
if (hp == *hp->bucket_hdr)
*hp->bucket_hdr = hp->next;
* return hash function on name. must be compatible with the one
* computed a step at a time, elsewhere
*/
+
static int
hashf (name, len, hashsize)
register U_CHAR *name;
\f
/* Dump the definition of a single macro HP to OF. */
+
static void
dump_single_macro (hp, of)
register HASHNODE *hp;
for (kt = directive_table; kt->type != T_ASSERT; kt++)
;
- /* pass NULL as output ptr to do_define since we KNOW it never
- does any output.... */
+ /* Pass NULL as output ptr to do_define since we KNOW it never does
+ any output.... */
do_assert (buf, buf + strlen ((char *) buf) , NULL_PTR, kt);
--indepth;
}
\f
#ifdef VMS
-/* Under VMS we need to fix up the "include" specification
- filename so that everything following the 1st slash is
- changed into its correct VMS file specification. */
+/* Under VMS we need to fix up the "include" specification filename so
+ that everything following the 1st slash is changed into its correct
+ VMS file specification. */
static void
hack_vms_include_specification (fname)
needed to get things working properly.
If no device is specified, then the first directory name is taken to be
- a device name (or a rooted logical). */
+ a device name (or a rooted logical). */
/* See if we found that 1st slash */
if (cp == 0) return; /* Nothing to do!!! */
/* If there are no other slashes then the filename will be
in the "root" directory. Otherwise, we need to add
- directory specifications. */
+ directory specifications. */
if (index (cp1, '/') == 0) {
/* Just add "000000]" as the directory string */
strcpy (cp2, "000000]");
cp2 += strlen (cp2);
check_filename_before_returning = 1; /* we might need to fool with this later */
} else {
- /* As long as there are still subdirectories to add, do them. */
+ /* As long as there are still subdirectories to add, do them. */
while (index (cp1, '/') != 0) {
/* If this token is "." we can ignore it */
if ((cp1[0] == '.') && (cp1[1] == '/')) {
/* Now add the filename */
while (*cp1) *cp2++ = *cp1++;
*cp2 = 0;
- /* Now append it to the original VMS spec. */
+ /* Now append it to the original VMS spec. */
strcpy (cp, Local);
/* If we put a [000000] in the filename, try to open it first. If this fails,
"mbc=16" - Set multi-block count to 16 (use a 8192 byte buffer).
"deq=64" - When extending the file, extend it in chunks of 32Kbytes.
"fop=tef"- Truncate unused portions of file when closing file.
- "shr=nil"- Disallow file sharing while file is open.
- */
+ "shr=nil"- Disallow file sharing while file is open. */
static FILE *
freopen (fname, type, oldfile)
#endif
#ifndef NULL_PTR
-#define NULL_PTR ((GENERIC_PTR)0)
+#define NULL_PTR ((GENERIC_PTR) 0)
#endif
/* Find the largest host integer type and set its size and type.
Boston, MA 02111-1307, USA. */
-/* Build tables of static constructors and destructors and run ld. */
+/* Build tables of static constructors and destructors and run ld. */
#include "config.h"
#include <sys/types.h>
int do_collecting = 0;
#endif
\f
-/* Linked lists of constructor and destructor names. */
+/* Linked lists of constructor and destructor names. */
struct id
{
static int temp_filename_length; /* Length of temp_filename */
static char *temp_filename; /* Base of temp filenames */
-static char *c_file; /* <xxx>.c for constructor/destructor list. */
-static char *o_file; /* <xxx>.o for constructor/destructor list. */
-static char *export_file; /* <xxx>.x for AIX export list. */
+static char *c_file; /* <xxx>.c for constructor/destructor list. */
+static char *o_file; /* <xxx>.o for constructor/destructor list. */
+static char *export_file; /* <xxx>.x for AIX export list. */
char *ldout; /* File for ld errors. */
static char *output_file; /* Output file for ld. */
static char *nm_file_name; /* pathname of nm */
struct prefix_list
{
- char *prefix; /* String to prepend to the path. */
- struct prefix_list *next; /* Next in linked list. */
+ char *prefix; /* String to prepend to the path. */
+ struct prefix_list *next; /* Next in linked list. */
};
struct path_prefix
}
\f
-/* Die when sys call fails. */
+/* Die when sys call fails. */
void
fatal_perror (string, arg1, arg2, arg3)
collect_exit (1);
}
-/* Just die. */
+/* Just die. */
void
fatal (string, arg1, arg2, arg3)
return ptr;
fatal ("out of memory");
- return (char *)0;
+ return (char *) 0;
}
char *
return ptr;
fatal ("out of memory");
- return (char *)0;
+ return (char *) 0;
}
char *
/* Search for NAME using prefix list PPREFIX. We only look for executable
files.
- Return 0 if not found, otherwise return its name, allocated with malloc. */
+ Return 0 if not found, otherwise return its name, allocated with malloc. */
static char *
find_a_file (pprefix, name)
}
}
\f
-/* Main program. */
+/* Main program. */
int
main (argc, argv)
*ld1++ = *ld2++ = ld_file_name;
- /* Make temp file names. */
+ /* Make temp file names. */
temp_filename = choose_temp_base ();
temp_filename_length = strlen (temp_filename);
c_file = xcalloc (temp_filename_length + sizeof (".c"), 1);
If you propose to make GCC pass some other option,
just imagine what will happen if ld is really ld!!! */
- /* Parse arguments. Remember output file spec, pass the rest to ld. */
+ /* Parse arguments. Remember output file spec, pass the rest to ld. */
/* After the first file, put in the c++ rt0. */
first_file = 1;
- while ((arg = *++argv) != (char *)0)
+ while ((arg = *++argv) != (char *) 0)
{
*ld1++ = *ld2++ = arg;
break;
}
}
- else if ((p = rindex (arg, '.')) != (char *)0
+ else if ((p = rindex (arg, '.')) != (char *) 0
&& (strcmp (p, ".o") == 0 || strcmp (p, ".a") == 0))
{
if (first_file)
*ld1++ = buf;
*ld2++ = buf;
exportf = fopen (export_file, "w");
- if (exportf == (FILE *)0)
+ if (exportf == (FILE *) 0)
fatal_perror ("%s", export_file);
write_export_file (exportf);
if (fclose (exportf))
#endif
*c_ptr++ = c_file;
- *object = *c_ptr = *ld1 = (char *)0;
+ *object = *c_ptr = *ld1 = (char *) 0;
if (vflag)
{
maybe_unlink(output_file);
outf = fopen (c_file, "w");
- if (outf == (FILE *)0)
+ if (outf == (FILE *) 0)
fatal_perror ("%s", c_file);
write_c_file (outf, c_file);
*ld2++ = LD_FINI_SWITCH;
*ld2++ = fininame;
#endif
- *ld2 = (char*)0;
+ *ld2 = (char*) 0;
#ifdef COLLECT_EXPORT_LIST
if (shared_obj)
add_to_list (&exports, "_GLOBAL__DI");
add_to_list (&exports, "_GLOBAL__DD");
exportf = fopen (export_file, "w");
- if (exportf == (FILE *)0)
+ if (exportf == (FILE *) 0)
fatal_perror ("%s", export_file);
write_export_file (exportf);
if (fclose (exportf))
}
/* Assemble the constructor and destructor tables.
- Link the tables in with the rest of the program. */
+ Link the tables in with the rest of the program. */
fork_execute ("gcc", c_argv);
fork_execute ("ld", ld2_argv);
}
\f
-/* Wait for a process to finish, and exit if a non-zero status is found. */
+/* Wait for a process to finish, and exit if a non-zero status is found. */
int
collect_wait (prog)
else
fprintf (stderr, "[cannot find %s]", prog);
- for (p_argv = &argv[1]; (str = *p_argv) != (char *)0; p_argv++)
+ for (p_argv = &argv[1]; (str = *p_argv) != (char *) 0; p_argv++)
fprintf (stderr, " %s", str);
fprintf (stderr, "\n");
}
}
-/* Write the constructor/destructor tables. */
+/* Write the constructor/destructor tables. */
static void
write_c_file_glob (stream, name)
nm_argv[argc++] = NM_FLAGS;
nm_argv[argc++] = prog_name;
- nm_argv[argc++] = (char *)0;
+ nm_argv[argc++] = (char *) 0;
if (pipe (pipe_fd) < 0)
fatal_perror ("pipe");
inf = fdopen (pipe_fd[0], "r");
- if (inf == (FILE *)0)
+ if (inf == (FILE *) 0)
fatal_perror ("fdopen");
/* Trace if needed. */
char **p_argv;
char *str;
- for (p_argv = &nm_argv[0]; (str = *p_argv) != (char *)0; p_argv++)
+ for (p_argv = &nm_argv[0]; (str = *p_argv) != (char *) 0; p_argv++)
fprintf (stderr, " %s", str);
fprintf (stderr, "\n");
fprintf (stderr, "\nnm output with constructors/destructors.\n");
/* Read each line of nm output. */
- while (fgets (buf, sizeof buf, inf) != (char *)0)
+ while (fgets (buf, sizeof buf, inf) != (char *) 0)
{
int ch, ch2;
char *name, *end;
/* If it contains a constructor or destructor name, add the name
- to the appropriate list. */
+ to the appropriate list. */
for (p = buf; (ch = *p) != '\0' && ch != '\n' && ch != '_'; p++)
if (ch == ' ' && p[1] == 'U' && p[2] == ' ')
int ch, ch2;
char *name, *end, *p = buf;
- /* Extract names of libraries and add to list. */
+ /* Extract names of libraries and add to list. */
PARSE_LDD_OUTPUT (p);
if (p == 0)
continue;
if (strncmp (name, "not found", sizeof ("not found") - 1) == 0)
fatal ("dynamic dependency %s not found", buf);
- /* Find the end of the symbol name. */
+ /* Find the end of the symbol name. */
for (end = p;
(ch2 = *end) != '\0' && ch2 != '\n' && !isspace (ch2) && ch2 != '|';
end++)
#ifdef XCOFF_DEBUGGING_INFO
/* All AIX function names have a duplicate entry beginning
- with a dot. */
+ with a dot. */
if (*name == '.')
++name;
#endif
fatal ("%s: can't read loader section", soname);
/*fprintf (stderr, "\tscanning %s\n", soname);*/
symcnt = soldh.l_nsyms;
- lsyms = (LDSYM*) alloca (symcnt * sizeof (*lsyms));
+ lsyms = (LDSYM *) alloca (symcnt * sizeof (*lsyms));
symcnt = FREAD (lsyms, sizeof (*lsyms), symcnt, libptr);
ldstrings = alloca (soldh.l_stlen);
FSEEK (libptr, soldsh.s_scnptr+soldh.l_stoff, BEGINNING);
static void add_func_table PROTO((mo_header_t *, load_all_t *,
symbol_info_t *, int));
static void print_header PROTO((mo_header_t *));
-static void print_load_command PROTO((load_union_t*, size_t, int));
+static void print_load_command PROTO((load_union_t *, size_t, int));
static void bad_header PROTO((int));
static struct file_info *read_file PROTO((char *, int, int));
static void end_file PROTO((struct file_info *));
continue;
str_sect = load_array[load_hdr->sym.symc_strings_section].section;
- if (str_sect == (char *)0)
+ if (str_sect == (char *) 0)
fatal ("string section missing");
- if (load_cmd->section == (char *)0)
+ if (load_cmd->section == (char *) 0)
fatal ("section pointer missing");
num_syms = load_hdr->sym.symc_nentries;
do anything, since in the current version, you cannot do mallocs
and such in the constructors. */
- if (main_sym != (symbol_info_t *)0
+ if (main_sym != (symbol_info_t *) 0
&& ((hdr.moh_flags & MOH_EXECABLE_F) == 0))
add_func_table (&hdr, load_array, main_sym, FNTC_INITIALIZATION);
if (debug)
print_load_command (load_hdr, offset, i);
- bcopy ((char *)load_hdr, (char *)(obj + offset), size);
+ bcopy ((char *) load_hdr, (char *) (obj + offset), size);
offset += size;
}
}
load_cmd = &load_array[load_index];
load_cmd->load = ptr;
- load_cmd->section = (char *)0;
+ load_cmd->section = (char *) 0;
/* Fill in func table load command. */
ptr->func.ldc_header.ldci_cmd_type = LDC_FUNC_TABLE;
int number;
{
mo_long_t type = load_hdr->hdr.ldci_cmd_type;
- char *type_str = (char *)0;
+ char *type_str = (char *) 0;
switch (type)
{
(long) load_hdr->hdr.ldci_section_off,
(long) load_hdr->hdr.ldci_section_len);
- if (type_str == (char *)0)
+ if (type_str == (char *) 0)
fprintf (stderr, ", ty: unknown (%ld)\n", (long) type);
else if (type != LDC_REGION)
bad_header (status)
int status;
{
- char *msg = (char *)0;
+ char *msg = (char *) 0;
switch (status)
{
case MO_ERROR_UNSUPPORTED_VERS: msg = "unsupported version"; break;
}
- if (msg == (char *)0)
+ if (msg == (char *) 0)
fatal ("unknown {de,en}code_mach_o_hdr return value %d", status);
else
fatal ("%s", msg);
page_size = sysconf (_SC_PAGE_SIZE);
p->rounded_size = ((p->size + page_size - 1) / page_size) * page_size;
- p->start = mmap ((caddr_t)0,
+ p->start = mmap ((caddr_t) 0,
(rw) ? p->rounded_size : p->size,
(rw) ? (PROT_READ | PROT_WRITE) : PROT_READ,
MAP_FILE | MAP_VARIABLE | MAP_SHARED,
fd,
0L);
- if (p->start != (char *)0 && p->start != (char *)-1)
+ if (p->start != (char *) 0 && p->start != (char *) -1)
p->use_mmap = 1;
else
reg_last_set_invalid[i] is set non-zero when register I is being assigned
to and reg_last_set_table_tick[i] == label_tick. */
-/* Record last value assigned to (hard or pseudo) register n. */
+/* Record last value assigned to (hard or pseudo) register n. */
static rtx *reg_last_set_value;
static int *reg_last_set_label;
/* Record the value of label_tick when an expression involving register n
- is placed in reg_last_set_value. */
+ is placed in reg_last_set_value. */
static int *reg_last_set_table_tick;
static char *reg_last_set_invalid;
-/* Incremented for each label. */
+/* Incremented for each label. */
static int label_tick;
{
/* Before we can do this substitution, we must redo the test done
above (see detailed comments there) that ensures that I1DEST
- isn't mentioned in any SETs in NEWPAT that are field assignments. */
+ isn't mentioned in any SETs in NEWPAT that are field assignments. */
if (! combinable_i3pat (NULL_RTX, &newpat, i1dest, NULL_RTX,
0, NULL_PTR))
split = find_split_point (&XEXP (x, 2), insn);
if (split)
return split;
- /* ... fall through ... */
+ /* ... fall through ... */
case '2':
case 'c':
case '<':
split = find_split_point (&XEXP (x, 1), insn);
if (split)
return split;
- /* ... fall through ... */
+ /* ... fall through ... */
case '1':
/* Some machines have (and (shift ...) ...) insns. If X is not
an AND, but XEXP (X, 0) is, use it as our split point. */
|| GET_CODE (SET_DEST (x)) == PC))
fmt = "ie";
- /* Get the mode of operand 0 in case X is now a SIGN_EXTEND of a constant. */
+ /* Get the mode of operand 0 in case X is now a SIGN_EXTEND of a
+ constant. */
if (fmt[0] == 'e')
op0_mode = GET_MODE (XEXP (x, 0));
/* (neg (minus X Y)) can become (minus Y X). */
if (GET_CODE (XEXP (x, 0)) == MINUS
&& (! FLOAT_MODE_P (mode)
- /* x-y != -(y-x) with IEEE floating point. */
+ /* x-y != -(y-x) with IEEE floating point. */
|| TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
|| flag_fast_math))
return gen_binary (MINUS, mode, XEXP (XEXP (x, 0), 1),
XEXP (XEXP (x, 0), 0));
- /* (neg (xor A 1)) is (plus A -1) if A is known to be either 0 or 1. */
+ /* (neg (xor A 1)) is (plus A -1) if A is known to be either 0 or 1. */
if (GET_CODE (XEXP (x, 0)) == XOR && XEXP (XEXP (x, 0), 1) == const1_rtx
&& nonzero_bits (XEXP (XEXP (x, 0), 0), mode) == 1)
return gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), constm1_rtx);
case SIGN_EXTRACT:
case ZERO_EXTEND:
case SIGN_EXTEND:
- /* If we are processing SET_DEST, we are done. */
+ /* If we are processing SET_DEST, we are done. */
if (in_dest)
return x;
rtx temp;
int i;
- /* Simplify storing of the truth value. */
+ /* Simplify storing of the truth value. */
if (comparison_p && true == const_true_rtx && false == const0_rtx)
return gen_binary (true_code, mode, XEXP (cond, 0), XEXP (cond, 1));
- /* Also when the truth value has to be reversed. */
+ /* Also when the truth value has to be reversed. */
if (comparison_p && reversible_comparison_p (cond)
&& true == const0_rtx && false == const_true_rtx)
return gen_binary (reverse_condition (true_code),
temp = true, true = false, false = temp, cond = XEXP (x, 0);
- /* It is possible that the conditional has been simplified out. */
+ /* It is possible that the conditional has been simplified out. */
true_code = GET_CODE (cond);
comparison_p = GET_RTX_CLASS (true_code) == '<';
}
c1 = XEXP (t, 1), op = GET_CODE (t), z = f;
/* If an identity-zero op is commutative, check whether there
- would be a match if we swapped the operands. */
+ would be a match if we swapped the operands. */
else if ((GET_CODE (t) == PLUS || GET_CODE (t) == IOR
|| GET_CODE (t) == XOR)
&& rtx_equal_p (XEXP (t, 1), f))
#ifdef LOAD_EXTEND_OP
/* If we have (set FOO (subreg:M (mem:N BAR) 0)) with M wider than N, this
would require a paradoxical subreg. Replace the subreg with a
- zero_extend to avoid the reload that would otherwise be required. */
+ zero_extend to avoid the reload that would otherwise be required. */
if (GET_CODE (src) == SUBREG && subreg_lowpart_p (src)
&& LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (src))) != NIL
/* If we have (ior (and (X C1) C2)) and the next restart would be
the last, simplify this by making C1 as small as possible
- and then exit. */
+ and then exit. */
if (last
&& GET_CODE (x) == IOR && GET_CODE (op0) == AND
&& GET_CODE (XEXP (op0, 1)) == CONST_INT
rtx x;
{
rtx inner;
- rtx pos; /* Always counts from low bit. */
+ rtx pos; /* Always counts from low bit. */
int len;
rtx mask;
enum machine_mode compute_mode;
If it is mixed, we must adjust. */
/* If bytes are big endian and we had a paradoxical SUBREG, we must
- adjust OFFSET to compensate. */
+ adjust OFFSET to compensate. */
if (BYTES_BIG_ENDIAN
&& ! spans_byte
&& GET_MODE_SIZE (inner_mode) < GET_MODE_SIZE (is_mode))
/* Make POS_RTX unless we already have it and it is correct. If we don't
have a POS_RTX but we do have an ORIG_POS_RTX, the latter must
- be a CONST_INT. */
+ be a CONST_INT. */
if (pos_rtx == 0 && orig_pos_rtx != 0 && INTVAL (orig_pos_rtx) == pos)
pos_rtx = orig_pos_rtx;
break;
}
- /* ... fall through ... */
+ /* ... fall through ... */
case ASHIFTRT:
lhs = XEXP (x, 0);
{
case CLOBBER:
/* If X is a (clobber (const_int)), return it since we know we are
- generating something that won't match. */
+ generating something that won't match. */
return x;
case USE:
mode, mask, reg, next_select);
}
- /* ... fall through ... */
+ /* ... fall through ... */
case MINUS:
case MULT:
if (GET_MODE_BITSIZE (GET_MODE (x)) > HOST_BITS_PER_WIDE_INT)
{
- nonzero = ~(HOST_WIDE_INT)0;
+ nonzero = ~ (HOST_WIDE_INT) 0;
/* GET_MODE_BITSIZE (GET_MODE (x)) - INTVAL (XEXP (x, 1))
is the number of bits a full-width mask would have set.
lhs = XEXP (x, 0), rhs = XEXP (x, 1);
- /* If either operand is a primitive we can't do anything, so get out fast. */
+ /* If either operand is a primitive we can't do anything, so get out
+ fast. */
if (GET_RTX_CLASS (GET_CODE (lhs)) == 'o'
|| GET_RTX_CLASS (GET_CODE (rhs)) == 'o')
return x;
else
varop = gen_lowpart_for_combine (mode, varop);
- /* If we can't make the SUBREG, try to return what we were given. */
+ /* If we can't make the SUBREG, try to return what we were given. */
if (GET_CODE (varop) == CLOBBER)
return x ? x : varop;
bitwidth = GET_MODE_BITSIZE (mode);
- /* For a smaller object, just ignore the high bits. */
+ /* For a smaller object, just ignore the high bits. */
if (bitwidth < GET_MODE_BITSIZE (GET_MODE (x)))
return MAX (1, (num_sign_bit_copies (x, GET_MODE (x))
- (GET_MODE_BITSIZE (GET_MODE (x)) - bitwidth)));
return MAX (bitwidth - GET_MODE_BITSIZE (GET_MODE (x)) + 1,
num_sign_bit_copies (SUBREG_REG (x), mode));
- /* For a smaller object, just ignore the high bits. */
+ /* For a smaller object, just ignore the high bits. */
if (bitwidth <= GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))))
{
num0 = num_sign_bit_copies (SUBREG_REG (x), VOIDmode);
+ num_sign_bit_copies (XEXP (x, 0), VOIDmode));
case TRUNCATE:
- /* For a smaller object, just ignore the high bits. */
+ /* For a smaller object, just ignore the high bits. */
num0 = num_sign_bit_copies (XEXP (x, 0), VOIDmode);
return MAX (1, (num0 - (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))
- bitwidth)));
/* We need to determine what mode we will do the shift in. If the
shift is a right shift or a ROTATE, we must always do it in the mode
it was originally done in. Otherwise, we can do it in MODE, the
- widest mode encountered. */
+ widest mode encountered. */
shift_mode
= (code == ASHIFTRT || code == LSHIFTRT || code == ROTATE
? result_mode : mode);
/* Negative counts are invalid and should not have been made (a
programmer-specified negative count should have been handled
- above). */
+ above). */
else if (count < 0)
abort ();
continue;
}
- /* ... fall through ... */
+ /* ... fall through ... */
case LSHIFTRT:
case ASHIFT:
else if (GET_MODE (varop) != shift_mode)
varop = gen_lowpart_for_combine (shift_mode, varop);
- /* If we can't make the SUBREG, try to return what we were given. */
+ /* If we can't make the SUBREG, try to return what we were given. */
if (GET_CODE (varop) == CLOBBER)
return x ? x : varop;
enum machine_mode op_mode = GET_MODE (op0);
/* Strip the COMPARE from (REL_OP (compare X Y) 0) to get
- just (REL_OP X Y). */
+ just (REL_OP X Y). */
if (GET_CODE (op0) == COMPARE && op1 == const0_rtx)
{
op1 = XEXP (op0, 1);
op1 = SUBREG_REG (inner_op1);
/* The resulting comparison is always unsigned since we masked
- off the original sign bit. */
+ off the original sign bit. */
code = unsigned_condition (code);
changed = 1;
break;
case GE:
- /* >= C is equivalent to > (C - 1). */
+ /* >= C is equivalent to > (C - 1). */
if (const_op > 0)
{
const_op -= 1;
const_op -= 1;
op1 = GEN_INT (const_op);
code = LEU;
- /* ... fall through ... */
+ /* ... fall through ... */
}
/* (unsigned) < 0x80000000 is equivalent to >= 0. */
if (const_op == 0)
code = EQ;
- /* (unsigned) <= 0x7fffffff is equivalent to >= 0. */
+ /* (unsigned) <= 0x7fffffff is equivalent to >= 0. */
else if (const_op == ((HOST_WIDE_INT) 1 << (mode_width - 1)) - 1)
{
const_op = 0, op1 = const0_rtx;
const_op -= 1;
op1 = GEN_INT (const_op);
code = GTU;
- /* ... fall through ... */
+ /* ... fall through ... */
}
/* (unsigned) >= 0x80000000 is equivalent to < 0. */
continue;
}
- /* ... fall through ... */
+ /* ... fall through ... */
case SIGN_EXTRACT:
tem = expand_compound_operation (op0);
}
/* If we have NEG of something whose two high-order bits are the
- same, we know that "(-a) < 0" is equivalent to "a > 0". */
+ same, we know that "(-a) < 0" is equivalent to "a > 0". */
if (num_sign_bit_copies (op0, mode) >= 2)
{
op0 = XEXP (op0, 0);
continue;
}
- /* ... fall through ... */
+ /* ... fall through ... */
case ABS:
/* ABS is ignorable inside an equality comparison with zero. */
else
break;
- /* ... fall through ... */
+ /* ... fall through ... */
case ZERO_EXTEND:
if ((unsigned_comparison_p || equality_comparison_p)
continue;
}
- /* ... fall through ... */
+ /* ... fall through ... */
case LSHIFTRT:
/* If we have (compare (xshiftrt FOO N) (const_int C)) and
the low order N bits of FOO are known to be zero, we can do this
/* If this is a non-paradoxical SUBREG, get the value of its operand and
then convert it to the desired mode. If this is a paradoxical SUBREG,
- we cannot predict what values the "extra" bits might have. */
+ we cannot predict what values the "extra" bits might have. */
if (GET_CODE (x) == SUBREG
&& subreg_lowpart_p (x)
&& (GET_MODE_SIZE (GET_MODE (x))
regno = REGNO (x);
value = reg_last_set_value[regno];
- /* If we don't have a value or if it isn't for this basic block, return 0. */
+ /* If we don't have a value or if it isn't for this basic block,
+ return 0. */
if (value == 0
|| (reg_n_sets[regno] != 1
/* These routines are somewhat language-independent utility function
- intended to be called by the language-specific convert () functions. */
+ intended to be called by the language-specific convert () functions. */
#include "config.h"
#include "tree.h"
/* Convert EXPR to some pointer or reference type TYPE.
EXPR must be pointer, reference, integer, enumeral, or literal zero;
- in other cases error is called. */
+ in other cases error is called. */
tree
convert_to_pointer (type, expr)
/* Convert EXPR to some floating-point type TYPE.
EXPR must be float, integer, or enumeral;
- in other cases error is called. */
+ in other cases error is called. */
tree
convert_to_real (type, expr)
This file imports xmalloc and xrealloc, which are like malloc and
realloc except that they generate a fatal error if there is no
- available memory. */
+ available memory. */
#include <ctype.h>
#include <string.h>
We could avoid this if we could just get g++ to tell us what the actual
cplus marker character is as part of the debug information, perhaps by
ensuring that it is the character that terminates the gcc<n>_compiled
- marker symbol (FIXME). */
+ marker symbol (FIXME). */
#if !defined (CPLUS_MARKER)
#define CPLUS_MARKER '$'
}
/* Stuff that is shared between sub-routines.
- * Using a shared structure allows cplus_demangle to be reentrant. */
+ Using a shared structure allows cplus_demangle to be reentrant. */
struct work_stuff
{
typedef struct string /* Beware: these aren't required to be */
-{ /* '\0' terminated. */
+{ /* '\0' terminated. */
char *b; /* pointer to start of string */
char *p; /* pointer after last character */
char *e; /* pointer after end of allocated space */
/* Translate count to integer, consuming tokens in the process.
Conversion terminates on the first non-digit character.
Trying to consume something that isn't a count results in
- no consumption of input and a return of 0. */
+ no consumption of input and a return of 0. */
static int
consume_count (type)
{
if (opname[2] == 'a' && opname[5] == '\0')
{
- /* Assignment. */
+ /* Assignment. */
for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
{
if (strlen (optable[i].in) == 3
return (0);
}
-/* check to see whether MANGLED can match TEXT in the first TEXT_LEN
- characters. */
+/* Check to see whether MANGLED can match TEXT in the first TEXT_LEN
+ characters. */
int cplus_match (mangled, text, text_len)
const char *mangled;
recognize one of the gnu special forms rather than looking for a
standard prefix. In particular, don't worry about whether there
is a "__" string in the mangled string. Consider "_$_5__foo" for
- example. */
+ example. */
if ((AUTO_DEMANGLING || GNU_DEMANGLING))
{
{
char *demangled = NULL;
- /* Discard the remembered types, if any. */
+ /* Discard the remembered types, if any. */
forget_types (work);
if (work -> typevec != NULL)
}
/* If demangling was successful, ensure that the demangled string is null
- terminated and return it. Otherwise, free the demangling decl. */
+ terminated and return it. Otherwise, free the demangling decl. */
if (!success)
{
Demangling GNU style mangled names is nasty because there is no
explicit token that marks the start of the outermost function
- argument list.
-*/
+ argument list. */
static int
demangle_signature (work, mangled, declp)
/* ARM style demangling includes a specific 'F' character after
the class name. For GNU style, it is just implied. So we can
safely just consume any 'F' at this point and be compatible
- with either style. */
+ with either style. */
oldmangled = NULL;
func_done = 1;
so if we run into another '_' at this point we are dealing with
a mangled name that is either bogus, or has been mangled by
some algorithm we don't know how to deal with. So just
- reject the entire demangling. */
+ reject the entire demangling. */
success = 0;
break;
if (AUTO_DEMANGLING || GNU_DEMANGLING)
{
/* Assume we have stumbled onto the first outermost function
- argument token, and start processing args. */
+ argument token, and start processing args. */
func_done = 1;
success = demangle_args (work, mangled, declp);
}
/* Non-GNU demanglers use a specific token to mark the start
of the outermost function argument tokens. Typically 'F',
for ARM-demangling, for example. So if we find something
- we are not prepared for, it must be an error. */
+ we are not prepared for, it must be an error. */
success = 0;
}
break;
first case, and need to ensure that the '(void)' gets added to
the current declp. Note that with ARM, the first case
represents the name of a static data member 'foo::bar',
- which is in the current declp, so we leave it alone. */
+ which is in the current declp, so we leave it alone. */
success = demangle_args (work, mangled, declp);
}
}
if (scan != NULL)
{
/* We found a sequence of two or more '_', ensure that we start at
- the last pair in the sequence. */
+ the last pair in the sequence. */
i = strspn (scan, "_");
if (i > 2)
{
}
else if (ARM_DEMANGLING && scan[2] == 'p' && scan[3] == 't')
{
- /* Cfront-style parameterized type. Handled later as a signature. */
+ /* Cfront-style parameterized type. Handled later as a signature. */
success = 1;
/* ARM template? */
{
/* Mangled name does not start with "__" but does have one somewhere
in there with non empty stuff after it. Looks like a global
- function name. */
+ function name. */
demangle_function_name (work, mangled, declp, scan);
}
else
/* Found a GNU style virtual table, get past "_vt<CPLUS_MARKER>"
and create the decl. Note that we consume the entire mangled
input string, which means that demangle_signature has no work
- to do. */
+ to do. */
if ((*mangled)[2] == 'v')
(*mangled) += 5; /* New style, with thunks: "__vt_" */
else
if (success && (p == *mangled))
{
/* Consumed everything up to the cplus_marker, append the
- variable name. */
+ variable name. */
(*mangled)++;
string_append (declp, "::");
n = strlen (*mangled);
/* Found a ARM style virtual table, get past ARM_VTABLE_STRING
and create the decl. Note that we consume the entire mangled
input string, which means that demangle_signature has no work
- to do. */
+ to do. */
scan = *mangled + ARM_VTABLE_STRLEN;
while (*scan != '\0') /* first check it can be demangled */
{
return success;
/* Pick off the names and collect them in the temp buffer in the order
- in which they are found, separated by '::'. */
+ in which they are found, separated by '::'. */
while (qualifiers-- > 0)
{
/* If we are using the result as a function name, we need to append
the appropriate '::' separated constructor or destructor name.
We do this here because this is the most convenient place, where
- we already have a pointer to the name and the length of the name. */
+ we already have a pointer to the name and the length of the name. */
if (isfuncname && (work->constructor & 1 || work->destructor & 1))
{
}
/* Now either prepend the temp buffer to the result, or append it,
- depending upon the state of the append flag. */
+ depending upon the state of the append flag. */
if (append)
{
}
/* After picking off the function args, we expect to either find the
function return type (preceded by an '_') or the end of the
- string. */
+ string. */
if (!demangle_args (work, mangled, &decl)
|| (**mangled != '_' && **mangled != '\0'))
{
switch (**mangled)
{
- /* A qualified name, such as "Outer::Inner". */
+ /* A qualified name, such as "Outer::Inner". */
case 'Q':
success = demangle_qualified (work, mangled, result, 0, 1);
break;
int done = 0;
int success = 1;
- /* First pick off any type qualifiers. There can be more than one. */
+ /* First pick off any type qualifiers. There can be more than one. */
while (!done)
{
}
}
- /* Now pick off the fundamental type. There can be only one. */
+ /* Now pick off the fundamental type. There can be only one. */
switch (**mangled)
{
work -> typevec[work -> ntypes++] = tem;
}
-/* Forget the remembered types, but not the type vector itself. */
+/* Forget the remembered types, but not the type vector itself. */
static void
forget_types (work)
t--;
}
/* Validate the type index. Protect against illegal indices from
- malformed type strings. */
+ malformed type strings. */
if ((t < 0) || (t >= work -> ntypes))
{
return (0);
/* Consume the function name, including the "__" separating the name
from the signature. We are guaranteed that SCAN points to the
- separator. */
+ separator. */
(*mangled) = scan + 2;
/* See if we have an ARM style constructor or destructor operator.
If so, then just record it, clear the decl, and return.
We can't build the actual constructor/destructor decl until later,
- when we recover the class name from the signature. */
+ when we recover the class name from the signature. */
if (strcmp (declp -> b, "__ct") == 0)
{
{
if (declp->b[2] == 'a' && declp->b[5] == '\0')
{
- /* Assignment. */
+ /* Assignment. */
for (i = 0; i < sizeof (optable) / sizeof (optable[0]); i++)
{
if (strlen (optable[i].in) == 3
/* To generate a standalone demangler program for testing purposes,
just compile and link this file with -DMAIN and libiberty.a. When
run, it demangles each command line arg, or each stdin string, and
- prints the result on stdout. */
+ prints the result on stdout. */
#ifdef MAIN
#define MBUF_SIZE 512
char mbuffer[MBUF_SIZE];
-/* Defined in the automatically-generated underscore.c. */
+/* Defined in the automatically-generated underscore.c. */
extern int prepends_underscore;
int strip_underscore = 0;
{
int i = 0;
c = getchar ();
- /* Try to read a label. */
+ /* Try to read a label. */
while (c != EOF && (isalnum(c) || c == '_' || c == '$' || c == '.'))
{
if (i >= MBUF_SIZE-1)
}
/* IS_ERROR is 2 for "fatal" error, 1 for error, 0 for warning */
-void cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
+
+void
+cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
int is_error;
cpp_reader *pfile;
char *msg;
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding!
-Written by Per Bothner 1994. */
+Written by Per Bothner 1994. */
/* Parse a C expression from text in a string */
#endif
#ifndef NULL_PTR
-#define NULL_PTR ((GENERIC_PTR)0)
+#define NULL_PTR ((GENERIC_PTR) 0)
#endif
extern char *xmalloc ();
#define RIGHT_OPERAND_REQUIRED 2
#define HAVE_VALUE 4
/* SKIP_OPERAND is set for '&&' '||' '?' and ':' when the
- following operand should be short-circuited instead of evaluated. */
+ following operand should be short-circuited instead of evaluated. */
#define SKIP_OPERAND 8
/*#define UNSIGNEDP 16*/
struct operation {
short op;
- char rprio; /* Priority of op (relative to it right operand). */
+ char rprio; /* Priority of op (relative to it right operand). */
char flags;
char unsignedp; /* true if value should be treated as unsigned */
- HOST_WIDE_INT value; /* The value logically "right" of op. */
+ HOST_WIDE_INT value; /* The value logically "right" of op. */
};
\f
/* Take care of parsing a number (anything that starts with a digit).
else if (*p == '0')
base = 8;
- /* Some buggy compilers (e.g. MPW C) seem to need both casts. */
+ /* Some buggy compilers (e.g. MPW C) seem to need both casts. */
ULONG_MAX_over_base = ((unsigned long) -1) / ((unsigned long) base);
for (; len > 0; len--) {
{NULL, ERROR}
};
-/* Read one token. */
+/* Read one token. */
struct operation
cpp_lex (pfile)
pfile->limit = tok_start;
switch (token)
{
- case CPP_EOF: /* Should not happen ... */
+ case CPP_EOF: /* Should not happen ... */
case CPP_VSPACE:
op.op = 0;
return op;
return a >> b;
}
\f
-/* These priorities are all even, so we can handle associatively. */
+/* These priorities are all even, so we can handle associatively. */
#define PAREN_INNER_PRIO 0
#define COMMA_PRIO 4
#define COND_PRIO (COMMA_PRIO+2)
/* See if the token is an operand, in which case go to set_value.
If the token is an operator, figure out its left and right
- priorities, and then goto maybe_reduce. */
+ priorities, and then goto maybe_reduce. */
switch (op.op)
{
}
set_value:
- /* Push a value onto the stack. */
+ /* Push a value onto the stack. */
if (top->flags & HAVE_VALUE)
{
cpp_error (pfile, "syntax error in #if");
continue;
maybe_reduce:
- /* Push an operator, and check if we can reduce now. */
+ /* Push an operator, and check if we can reduce now. */
while (top->rprio > lprio)
{
long v1 = top[-1].value, v2 = top[0].value;
}
top++;
- /* Check for and handle stack overflow. */
+ /* Check for and handle stack overflow. */
if (top == limit)
{
struct operation *new_stack;
- int old_size = (char*)limit - (char*)stack;
+ int old_size = (char *) limit - (char *) stack;
int new_size = 2 * old_size;
if (stack != init_stack)
- new_stack = (struct operation*) xrealloc (stack, new_size);
+ new_stack = (struct operation *) xrealloc (stack, new_size);
else
{
- new_stack = (struct operation*) xmalloc (new_size);
+ new_stack = (struct operation *) xmalloc (new_size);
bcopy ((char *) stack, (char *) new_stack, old_size);
}
stack = new_stack;
- top = (struct operation*)((char*) new_stack + old_size);
- limit = (struct operation*)((char*) new_stack + new_size);
+ top = (struct operation *) ((char *) new_stack + old_size);
+ limit = (struct operation *) ((char *) new_stack + new_size);
}
top->flags = flags;
extern char *xmalloc PARAMS ((unsigned));
-/*
- * return hash function on name. must be compatible with the one
- * computed a step at a time, elsewhere
- */
+/* Return hash function on name. must be compatible with the one
+ computed a step at a time, elsewhere */
+
int
hashf (name, len, hashsize)
register const U_CHAR *name;
return MAKE_POS (r) % hashsize;
}
-/*
- * find the most recent hash node for name name (ending with first
- * non-identifier char) installed by install
- *
- * If LEN is >= 0, it is the length of the name.
- * Otherwise, compute the length by scanning the entire name.
- *
- * If HASH is >= 0, it is the precomputed hash code.
- * Otherwise, compute the hash code.
- */
+/* Find the most recent hash node for name name (ending with first
+ non-identifier char) installed by install
+
+ If LEN is >= 0, it is the length of the name.
+ Otherwise, compute the length by scanning the entire name.
+
+ If HASH is >= 0, it is the precomputed hash code.
+ Otherwise, compute the hash code. */
+
HASHNODE *
cpp_lookup (pfile, name, len, hash)
cpp_reader *pfile;
return bucket;
bucket = bucket->next;
}
- return (HASHNODE*) 0;
+ return (HASHNODE *) 0;
}
/*
hp->next->prev = hp->prev;
/* make sure that the bucket chain header that
- the deleted guy was on points to the right thing afterwards. */
+ the deleted guy was on points to the right thing afterwards. */
if (hp == *hp->bucket_hdr)
*hp->bucket_hdr = hp->next;
free (hp);
}
-/*
- * install a name in the main hash table, even if it is already there.
- * name stops with first non alphanumeric, except leading '#'.
- * caller must check against redefinition if that is desired.
- * delete_macro () removes things installed by install () in fifo order.
- * this is important because of the `defined' special symbol used
- * in #if, and also if pushdef/popdef directives are ever implemented.
- *
- * If LEN is >= 0, it is the length of the name.
- * Otherwise, compute the length by scanning the entire name.
- *
- * If HASH is >= 0, it is the precomputed hash code.
- * Otherwise, compute the hash code.
- */
+
+/* Install a name in the main hash table, even if it is already there.
+ name stops with first non alphanumeric, except leading '#'.
+ caller must check against redefinition if that is desired.
+ delete_macro () removes things installed by install () in fifo order.
+ this is important because of the `defined' special symbol used
+ in #if, and also if pushdef/popdef directives are ever implemented.
+
+ If LEN is >= 0, it is the length of the name.
+ Otherwise, compute the length by scanning the entire name.
+
+ If HASH is >= 0, it is the precomputed hash code.
+ Otherwise, compute the hash code. */
+
HASHNODE *
install (name, len, type, ivalue, value, hash)
U_CHAR *name;
#define HASHSTEP(old, c) ((old << 2) + c)
#define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */
-extern HASHNODE* install PARAMS ((U_CHAR*,int,enum node_type, int,char*,int));
+extern HASHNODE *install PARAMS ((U_CHAR *,int,enum node_type, int,char *,int));
#endif /* USG */
#endif /* not VMS */
-/* This defines "errno" properly for VMS, and gives us EACCES. */
+/* This defines "errno" properly for VMS, and gives us EACCES. */
#include <errno.h>
extern char *index ();
#endif
#ifndef NULL_PTR
-#define NULL_PTR ((GENERIC_PTR)0)
+#define NULL_PTR ((GENERIC_PTR) 0)
#endif
#ifndef INCLUDE_LEN_FUDGE
struct assertion_hashnode *prev;
/* also, a back pointer to this node's hash
chain is kept, in case the node is the head
- of the chain and gets deleted. */
+ of the chain and gets deleted. */
struct assertion_hashnode **bucket_hdr;
int length; /* length of token, for quick comparison */
U_CHAR *name; /* the actual name */
#define NEWLINE_FIX \
do {while (PEEKC() == '\\' && PEEKN(1) == '\n') FORWARD(2); } while(0)
-/* Same, but assume we've already read the potential '\\' into C. */
+/* Same, but assume we've already read the potential '\\' into C. */
#define NEWLINE_FIX1(C) do { \
while ((C) == '\\' && PEEKC() == '\n') { FORWARD(1); (C) = GETC(); }\
} while(0)
static void free_token_list ();
static int safe_read ();
static void push_macro_expansion PARAMS ((cpp_reader *,
- U_CHAR*, int, HASHNODE*));
-static struct cpp_pending *nreverse_pending PARAMS ((struct cpp_pending*));
+ U_CHAR *, int, HASHNODE *));
+static struct cpp_pending *nreverse_pending PARAMS ((struct cpp_pending *));
extern char *xrealloc ();
static char *xcalloc ();
static char *savestring ();
/* External declarations. */
-extern HOST_WIDE_INT cpp_parse_expr PARAMS ((cpp_reader*));
+extern HOST_WIDE_INT cpp_parse_expr PARAMS ((cpp_reader *));
extern char *getenv ();
extern FILE *fdopen ();
};
/* If a buffer's dir field is SELF_DIR_DUMMY, it means the file was found
- via the same directory as the file that #included it. */
-#define SELF_DIR_DUMMY ((struct file_name_list*)(~0))
+ via the same directory as the file that #included it. */
+#define SELF_DIR_DUMMY ((struct file_name_list *) (~0))
-/* #include "file" looks in source file dir, then stack. */
-/* #include <file> just looks in the stack. */
-/* -I directories are added to the end, then the defaults are added. */
+/* #include "file" looks in source file dir, then stack. */
+/* #include <file> just looks in the stack. */
+/* -I directories are added to the end, then the defaults are added. */
/* The */
static struct default_include {
char *fname; /* The name of the directory. */
int length; /* Length of name */
int (*func)(); /* Function to handle directive */
char *name; /* Name of directive */
- enum node_type type; /* Code which describes which directive. */
- char command_reads_line; /* One if rest of line is read by func. */
+ enum node_type type; /* Code which describes which directive. */
+ char command_reads_line; /* One if rest of line is read by func. */
char traditional_comments; /* Nonzero: keep comments if -traditional. */
char pass_thru; /* Copy preprocessed directive to output file.*/
};
{ -1, 0, "", T_UNUSED},
};
\f
-/* table to tell if char can be part of a C identifier. */
+/* table to tell if char can be part of a C identifier. */
U_CHAR is_idchar[256];
-/* table to tell if char can be first char of a c identifier. */
+/* table to tell if char can be first char of a c identifier. */
U_CHAR is_idstart[256];
/* table to tell if c is horizontal space. */
U_CHAR is_hor_space[256];
/* Place into PFILE a quoted string representing the string SRC.
- Caller must reserve enough space in pfile->token_buffer. */
+ Caller must reserve enough space in pfile->token_buffer. */
+
static void
quote_string (pfile, src)
cpp_reader *pfile;
}
}
-/* Re-allocates PFILE->token_buffer so it will hold at least N more chars. */
+/* Re-allocates PFILE->token_buffer so it will hold at least N more chars. */
void
cpp_grow_buffer (pfile, n)
{
long old_written = CPP_WRITTEN (pfile);
pfile->token_buffer_size = n + 2 * pfile->token_buffer_size;
- pfile->token_buffer = (U_CHAR*)
+ pfile->token_buffer = (U_CHAR *)
xrealloc(pfile->token_buffer, pfile->token_buffer_size);
CPP_SET_WRITTEN (pfile, old_written);
}
cpp_buffer *pbuf;
cpp_reader *pfile;
{
- HASHNODE *macro = (HASHNODE*)pbuf->data;
+ HASHNODE *macro = (HASHNODE *) pbuf->data;
if (macro->type == T_DISABLED)
macro->type = T_MACRO;
if (macro->type != T_MACRO || pbuf->buf != macro->value.defn->expansion)
If this is the start of a comment (followed by '*' or '/'),
skip to the end of the comment, and return ' '.
Return EOF if we reached the end of file before the end of the comment.
- If not the start of a comment, return '/'. */
+ If not the start of a comment, return '/'. */
static int
skip_comment (pfile, linep)
{
c = GETC ();
if (c == EOF)
- return ' '; /* Allow // to be terminated by EOF. */
+ return ' '; /* Allow // to be terminated by EOF. */
while (c == '\\' && PEEKC() == '\n')
{
FORWARD(1);
}
if (c == '\n')
{
- /* Don't consider final '\n' to be part of comment. */
+ /* Don't consider final '\n' to be part of comment. */
FORWARD(-1);
return ' ';
}
}
/* Skip whitespace \-newline and comments. Does not macro-expand. */
+
void
cpp_skip_hspace (pfile)
cpp_reader *pfile;
}
/* Read the rest of the current line.
- The line is appended to PFILE's output buffer. */
+ The line is appended to PFILE's output buffer. */
static void
copy_rest_of_line (pfile)
goto done_a_directive;
}
- /* Now find the directive name. */
+ /* Now find the directive name. */
CPP_PUTC (pfile, '#');
parse_name (pfile, GETC());
ident = pfile->token_buffer + old_written + 1;
|| (kt->type == T_DEFINE
&& CPP_OPTIONS (pfile)->dump_macros == dump_definitions))
{
- /* Just leave the entire #define in the output stack. */
+ /* Just leave the entire #define in the output stack. */
}
else if (kt->type == T_DEFINE
&& CPP_OPTIONS (pfile)->dump_macros == dump_names)
appeared. So the arglist is just convenience data passed
between these two routines. It is not kept around after
the current #define has been processed and entered into the
- hash table. */
+ hash table. */
struct arglist {
struct arglist *next;
/* Scan thru the replacement list, ignoring comments and quoted
strings, picking up on the macro calls. It does a linear search
thru the arg list on every potential symbol. Profiling might say
- that something smarter should happen. */
+ that something smarter should happen. */
if (limit < buf)
abort ();
leading and trailing newline-marker and final null. */
maxsize = (sizeof (DEFINITION)
+ (limit - p) + 5);
- /* Occurrences of '@' get doubled, so allocate extra space for them. */
+ /* Occurrences of '@' get doubled, so allocate extra space for them. */
while (p < limit)
if (*p++ == '@')
maxsize++;
p = buf;
/* Add one initial space escape-marker to prevent accidental
- token-pasting (often removed by macroexpand). */
+ token-pasting (often removed by macroexpand). */
*exp_p++ = '@';
*exp_p++ = ' ';
case '@':
/* An '@' in a string or character constant stands for itself,
- and does not need to be escaped. */
+ and does not need to be escaped. */
if (!expected_delimiter)
*exp_p++ = c;
break;
#define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1)
/* Create a DEFINITION node from a #define directive. Arguments are
- as for do_define. */
+ as for do_define. */
+
static MACRODEF
create_definition (buf, limit, pfile, predefinition)
U_CHAR *buf, *limit;
/* Lossage will occur if identifiers or control keywords are broken
across lines using backslash. This is not the right place to take
- care of that. */
+ care of that. */
if (*bp == '(') {
struct arglist *arg_ptrs = NULL;
++bp; /* skip paren */
SKIP_WHITE_SPACE (bp);
- /* now everything from bp before limit is the definition. */
+ /* now everything from bp before limit is the definition. */
defn = collect_expansion (pfile, bp, limit, argno, arg_ptrs);
defn->rest_args = rest_args;
}
}
}
- /* now everything from bp before limit is the definition. */
+ /* now everything from bp before limit is the definition. */
defn = collect_expansion (pfile, bp, limit, -1, NULL_PTR);
defn->args.argnames = (U_CHAR *) "";
}
if (sym_length == 0)
cpp_error (pfile, "invalid %s name", usage);
else if (!is_idstart[*symname]) {
- U_CHAR *msg; /* what pain... */
+ U_CHAR *msg; /* what pain... */
msg = (U_CHAR *) alloca (sym_length + 1);
bcopy (symname, msg, sym_length);
msg[sym_length] = 0;
return sym_length;
}
-/*
- * return zero if two DEFINITIONs are isomorphic
- */
+/* Return zero if two DEFINITIONs are isomorphic. */
+
static int
compare_defs (d1, d2)
DEFINITION *d1, *d2;
/* Print the warning if it's not ok. */
if (!ok)
{
- U_CHAR *msg; /* what pain... */
+ U_CHAR *msg; /* what pain... */
/* If we are passing through #define and #undef directives, do
that for this re-definition now. */
if stringified.
`use_count' is the number of times this macro arg is substituted
into the macro. If the actual use count exceeds 10,
- the value stored is 10. */
+ the value stored is 10. */
/* raw and expanded are relative to ARG_BASE */
#define ARG_BASE ((pfile)->token_buffer)
/* Allocate a new cpp_buffer for PFILE, and push it on the input buffer stack.
If BUFFER != NULL, then use the LENGTH characters in BUFFER
as the new input buffer.
- Return the new buffer, or NULL on failure. */
+ Return the new buffer, or NULL on failure. */
-cpp_buffer*
+cpp_buffer *
cpp_push_buffer (pfile, buffer, length)
cpp_reader *pfile;
U_CHAR *buffer;
return buf;
}
-cpp_buffer*
+cpp_buffer *
cpp_pop_buffer (pfile)
cpp_reader *pfile;
{
}
/* Scan until CPP_BUFFER (PFILE) is exhausted into PFILE->token_buffer.
- Pop the buffer when done. */
+ Pop the buffer when done. */
void
cpp_scan_buffer (pfile)
for (;;)
{
enum cpp_token token = cpp_get_token (pfile);
- if (token == CPP_EOF) /* Should not happen ... */
+ if (token == CPP_EOF) /* Should not happen ... */
break;
if (token == CPP_POP && CPP_BUFFER (pfile) == buffer)
{
}
}
-/* Move line_base forward, updating lineno and colno. */
+/* Move line_base forward, updating lineno and colno. */
static void
update_position (pbuf)
}
}
-/* Return the cpp_buffer that corresponds to a file (not a macro). */
+/* Return the cpp_buffer that corresponds to a file (not a macro). */
-cpp_buffer*
+cpp_buffer *
cpp_file_buffer (pfile)
cpp_reader *pfile;
{
goto found;
break;
found:
- /* Remove ',' or ')' from argument buffer. */
+ /* Remove ',' or ')' from argument buffer. */
CPP_ADJUST_WRITTEN (pfile, -1);
goto done;
default: ;
cpp_reader *pfile;
{
if (!pfile->timebuf) {
- time_t t = time ((time_t *)0);
+ time_t t = time ((time_t *) 0);
pfile->timebuf = localtime (&t);
}
return pfile->timebuf;
if (pcp_outfile && pcp_inside_if
&& (hp->type == T_CONST
|| (hp->type == T_MACRO && hp->value.defn->predefined)))
- /* Output a precondition for this macro use. */
+ /* Output a precondition for this macro use. */
fprintf (pcp_outfile, "#define %s\n", hp->name);
#endif
buf = " 1 ";
}
\f
/* Return 1 iff a token ending in C1 followed directly by a token C2
- could cause mis-tokenization. */
+ could cause mis-tokenization. */
static int
unsafe_chars (c1, c2)
goto letter;
case 'L':
if (c2 == '\'' || c2 == '\"')
- return 1; /* Could turn into L"xxx" or L'xxx'. */
+ return 1; /* Could turn into L"xxx" or L'xxx'. */
goto letter;
letter:
case '_':
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
case 'Y': case 'Z':
- /* We're in the middle of either a name or a pre-processing number. */
+ /* We're in the middle of either a name or a pre-processing number. */
return (is_idchar[c2] || c2 == '.');
case '<': case '>': case '!': case '%': case '#': case ':':
case '^': case '&': case '|': case '*': case '/': case '=':
/* Parse all the macro args that are supplied. I counts them.
The first NARGS args are stored in ARGS.
The rest are discarded. If rest_args is set then we assume
- macarg absorbed the rest of the args. */
+ macarg absorbed the rest of the args. */
i = 0;
rest_args = 0;
rest_args = 0;
int c;
/* Initially need_space is -1. Otherwise, 1 means the
previous character was a space, but we suppressed it;
- 0 means the previous character was a non-space. */
+ 0 means the previous character was a non-space. */
int need_space = -1;
i = 0;
arg->stringified = CPP_WRITTEN (pfile);
}
/* if there is anything left of the definition
- after handling the arg list, copy that in too. */
+ after handling the arg list, copy that in too. */
for (i = offset; i < defn->length; i++)
{
push_macro_expansion (pfile, xbuf, xbuf_len, hp);
CPP_BUFFER (pfile)->has_escapes = 1;
- /* Pop the space we've used in the token_buffer for argument expansion. */
+ /* Pop the space we've used in the token_buffer for argument expansion. */
CPP_SET_WRITTEN (pfile, old_written);
/* Recursive macro use sometimes works traditionally.
case CPP_POP:
if (! CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
return token;
- /* ... else fall though ... */
+ /* ... else fall though ... */
case CPP_HSPACE: case CPP_COMMENT:
CPP_SET_WRITTEN (pfile, old_written);
break;
The input is normally in part of the output_buffer following
CPP_WRITTEN, and will get overwritten by output_line_command.
I.e. in input file specification has been popped by handle_directive.
- This is safe. */
+ This is safe. */
static int
do_include (pfile, keyword, unused1, unused2)
int f; /* file number */
int retried = 0; /* Have already tried macro
- expanding the include line*/
+ expanding the include line */
int angle_brackets = 0; /* 0 for "...", 1 for <...> */
int pcf = -1;
char *pcfbuf;
if (CPP_OPTIONS (pfile)->first_bracket_include)
search_start = CPP_OPTIONS (pfile)->first_bracket_include;
}
- /* If -I- was specified, don't search current dir, only spec'd ones. */
+ /* If -I- was specified, don't search current dir, only spec'd ones. */
else if (! CPP_OPTIONS (pfile)->ignore_srcdir)
{
cpp_buffer *fp = CPP_BUFFER (pfile);
/* We have "filename". Figure out directory this source
- file is coming from and put it on the front of the list. */
+ file is coming from and put it on the front of the list. */
for ( ; fp != CPP_NULL_BUFFER (pfile); fp = CPP_PREV_BUFFER (fp))
{
/* Check to see if this include file is a once-only include file.
If so, give up. */
- struct file_name_list* ptr;
+ struct file_name_list *ptr;
for (ptr = pfile->dont_repeat_files; ptr; ptr = ptr->next) {
if (!strcmp (ptr->fname, fname)) {
close (f);
- return 0; /* This file was once'd. */
+ return 0; /* This file was once'd. */
}
}
for (ptr = pfile->all_include_files; ptr; ptr = ptr->next) {
if (!strcmp (ptr->fname, fname))
- break; /* This file was included before. */
+ break; /* This file was included before. */
}
if (ptr == 0) {
/* Actually process the file. */
- /* Record file on "seen" list for #import. */
+ /* Record file on "seen" list for #import. */
add_import (pfile, f, fname);
pcftry = (char *) alloca (strlen (fname) + 30);
* If HASH is >= 0, it is the precomputed hash code.
* Otherwise, compute the hash code.
*/
+
static ASSERTION_HASHNODE *
assertion_install (pfile, name, len, hash)
cpp_reader *pfile;
tail = next;
}
- /* make sure that the bucket chain header that
- the deleted guy was on points to the right thing afterwards. */
+ /* Make sure that the bucket chain header that
+ the deleted guy was on points to the right thing afterwards. */
if (hp == *hp->bucket_hdr)
*hp->bucket_hdr = hp->next;
The value returned in the end of the string written to RESULT,
or NULL on error. */
-static U_CHAR*
+static U_CHAR *
convert_string (pfile, result, in, limit, handle_escapes)
cpp_reader *pfile;
register U_CHAR *result, *in, *limit;
if (CPP_PEDANTIC (pfile) && !CPP_BUFFER (pfile)->system_header_p)
cpp_pedwarn (pfile, "ANSI C does not allow `#ident'");
- /* Leave rest of line to be read by later calls to cpp_get_token. */
+ /* Leave rest of line to be read by later calls to cpp_get_token. */
return 0;
}
* evaluate a #if expression in BUF, of length LENGTH,
* then parse the result as a C expression and return the value as an int.
*/
+
static HOST_WIDE_INT
eval_if_expression (pfile, buf, length)
cpp_reader *pfile;
{
int skip;
cpp_buffer *ip = CPP_BUFFER (pfile);
- U_CHAR* ident;
+ U_CHAR *ident;
int ident_length;
enum cpp_token token;
int start_of_file = 0;
* leaves input ptr at the sharp sign found.
* If ANY is nonzero, return at next directive of any sort.
*/
+
static void
skip_if_group (pfile, any)
cpp_reader *pfile;
}
c = GETC ();
}
- /* We're in the middle of a line. Skip the rest of it. */
+ /* We're in the middle of a line. Skip the rest of it. */
for (;;) {
switch (c)
{
}
/* Get the next token, and add it to the text in pfile->token_buffer.
- Return the kind of token we got. */
+ Return the kind of token we got. */
-
enum cpp_token
cpp_get_token (pfile)
cpp_reader *pfile;
{
/* We're about to return from an #include file.
Emit #line information now (as part of the CPP_POP) result.
- But the #line refers to the file we will pop to. */
+ But the #line refers to the file we will pop to. */
cpp_buffer *cur_buffer = CPP_BUFFER (pfile);
CPP_BUFFER (pfile) = next_buf;
pfile->input_stack_listing_current = 0;
"unterminated comment");
goto handle_eof;
}
- c = '/'; /* Initial letter of comment. */
+ c = '/'; /* Initial letter of comment. */
return_comment:
/* Comments are equivalent to spaces.
For -traditional, a comment is equivalent to nothing. */
{
#if 0
/* This may not work if cpp_get_token is called recursively,
- since many places look for horizontal space. */
+ since many places look for horizontal space. */
if (newlines)
{
/* Copy the newlines into the output buffer, in order to
/* OK, now bring us back to the state we were in before we entered
this branch. We need #line b/c the newline for the pragma
- could fuck things up. */
+ could fuck things up. */
output_line_command (pfile, 0, same_file);
*(obp++) = ' '; /* just in case, if comments are copied thru */
*(obp++) = '/';
cc = GETC();
if (cc == '\n')
{
- /* Backslash newline is replaced by nothing at all. */
+ /* Backslash newline is replaced by nothing at all. */
CPP_ADJUST_WRITTEN (pfile, -1);
pfile->lineno++;
}
/* Chill style comment */
if (opts->put_out_comments)
parse_set_mark (&start_mark, pfile);
- FORWARD(1); /* Skip second '-'. */
+ FORWARD(1); /* Skip second '-'. */
for (;;)
{
c = GETC ();
break;
if (c == '\n')
{
- /* Don't consider final '\n' to be part of comment. */
+ /* Don't consider final '\n' to be part of comment. */
FORWARD(-1);
break;
}
if (hp->type == T_DISABLED)
{
if (pfile->output_escapes)
- { /* Return "@-IDENT", followed by '\0'. */
+ { /* Return "@-IDENT", followed by '\0'. */
int i;
CPP_RESERVE (pfile, 3);
ident = pfile->token_buffer + before_name_written;
if (!is_macro_call)
return CPP_NAME;
}
- /* This is now known to be a macro call. */
+ /* This is now known to be a macro call. */
/* it might not actually be a macro. */
if (hp->type != T_MACRO) {
/* An extra "@ " is added to the end of a macro expansion
to prevent accidental token pasting. We prefer to avoid
unneeded extra spaces (for the sake of cpp-using tools like
- imake). Here we remove the space if it is safe to do so. */
+ imake). Here we remove the space if it is safe to do so. */
if (pfile->buffer->rlimit - pfile->buffer->cur >= 3
&& pfile->buffer->rlimit[-2] == '@'
&& pfile->buffer->rlimit[-1] == ' ')
}
}
-/* Like cpp_get_token, but skip spaces and comments. */
+/* Like cpp_get_token, but skip spaces and comments. */
+
enum cpp_token
cpp_get_non_space_token (pfile)
cpp_reader *pfile;
}
}
-/* Parse an identifier starting with C. */
+/* Parse an identifier starting with C. */
int
parse_name (pfile, c)
break;
}
- CPP_RESERVE(pfile, 2); /* One more for final NUL. */
+ CPP_RESERVE(pfile, 2); /* One more for final NUL. */
CPP_PUTC_Q (pfile, c);
c = GETC();
if (c == EOF)
return alloc;
}
-/* This structure holds a linked list of file name maps, one per directory. */
+/* This structure holds a linked list of file name maps, one per directory. */
+
struct file_name_map_list
{
struct file_name_map_list *map_list_next;
} else {
/* Cannot count its file size before reading.
First read the entire file into heap and
- copy them into buffer on stack. */
+ copy them into buffer on stack. */
int bsize = 2000;
/* Now handle the command line options. */
/* Do -U's, -D's and -A's in the order they were seen. */
- /* First reverse the list. */
+ /* First reverse the list. */
opts->pending = nreverse_pending (opts->pending);
for (pend = opts->pending; pend; pend = pend->next)
opts->done_initializing = 1;
- { /* read the appropriate environment variable and if it exists
- replace include_defaults with the listed path. */
+ { /* Read the appropriate environment variable and if it exists
+ replace include_defaults with the listed path. */
char *epath = 0;
switch ((opts->objc << 1) + opts->cplusplus)
{
}
pfile->no_record_file--;
- /* Free the pending list. */
+ /* Free the pending list. */
for (pend = opts->pending; pend; )
{
struct cpp_pending *next = pend->next;
pfile->get_token = cpp_get_token;
pfile->token_buffer_size = 200;
- pfile->token_buffer = (U_CHAR*)xmalloc (pfile->token_buffer_size);
+ pfile->token_buffer = (U_CHAR *) xmalloc (pfile->token_buffer_size);
CPP_SET_WRITTEN (pfile, 0);
pfile->system_include_depth = 0;
char *arg;
{
struct cpp_pending *pend
- = (struct cpp_pending*)xmalloc (sizeof (struct cpp_pending));
+ = (struct cpp_pending *) xmalloc (sizeof (struct cpp_pending));
pend->cmd = cmd;
pend->arg = arg;
pend->next = CPP_OPTIONS (pfile)->pending;
}
/* Free resources used by PFILE.
- This is the cpp_reader 'finalizer' or 'destructor' (in C++ terminology). */
+ This is the cpp_reader 'finalizer' or 'destructor' (in C++ terminology). */
void
cpp_cleanup (pfile)
return output;
}
\f
-/* Initialize PMARK to remember the current position of PFILE. */
+/* Initialize PMARK to remember the current position of PFILE. */
+
void
parse_set_mark (pmark, pfile)
struct parse_marker *pmark;
pmark->position = pbuf->cur - pbuf->buf;
}
-/* Cleanup PMARK - we no longer need it. */
+/* Cleanup PMARK - we no longer need it. */
+
void
parse_clear_mark (pmark)
struct parse_marker *pmark;
*pp = pmark->next;
}
-/* Backup the current position of PFILE to that saved in PMARK. */
+/* Backup the current position of PFILE to that saved in PMARK. */
void
parse_goto_mark (pmark, pfile)
}
/* Reset PMARK to point to the current position of PFILE. (Same
- as parse_clear_mark (PMARK), parse_set_mark (PMARK, PFILE) but faster. */
+ as parse_clear_mark (PMARK), parse_set_mark (PMARK, PFILE) but faster. */
void
parse_move_mark (pmark, pfile)
msg, arg1, arg2, arg3);
}
-/* This defines "errno" properly for VMS, and gives us EACCES. */
+/* This defines "errno" properly for VMS, and gives us EACCES. */
#include <errno.h>
#ifndef errno
extern int errno;
char *strerror (int,...);
#endif
-/*
- * my_strerror - return the descriptive text associated with an `errno' code.
- */
+/* my_strerror - return the descriptive text associated with an
+ `errno' code. */
char *
my_strerror (errnum)
#endif
#endif /* !PARAMS */
-typedef enum cpp_token (*parse_underflow_t) PARAMS((cpp_reader*));
-typedef int (*parse_cleanup_t) PARAMS((cpp_buffer *, cpp_reader*));
+typedef enum cpp_token (*parse_underflow_t) PARAMS((cpp_reader *));
+typedef int (*parse_cleanup_t) PARAMS((cpp_buffer *, cpp_reader *));
/* A parse_marker indicates a previous position,
which we can backtrack to. */
int position;
};
-extern void parse_set_mark PARAMS ((struct parse_marker*, cpp_reader*));
-extern void parse_clear_mark PARAMS ((struct parse_marker*));
-extern void parse_goto_mark PARAMS((struct parse_marker*, cpp_reader*));
-extern void parse_move_mark PARAMS((struct parse_marker*, cpp_reader*));
+extern void parse_set_mark PARAMS ((struct parse_marker *, cpp_reader *));
+extern void parse_clear_mark PARAMS ((struct parse_marker *));
+extern void parse_goto_mark PARAMS((struct parse_marker *, cpp_reader *));
+extern void parse_move_mark PARAMS((struct parse_marker *, cpp_reader *));
-extern int cpp_handle_options PARAMS ((cpp_reader*, int, char**));
-extern enum cpp_token cpp_get_token PARAMS ((struct parse_marker*));
-extern void cpp_skip_hspace PARAMS((cpp_reader*));
+extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
+extern enum cpp_token cpp_get_token PARAMS ((struct parse_marker *));
+extern void cpp_skip_hspace PARAMS((cpp_reader *));
extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *));
/* This frees resources used by PFILE. */
-extern void cpp_cleanup PARAMS ((cpp_reader* PFILE));
+extern void cpp_cleanup PARAMS ((cpp_reader *PFILE));
/* Maintain and search list of included files, for #import. */
#define CPP_ADJUST_WRITTEN(PFILE,DELTA) ((PFILE)->limit += (DELTA))
#define CPP_SET_WRITTEN(PFILE,N) ((PFILE)->limit = (PFILE)->token_buffer + (N))
-#define CPP_OPTIONS(PFILE) ((cpp_options*)(PFILE)->data)
+#define CPP_OPTIONS(PFILE) ((cpp_options *) (PFILE)->data)
#define CPP_BUFFER(PFILE) ((PFILE)->buffer)
#define CPP_PREV_BUFFER(BUFFER) ((BUFFER)+1)
};
typedef struct if_stack IF_STACK_FRAME;
-extern void cpp_buf_line_and_col PARAMS((cpp_buffer*, long*, long*));
-extern cpp_buffer* cpp_file_buffer PARAMS((cpp_reader*));
-extern void cpp_define PARAMS ((cpp_reader*, unsigned char*));
+extern void cpp_buf_line_and_col PARAMS((cpp_buffer *, long *, long *));
+extern cpp_buffer* cpp_file_buffer PARAMS((cpp_reader *));
+extern void cpp_define PARAMS ((cpp_reader*, unsigned char *));
extern void cpp_error ();
extern void cpp_warning ();
extern void cpp_perror_with_name ();
extern void cpp_pfatal_with_name ();
-extern void cpp_grow_buffer PARAMS ((cpp_reader*, long));
-extern int cpp_parse_escape PARAMS ((cpp_reader*, char**));
-extern cpp_buffer* cpp_push_buffer PARAMS ((cpp_reader *,
- unsigned char*, long));
-extern cpp_buffer* cpp_pop_buffer PARAMS ((cpp_reader *));
+extern void cpp_grow_buffer PARAMS ((cpp_reader *, long));
+extern int cpp_parse_escape PARAMS ((cpp_reader *, char **));
+extern cpp_buffer *cpp_push_buffer PARAMS ((cpp_reader *,
+ unsigned char *, long));
+extern cpp_buffer *cpp_pop_buffer PARAMS ((cpp_reader *));
-extern cpp_hashnode* cpp_lookup PARAMS ((cpp_reader*, const unsigned char*,
+extern cpp_hashnode *cpp_lookup PARAMS ((cpp_reader *, const unsigned char *,
int, int));
#ifdef __cplusplus
{
char *p;
int i;
- int argi = 1; /* Next argument to handle. */
+ int argi = 1; /* Next argument to handle. */
struct cpp_options *opts = &options;
p = argv[0] + strlen (argv[0]);
}
/* Stick a call to __do_global_dtors_aux into the .fini section. */
+
static void
fini_dummy ()
{
function. It is externally callable so that __main can invoke it when
INVOKE__main is defined. This has the additional effect of forcing cc1
to switch to the .text section. */
+
static void __do_global_ctors_aux ();
void __do_global_ctors ()
{
crti.o may do something, such as bump the stack, which we have to
undo before we reach the function prologue code for __do_global_ctors
(directly below). For such systems, define the macro INIT_SECTION_PREAMBLE
- to expand into the code needed to undo the actions of the crti.o file. */
+ to expand into the code needed to undo the actions of the crti.o file. */
#ifdef INIT_SECTION_PREAMBLE
INIT_SECTION_PREAMBLE;
}
/* Stick a call to __do_global_ctors_aux into the .init section. */
+
static void
init_dummy ()
{
/* This is a kludge. The i386 Linux dynamic linker needs ___brk_addr,
__environ and atexit (). We have to make sure they are in the .dynsym
section. We accomplish it by making a dummy call here. This
- code is never reached. */
+ code is never reached. */
#if defined(__linux__) && defined(__PIC__) && defined(__i386__)
{
other libraries, etc. That's because those other initializations may
include setup operations for very primitive things (e.g. initializing
the state of the floating-point coprocessor, etc.) which should be done
- before we start to execute any of the user's code. */
+ before we start to execute any of the user's code. */
static void
__do_global_ctors_aux () /* prologue goes in .text section */
struct write_data
{
- int sp : 1; /* Invalidate stack pointer. */
+ int sp : 1; /* Invalidate stack pointer. */
int var : 1; /* Invalidate variable addresses. */
int nonscalar : 1; /* Invalidate all but scalar variables. */
int all : 1; /* Invalidate all memory refs. */
int path_size;
/* Current branch path, indicating which branches will be taken. */
struct branch_path {
- /* The branch insn. */
+ /* The branch insn. */
rtx branch;
/* Whether it should be taken or not. AROUND is the same as taken
except that it is used when the destination label is not preceded
/* Remove old entry, make a new one in CLASS1's class.
Don't do this for invalid entries as we cannot find their
- hash code (it also isn't necessary). */
+ hash code (it also isn't necessary). */
if (GET_CODE (exp) == REG || exp_equiv_p (exp, exp, 1, 0))
{
hash_arg_in_memory = 0;
/* On some machines, we can't record any non-fixed hard register,
because extending its life will cause reload problems. We
consider ap, fp, and sp to be fixed for this purpose.
- On all machines, we can't record any global registers. */
+ On all machines, we can't record any global registers. */
if (regno < FIRST_PSEUDO_REGISTER
&& (global_regs[regno]
}
/* We can do some operations on integer CONST_DOUBLEs. Also allow
- for a DImode operation on a CONST_INT. */
+ for a DImode operation on a CONST_INT. */
else if (GET_MODE (op) == VOIDmode && width <= HOST_BITS_PER_INT * 2
&& (GET_CODE (op) == CONST_DOUBLE || GET_CODE (op) == CONST_INT))
{
neg_double (l2, h2, &lv, &hv);
l2 = lv, h2 = hv;
- /* .. fall through ... */
+ /* .. fall through ... */
case PLUS:
add_double (l1, h1, l2, h2, &lv, &hv);
&& (arg1 = exact_log2 (INTVAL (op1))) > 0)
return gen_rtx (LSHIFTRT, mode, op0, GEN_INT (arg1));
- /* ... fall through ... */
+ /* ... fall through ... */
case DIV:
if (op1 == CONST1_RTX (mode))
&& exact_log2 (INTVAL (op1)) > 0)
return gen_rtx (AND, mode, op0, GEN_INT (INTVAL (op1) - 1));
- /* ... fall through ... */
+ /* ... fall through ... */
case MOD:
if ((op0 == const0_rtx || op1 == const1_rtx)
&& ! side_effects_p (op1))
return op0;
- /* ... fall through ... */
+ /* ... fall through ... */
case ASHIFT:
case ASHIFTRT:
if (mode_arg0 == VOIDmode || GET_MODE_CLASS (mode_arg0) == MODE_CC)
break;
- /* If we do not now have two constants being compared, see if we
- can nevertheless deduce some things about the comparison. */
+ /* If we do not now have two constants being compared, see
+ if we can nevertheless deduce some things about the
+ comparison. */
if (const_arg0 == 0 || const_arg1 == 0)
{
- /* Is FOLDED_ARG0 frame-pointer plus a constant? Or non-explicit
- constant? These aren't zero, but we don't know their sign. */
+ /* Is FOLDED_ARG0 frame-pointer plus a constant? Or
+ non-explicit constant? These aren't zero, but we
+ don't know their sign. */
if (const_arg1 == const0_rtx
&& (NONZERO_BASE_PLUS_P (folded_arg0)
#if 0 /* Sad to say, on sysvr4, #pragma weak can make a symbol address
NULL_RTX);
}
- /* ... fall through ... */
+ /* ... fall through ... */
from_plus:
case SMIN: case SMAX: case UMIN: case UMAX:
someplace else, so it isn't worth cse'ing (and on 80386 is unsafe)!
Ensure we invalidate the destination register. On the 80386 no
other code would invalidate it since it is a fixed_reg.
- We need not check the return of apply_change_group; see canon_reg. */
+ We need not check the return of apply_change_group; see canon_reg. */
else if (GET_CODE (SET_SRC (x)) == CALL)
{
that are when they are equal cost. Note that we can never
worsen an insn as the current contents will also succeed.
If we find an equivalent identical to the destination, use it as best,
- since this insn will probably be eliminated in that case. */
+ since this insn will probably be eliminated in that case. */
if (src)
{
if (rtx_equal_p (src, dest))
*writes_ptr = everything;
else if (GET_CODE (written) == MEM)
{
- /* Pushing or popping the stack invalidates just the stack pointer. */
+ /* Pushing or popping the stack invalidates just the stack pointer. */
rtx addr = XEXP (written, 0);
if ((GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == PRE_INC
|| GET_CODE (addr) == POST_DEC || GET_CODE (addr) == POST_INC)
if (writes_memory.var)
invalidate_memory (&writes_memory);
- /* See comment on similar code in cse_insn for explanation of these tests. */
+ /* See comment on similar code in cse_insn for explanation of these
+ tests. */
if (GET_CODE (SET_DEST (x)) == REG || GET_CODE (SET_DEST (x)) == SUBREG
|| (GET_CODE (SET_DEST (x)) == MEM && ! writes_memory.all
&& ! cse_rtx_addr_varies_p (SET_DEST (x))))
/* At the end of compilation, finish writing the symbol table.
Unless you define DBX_OUTPUT_MAIN_SOURCE_FILE_END, the default is
- to do nothing. */
+ to do nothing. */
void
dbxout_finish (file, filename)
/* Get past const and volatile qualifiers. */
while (*method_name == 'C' || *method_name == 'V')
method_name++;
- /* Skip digits for length of type_encoding. */
+ /* Skip digits for length of type_encoding. */
while (*method_name == *length_ptr && *length_ptr)
length_ptr++, method_name++;
if (! strncmp (method_name,
char *length_ptr = formatted_type_identifier_length;
while (*ctor_name == 'C' || *ctor_name == 'V')
ctor_name++;
- /* Skip digits for length of type_encoding. */
+ /* Skip digits for length of type_encoding. */
while (*ctor_name == *length_ptr && *length_ptr)
length_ptr++, ctor_name++;
if (!strncmp (IDENTIFIER_POINTER (type_encoding), ctor_name,
/* Emit a "range" type specification, which has the form:
"r<index type>;<lower bound>;<upper bound>;".
- TYPE is an INTEGER_TYPE. */
+ TYPE is an INTEGER_TYPE. */
static void
dbxout_range_type (type)
were defined to be sub-ranges of int. Unfortunately, this
does not allow us to distinguish true sub-ranges from integer
types. So, instead we define integer (non-sub-range) types as
- sub-ranges of themselves. */
+ sub-ranges of themselves. */
dbxout_type_index (type);
}
if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST)
fprintf (asmfile, "@s%d;",
BITS_PER_UNIT * int_size_in_bytes (type));
/* Check if a bitstring type, which in Chill is
- different from a [power]set. */
+ different from a [power]set. */
if (TYPE_STRING_FLAG (type))
fprintf (asmfile, "@S;");
}
followed by a reference to the target-type.
ar1;0;N;M for a C array of type M and size N+1. */
/* Check if a character string type, which in Chill is
- different from an array of characters. */
+ different from an array of characters. */
if (TYPE_STRING_FLAG (type) && use_gnu_debug_info_extensions)
{
have_used_extensions = 1;
typedef struct filename_entry filename_entry;
-/* Pointer to an array of elements, each one having the structure above. */
+/* Pointer to an array of elements, each one having the structure above. */
static filename_entry *filename_table;
static unsigned next_block_number = 2;
-/* Counter to generate unique names for DIEs. */
+/* Counter to generate unique names for DIEs. */
static unsigned next_unused_dienum = 1;
case NOP_EXPR:
bound = TREE_OPERAND (bound, 0);
- /* ... fall thru... */
+ /* ... fall thru... */
case SAVE_EXPR:
{
object" which will be given in the AT_byte_size attribute for this
bit-field. (See the `byte_size_attribute' function below.) It is
also used when calculating the value of the AT_bit_offset attribute.
- (See the `bit_offset_attribute' function below.)
-*/
+ (See the `bit_offset_attribute' function below.) */
static void
data_member_location_attribute (decl)
if (! type_is_fundamental (domain))
abort ();
- /* Output the representation format byte for this dimension. */
+ /* Output the representation format byte for this dimension. */
ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file,
FMT_CODE (1,
#if 0
/* Implement this when there is a GNU FORTRAN or GNU Ada front end. */
+
static void
output_entry_point_die (arg)
register void *arg;
member_attribute (DECL_CONTEXT (decl));
type_attribute (member_declared_type (decl),
TREE_READONLY (decl), TREE_THIS_VOLATILE (decl));
- if (DECL_BIT_FIELD_TYPE (decl)) /* If this is a bit field... */
+ if (DECL_BIT_FIELD_TYPE (decl)) /* If this is a bit field... */
{
byte_size_attribute (decl);
bit_size_attribute (decl);
/* Don't generate either pointer_type DIEs or reference_type DIEs. Use
modified types instead.
- We keep this code here just in case these types of DIEs may be needed
- to represent certain things in other languages (e.g. Pascal) someday.
-*/
+ We keep this code here just in case these types of DIEs may be
+ needed to represent certain things in other languages (e.g. Pascal)
+ someday. */
static void
output_pointer_type_die (arg)
parameters as specified in some function type specification (except
for those which appear as part of a function *definition*).
- Note that we must be careful here to output all of the parameter DIEs
- *before* we output any DIEs needed to represent the types of the formal
- parameters. This keeps svr4 SDB happy because it (incorrectly) thinks
- that the first non-parameter DIE it sees ends the formal parameter list.
-*/
+ Note that we must be careful here to output all of the parameter
+ DIEs *before* we output any DIEs needed to represent the types of
+ the formal parameters. This keeps svr4 SDB happy because it
+ (incorrectly) thinks that the first non-parameter DIE it sees ends
+ the formal parameter list. */
static void
output_formal_types (function_or_method_type)
Note that we have to process the list in beginning-to-end order,
because the call made here to output_type may cause yet more types
to be added to the end of the list, and we may have to output some
- of them too. */
+ of them too. */
static void
output_pending_types_for_scope (containing_scope)
if (fn_arg_types)
{
- /* this is the prototyped case, check for ... */
+ /* this is the prototyped case, check for ... */
if (TREE_VALUE (tree_last (fn_arg_types)) != void_type_node)
output_die (output_unspecified_parameters_die, decl);
}
(or blame). I didn't think of this scheme. I just conformed to it.
*/
- output_die (output_padded_null_die, (void *)0);
+ output_die (output_padded_null_die, (void *) 0);
dienum_pop ();
sprintf (label, DIE_BEGIN_LABEL_FMT, NEXT_DIE_NUM);
/* Commonly used modes. */
-enum machine_mode byte_mode; /* Mode whose width is BITS_PER_UNIT. */
-enum machine_mode word_mode; /* Mode whose width is BITS_PER_WORD. */
-enum machine_mode ptr_mode; /* Mode whose width is POINTER_SIZE. */
+enum machine_mode byte_mode; /* Mode whose width is BITS_PER_UNIT. */
+enum machine_mode word_mode; /* Mode whose width is BITS_PER_WORD. */
+enum machine_mode ptr_mode; /* Mode whose width is POINTER_SIZE. */
/* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
After rtl generation, it is 1 plus the largest register number used. */
static struct sequence_stack *sequence_element_free_list;
static rtx sequence_result[SEQUENCE_RESULT_SIZE];
-/* During RTL generation, we also keep a list of free INSN rtl codes. */
+/* During RTL generation, we also keep a list of free INSN rtl codes. */
static rtx free_insn;
extern int rtx_equal_function_value_matters;
low = CONST_DOUBLE_LOW (x), high = CONST_DOUBLE_HIGH (x);
/* REAL_VALUE_TARGET_DOUBLE takes the addressing order of the
- target machine. */
+ target machine. */
if (WORDS_BIG_ENDIAN)
i[0] = high, i[1] = low;
else
*/
if (REGNO (x) < FIRST_PSEUDO_REGISTER
- /* integrate.c can't handle parts of a return value register. */
+ /* integrate.c can't handle parts of a return value register. */
&& (! REG_FUNCTION_VALUE_P (x)
|| ! rtx_equal_function_value_matters)
/* We want to keep the stack, frame, and arg pointers special. */
regno_pointer_flag_length = p->regno_pointer_flag_length;
regno_reg_rtx = p->regno_reg_rtx;
- /* Clear our cache of rtx expressions for start_sequence and gen_sequence. */
+ /* Clear our cache of rtx expressions for start_sequence and
+ gen_sequence. */
sequence_element_free_list = 0;
for (i = 0; i < SEQUENCE_RESULT_SIZE; i++)
sequence_result[i] = 0;
case PC:
case CC0:
case SCRATCH:
- /* SCRATCH must be shared because they represent distinct values. */
+ /* SCRATCH must be shared because they represent distinct values. */
return x;
case CONST:
/* Return the next INSN, CALL_INSN or JUMP_INSN after INSN;
or 0, if there is none. This routine does not look inside
- SEQUENCEs. */
+ SEQUENCEs. */
rtx
next_real_insn (insn)
/* Everything you wanted to know about your machine and C compiler,
- but didn't know who to ask. */
+ but didn't know who to ask. */
#ifndef VERSION
#define VERSION "4.3"
#endif /* NO_FILE */
#endif /* FILENAME */
-/* If PASS isn't defined, then this is the first pass over this file. */
+/* If PASS isn't defined, then this is the first pass over this file. */
#ifndef PASS
#ifndef SEP
#define PASS 1
farewell(bugs+1); /* An exit isn't essential here, but avoids loops */
}
-/* This is here in case alloca.c is used, which calls this. */
+/* This is here in case alloca.c is used, which calls this. */
char *xmalloc(size) unsigned size; {
char *value = (char *)malloc(size);
if (value == 0) {
} else if (val + lim < 0) {
/* We may not produce a constant like -1024 if the max
allowable value is 1023. It has then to be output as
- -1023-1. lim is the max allowable value. */
+ -1023-1. lim is the max allowable value. */
printf("#define %s%s (%ld%s%ld%s)\n",
sort, name, -lim, mark, val+lim, mark);
} else {
eek_a_bug("promotions don't work properly in conditional expressions\n");
}
- showtype("unsigned short promotes to", Promoted((unsigned short)0));
+ showtype("unsigned short promotes to", Promoted((unsigned short) 0));
showtype("long+unsigned gives", sl+ui);
return 0;
}
usign= Signed;
#else
/* Implementations promote unsigned short differently */
- usign= is_signed((unsigned short)0);
+ usign= is_signed((unsigned short) 0);
#endif
if (L) {
/* Alignment constants ********************************************/
#define alignment(TYPE) \
- ((long)((char *)&((struct{char c; TYPE d;}*)0)->d - (char *)0))
+ ((long)((char *)&((struct{char c; TYPE d;}*)0)->d - (char *) 0))
Vprintf("\n%sALIGNMENTS%s\n", co, oc);
mantbits=floor_log(2, (Long_double)f_radix)*f_mant_dig;
if (mantbits == 64
&& iexp == 15
- && f_max_exp+f_min_exp > 0 /* ??? f_min_exp may be wrong. */
+ && f_max_exp+f_min_exp > 0 /* ??? f_min_exp may be wrong. */
&& mantbits+iexp+17 == (int)sizeof(Number)*bits_per_byte) {
Vprintf("%sArithmetic probably doesn't use a hidden bit%s\n", co, oc);
Vprintf("%sIt's probably 80387 or 68881 extended real%s\n", co, oc);
else
{
/* CEIL_DIV_EXPR needs to worry about the addition overflowing,
- but we know it can't. So add ourselves and then do TRUNC_DIV_EXPR. */
+ but we know it can't. So add ourselves and then do
+ TRUNC_DIV_EXPR. */
size = expand_binop (Pmode, add_optab, size, GEN_INT (align - 1),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size, GEN_INT (align),
if (MUST_ALIGN)
{
/* CEIL_DIV_EXPR needs to worry about the addition overflowing,
- but we know it can't. So add ourselves and then do TRUNC_DIV_EXPR. */
+ but we know it can't. So add ourselves and then do
+ TRUNC_DIV_EXPR. */
target = expand_binop (Pmode, add_optab, target,
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
#ifdef SLOW_ZERO_EXTEND
/* Always generate an `and' if
we just zero-extended op0 and SLOW_ZERO_EXTEND, since it
- will combine fruitfully with the zero-extend. */
+ will combine fruitfully with the zero-extend. */
|| tmode != mode
#endif
#endif
unsigned HOST_WIDE_INT x;
int n;
{
- /* Solve x*y == 1 (mod 2^n), where x is odd. Return y. */
+ /* Solve x*y == 1 (mod 2^n), where x is odd. Return y. */
/* The algorithm notes that the choice y = x satisfies
x*y == 1 mod 2^3, since x is assumed odd.
/* For some comparisons with 1 and -1, we can convert this to
comparisons with zero. This will often produce more opportunities for
- store-flag insns. */
+ store-flag insns. */
switch (code)
{
/* This array records the insn_code of insns to perform block clears. */
enum insn_code clrstr_optab[NUM_MACHINE_MODES];
-/* SLOW_UNALIGNED_ACCESS is non-zero if unaligned accesses are very slow. */
+/* SLOW_UNALIGNED_ACCESS is non-zero if unaligned accesses are very slow. */
#ifndef SLOW_UNALIGNED_ACCESS
#define SLOW_UNALIGNED_ACCESS STRICT_ALIGNMENT
#define OUTGOING_REGNO(IN) (IN)
#endif
\f
-/* Maps used to convert modes to const, load, and store bytecodes. */
+/* Maps used to convert modes to const, load, and store bytecodes. */
enum bytecode_opcode mode_to_const_map[MAX_MACHINE_MODE];
enum bytecode_opcode mode_to_load_map[MAX_MACHINE_MODE];
enum bytecode_opcode mode_to_store_map[MAX_MACHINE_MODE];
/* Initialize maps used to convert modes to const, load, and store
- bytecodes. */
+ bytecodes. */
+
void
bc_init_mode_to_opcode_maps ()
{
dest_innermost = bc_expand_address (to);
/* Can't deduce from TYPE that we're dealing with a bitfield, so
- take care of it here. */
+ take care of it here. */
bc_store_memory (TREE_TYPE (to), dest_innermost);
return NULL;
so the statistic will be somewhat inaccurate.
We do make a more accurate count in store_constructor itself,
so since this function is only used for nested array elements,
- this should be close enough. */
+ this should be close enough. */
if (mostly_zeros_p (TREE_VALUE (elt)))
zeros++;
elts++;
/* Store the value of constructor EXP into the rtx TARGET.
TARGET is either a REG or a MEM.
- CLEARED is true if TARGET is known to have been zero'd. */
+ CLEARED is true if TARGET is known to have been zero'd. */
static void
store_constructor (exp, target, cleared)
zero_count += this_node_count;
}
/* Clear the entire array first if there are any missing elements,
- or if the incidence of zero elements is >= 75%. */
+ or if the incidence of zero elements is >= 75%. */
if (count < maxelt - minelt + 1
|| 4 * zero_count >= 3 * count)
need_to_clear = 1;
HOST_WIDE_INT lo, hi, count;
tree position;
- /* If the range is constant and "small", unroll the loop. */
+ /* If the range is constant and "small", unroll the loop. */
if (TREE_CODE (lo_index) == INTEGER_CST
&& TREE_CODE (hi_index) == INTEGER_CST
&& (lo = TREE_INT_CST_LOW (lo_index),
if (TREE_CODE (value) == SAVE_EXPR
&& SAVE_EXPR_RTL (value) == 0)
{
- /* Make sure value gets expanded once before the loop. */
+ /* Make sure value gets expanded once before the
+ loop. */
expand_expr (value, const0_rtx, VOIDmode, 0);
emit_queue ();
}
store_expr (lo_index, index_r, 0);
loop = expand_start_loop (0);
- /* Assign value to element index. */
+ /* Assign value to element index. */
position = size_binop (EXACT_DIV_EXPR, TYPE_SIZE (elttype),
size_int (BITS_PER_UNIT));
position = size_binop (MULT_EXPR,
probably better to set it using memset (if available) or bzero.
Also, if a large set has just a single range, it may also be
better to first clear all the first clear the set (using
- bzero/memset), and set the bits we want. */
+ bzero/memset), and set the bits we want. */
- /* Check for all zeros. */
+ /* Check for all zeros. */
if (elt == NULL_TREE)
{
if (!cleared)
{
int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
- char *bit_buffer = (char*) alloca (nbits);
+ char *bit_buffer = (char *) alloca (nbits);
HOST_WIDE_INT word = 0;
int bit_pos = 0;
int ibit = 0;
- int offset = 0; /* In bytes from beginning of set. */
+ int offset = 0; /* In bytes from beginning of set. */
elt = get_set_constructor_bits (exp, bit_buffer, nbits);
for (;;)
{
{
rtx datum = GEN_INT (word);
rtx to_rtx;
- /* The assumption here is that it is safe to use XEXP if
- the set is multi-word, but not if it's single-word. */
+ /* The assumption here is that it is safe to use
+ XEXP if the set is multi-word, but not if
+ it's single-word. */
if (GET_CODE (target) == MEM)
{
to_rtx = plus_constant (XEXP (target, 0), offset);
}
else if (!cleared)
{
- /* Don't bother clearing storage if the set is all ones. */
+ /* Don't bother clearing storage if the set is all ones. */
if (TREE_CHAIN (elt) != NULL_TREE
|| (TREE_PURPOSE (elt) == NULL_TREE
? nbits != 1
#ifdef TARGET_MEM_FUNCTIONS
/* Optimization: If startbit and endbit are
constants divisible by BITS_PER_UNIT,
- call memset instead. */
+ call memset instead. */
if (TREE_CODE (startbit) == INTEGER_CST
&& TREE_CODE (endbit) == INTEGER_CST
&& (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
return safe_from_p (x, TREE_OPERAND (exp, 1));
case METHOD_CALL_EXPR:
- /* This takes a rtx argument, but shouldn't appear here. */
+ /* This takes a rtx argument, but shouldn't appear here. */
abort ();
}
else if ((code == TRUTH_ANDIF_EXPR || code == TRUTH_ORIF_EXPR)
&& ! TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
/* If the second operand has no side effects, just evaluate
- the first. */
+ the first. */
return expand_expr (TREE_OPERAND (exp, 0), const0_rtx,
VOIDmode, modifier);
return CONST0_RTX (mode);
}
- /* ... fall through ... */
+ /* ... fall through ... */
case VAR_DECL:
/* If a static var's type was incomplete when the decl was written,
pop_obstacks ();
}
- /* ... fall through ... */
+ /* ... fall through ... */
case FUNCTION_DECL:
case RESULT_DECL:
/* If the mode of SAVE_EXPR_RTL does not match that of the expression, it
must be a promoted value. We return a SUBREG of the wanted mode,
- but mark it so that we know that it was already extended. */
+ but mark it so that we know that it was already extended. */
if (GET_CODE (SAVE_EXPR_RTL (exp)) == REG
&& GET_MODE (SAVE_EXPR_RTL (exp)) != mode)
for any array for which this case will be reached. */
/* Don't forget the const or volatile flag from the array
- element. */
+ element. */
tree variant_type = build_type_variant (type,
TREE_READONLY (exp),
TREE_THIS_VOLATILE (exp));
return target;
case PLUS_EXPR:
- /* We come here from MINUS_EXPR when the second operand is a constant. */
+ /* We come here from MINUS_EXPR when the second operand is a
+ constant. */
plus_expr:
this_optab = add_optab;
if (temp != 0)
return temp;
- /* For foo != 0, load foo, and if it is nonzero load 1 instead. */
+ /* For foo != 0, load foo, and if it is nonzero load 1 instead. */
if (code == NE_EXPR && integer_zerop (TREE_OPERAND (exp, 1))
&& original_target
&& GET_CODE (original_target) == REG
/* Used to save a pointer to the place to put the setting of
the flag that indicates if this side of the conditional was
taken. We backpatch the code, if we find out later that we
- have any conditional cleanups that need to be performed. */
+ have any conditional cleanups that need to be performed. */
rtx dest_right_flag = NULL_RTX;
rtx dest_left_flag = NULL_RTX;
else
jumpifnot (TREE_OPERAND (exp, 0), op0);
- /* Allows cleanups up to here. */
+ /* Allows cleanups up to here. */
old_cleanups = cleanups_this_call;
if (binary_op && temp == 0)
/* Just touch the other operand. */
dest_left_flag = get_last_insn ();
jumpifnot (TREE_OPERAND (exp, 0), op0);
- /* Allows cleanups up to here. */
+ /* Allows cleanups up to here. */
old_cleanups = cleanups_this_call;
store_expr (TREE_OPERAND (exp, 1), temp, 0);
op1 = op0;
dest_left_flag = get_last_insn ();
jumpif (TREE_OPERAND (exp, 0), op0);
- /* Allows cleanups up to here. */
+ /* Allows cleanups up to here. */
old_cleanups = cleanups_this_call;
store_expr (TREE_OPERAND (exp, 2), temp, 0);
op1 = op0;
dest_left_flag = get_last_insn ();
jumpifnot (TREE_OPERAND (exp, 0), op0);
- /* Allows cleanups up to here. */
+ /* Allows cleanups up to here. */
old_cleanups = cleanups_this_call;
store_expr (TREE_OPERAND (exp, 1), temp, 0);
op1 = op0;
op1 = gen_label_rtx ();
jumpifnot (TREE_OPERAND (exp, 0), op0);
- /* Allows cleanups up to here. */
+ /* Allows cleanups up to here. */
old_cleanups = cleanups_this_call;
if (temp != 0)
store_expr (TREE_OPERAND (exp, 1), temp, 0);
ignore ? const0_rtx : NULL_RTX, VOIDmode, 0);
dest_left_flag = get_last_insn ();
- /* Handle conditional cleanups, if any. */
+ /* Handle conditional cleanups, if any. */
left_cleanups = defer_cleanups_to (old_cleanups);
emit_queue ();
dest_right_flag = get_last_insn ();
}
- /* Handle conditional cleanups, if any. */
+ /* Handle conditional cleanups, if any. */
right_cleanups = defer_cleanups_to (old_cleanups);
emit_queue ();
emit_label (op1);
OK_DEFER_POP;
- /* Add back in, any conditional cleanups. */
+ /* Add back in, any conditional cleanups. */
if (left_cleanups || right_cleanups)
{
tree new_cleanups;
rtx last;
/* Now that we know that a flag is needed, go back and add in the
- setting of the flag. */
+ setting of the flag. */
- /* Do the left side flag. */
+ /* Do the left side flag. */
last = get_last_insn ();
- /* Flag left cleanups as needed. */
+ /* Flag left cleanups as needed. */
emit_move_insn (flag, const1_rtx);
/* ??? deprecated, use sequences instead. */
reorder_insns (NEXT_INSN (last), get_last_insn (), dest_left_flag);
- /* Do the right side flag. */
+ /* Do the right side flag. */
last = get_last_insn ();
- /* Flag left cleanups as needed. */
+ /* Flag left cleanups as needed. */
emit_move_insn (flag, const0_rtx);
/* ??? deprecated, use sequences instead. */
reorder_insns (NEXT_INSN (last), get_last_insn (), dest_right_flag);
push_obstacks_nochange ();
resume_temporary_allocation ();
- /* convert flag, which is an rtx, into a tree. */
+ /* convert flag, which is an rtx, into a tree. */
cond = make_node (RTL_EXPR);
TREE_TYPE (cond) = integer_type_node;
RTL_EXPR_RTL (cond) = flag;
case ADDR_EXPR:
/* If nonzero, TEMP will be set to the address of something that might
- be a MEM corresponding to a stack slot. */
+ be a MEM corresponding to a stack slot. */
temp = 0;
/* Are we taking the address of a nested function? */
|| GET_CODE (op0) == CONCAT)
{
/* If this object is in a register, it must be not
- be BLKmode. */
+ be BLKmode. */
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
rtx memloc = assign_temp (inner_type, 1, 1, 1);
}
-/* Emit bytecode to evaluate the given expression EXP to the stack. */
+/* Emit bytecode to evaluate the given expression EXP to the stack. */
+
void
bc_expand_expr (exp)
tree exp;
/* Allocate a location for the return value and push its
address on the evaluation stack. Also make an entry
- at the front of the calldesc for the return value type. */
+ at the front of the calldesc for the return value type. */
type = TREE_TYPE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0))));
retval = bc_allocate_local (int_size_in_bytes (type), TYPE_ALIGN (type));
r = output_constant_def (calldesc);
bc_load_externaddr (r);
- /* Push the address of the function to be called. */
+ /* Push the address of the function to be called. */
bc_expand_expr (TREE_OPERAND (exp, 0));
/* Call the function, popping its address and the calldesc vector
case BUILT_IN_SIN:
case BUILT_IN_COS:
- /* Treat these like sqrt, but only if the user asks for them. */
+ /* Treat these like sqrt, but only if the user asks for them. */
if (! flag_fast_math)
break;
case BUILT_IN_FSQRT:
}
#else
/* We can't set errno=EDOM directly; let the library call do it.
- Pop the arguments right away in case the call gets deleted. */
+ Pop the arguments right away in case the call gets deleted. */
NO_DEFER_POP;
expand_call (exp, target, 0);
OK_DEFER_POP;
emit_label (lab1);
}
- /* Output the entire sequence. */
+ /* Output the entire sequence. */
insns = get_insns ();
end_sequence ();
emit_insns (insns);
enum machine_mode insn_mode = value_mode, char_mode;
enum insn_code icode;
- /* If the length is known, just return it. */
+ /* If the length is known, just return it. */
if (len != 0)
return expand_expr (len, target, mode, 0);
- /* If SRC is not a pointer type, don't do this operation inline. */
+ /* If SRC is not a pointer type, don't do this operation inline. */
if (align == 0)
break;
- /* Call a function if we can't compute strlen in the right mode. */
+ /* Call a function if we can't compute strlen in the right mode. */
while (insn_mode != VOIDmode)
{
/* For each register that may be used for calling a function, this
gives the offset of that register into the block returned by
__builtin_apply_args. 0 indicates that the register is not
- used for calling a function. */
+ used for calling a function. */
static int apply_args_reg_offset[FIRST_PSEUDO_REGISTER];
/* Return the offset of register REGNO into the block returned by
__builtin_apply_args. This is not declared static, since it is
- needed in objc-act.c. */
+ needed in objc-act.c. */
int
apply_args_register_offset (regno)
apply_args_size ();
/* Arguments are always put in outgoing registers (in the argument
- block) if such make sense. */
+ block) if such make sense. */
#ifdef OUTGOING_REGNO
regno = OUTGOING_REGNO(regno);
#endif
tree new_cleanups;
tree cond;
- /* Flag cleanups as not needed. */
+ /* Flag cleanups as not needed. */
emit_move_insn (flag, const0_rtx);
emit_insns (seq1);
- /* Flag cleanups as needed. */
+ /* Flag cleanups as needed. */
emit_move_insn (flag, const1_rtx);
emit_insns (seq2);
push_obstacks_nochange ();
resume_temporary_allocation ();
- /* convert flag, which is an rtx, into a tree. */
+ /* convert flag, which is an rtx, into a tree. */
cond = make_node (RTL_EXPR);
TREE_TYPE (cond) = integer_type_node;
RTL_EXPR_RTL (cond) = flag;
tree new_cleanups;
tree cond;
- /* Flag cleanups as not needed. */
+ /* Flag cleanups as not needed. */
emit_move_insn (flag, const0_rtx);
emit_insns (seq1);
- /* Flag cleanups as needed. */
+ /* Flag cleanups as needed. */
emit_move_insn (flag, const1_rtx);
emit_insns (seq2);
push_obstacks_nochange ();
resume_temporary_allocation ();
- /* convert flag, which is an rtx, into a tree. */
+ /* convert flag, which is an rtx, into a tree. */
cond = make_node (RTL_EXPR);
TREE_TYPE (cond) = integer_type_node;
RTL_EXPR_RTL (cond) = flag;
#if 0
/* There's no need to do this now that combine.c can eliminate lots of
sign extensions. This can be less efficient in certain cases on other
- machines. */
+ machines. */
/* If this is a signed equality comparison, we can do it as an
unsigned comparison since zero-extension is cheaper than sign
/* Emit a suitable bytecode to load a value from memory, assuming a pointer
to that value is on the top of the stack. The resulting type is TYPE, and
- the source declaration is DECL. */
+ the source declaration is DECL. */
void
bc_load_memory (type, decl)
/* Bit fields are special. We only know about signed and
unsigned ints, and enums. The latter are treated as
- signed integers. */
+ signed integers. */
if (DECL_BIT_FIELD (decl))
if (TREE_CODE (type) == ENUMERAL_TYPE
else
abort ();
else
- /* See corresponding comment in bc_store_memory(). */
+ /* See corresponding comment in bc_store_memory(). */
if (TYPE_MODE (type) == BLKmode
|| TYPE_MODE (type) == VOIDmode)
return;
/* Store the contents of the second stack slot to the address in the
top stack slot. DECL is the declaration of the destination and is used
- to determine whether we're dealing with a bitfield. */
+ to determine whether we're dealing with a bitfield. */
void
bc_store_memory (type, decl)
structure size in size units (usually bytes). The two first arguments
are already on the stack; so we just put the size on level 1. For some
other languages, the size may be variable, this is why we don't encode
- it as a storeBLK literal, but rather treat it as a full-fledged expression. */
+ it as a storeBLK literal, but rather treat it as a full-fledged expression. */
bc_expand_expr (TYPE_SIZE (type));
opcode = storeBLK;
/* Allocate variable-sized local array. Variable-sized arrays are
- actually pointers to the address in memory where they are stored. */
+ actually pointers to the address in memory where they are stored. */
rtx
bc_allocate_variable_array (size)
/* Push the machine address for the given external variable offset. */
+
void
bc_load_externaddr (externaddr)
rtx externaddr;
/* Like above, but expects an IDENTIFIER. */
+
void
bc_load_externaddr_id (id, offset)
tree id;
/* Push the machine address for the given local variable offset. */
+
void
bc_load_localaddr (localaddr)
rtx localaddr;
/* Push the machine address for the given parameter offset.
- NOTE: offset is in bits. */
+ NOTE: offset is in bits. */
+
void
bc_load_parmaddr (parmaddr)
rtx parmaddr;
/* Convert a[i] into *(a + i). */
+
tree
bc_canonicalize_array_ref (exp)
tree exp;
/* Load the address of the component referenced by the given
COMPONENT_REF expression.
- Returns innermost lvalue. */
+ Returns innermost lvalue. */
tree
bc_expand_component_address (exp)
/* Emit code to push two SI constants */
+
void
bc_push_offset_and_size (offset, size)
HOST_WIDE_INT offset, size;
the stack. If it's a bit field, we also push offset and size info.
Returns innermost component, which allows us to determine not only
- its type, but also whether it's a bitfield. */
+ its type, but also whether it's a bitfield. */
tree
bc_expand_address (exp)
/* For variable-sized types: retrieve pointer. Sometimes the
TYPE_SIZE tree is NULL. Is this a bug or a feature? Let's
- also make sure we have an operand, just in case... */
+ also make sure we have an operand, just in case... */
if (TREE_OPERAND (exp, 0)
&& TYPE_SIZE (TREE_TYPE (TREE_OPERAND (exp, 0)))
break;
}
- /* Most lvalues don't have components. */
+ /* Most lvalues don't have components. */
return (exp);
}
/* Generate constructor label */
+
char *
bc_gen_constr_label ()
{
The pointer is put in the pointer table and is retrieved by a constP
bytecode instruction. We then loop and store each constructor member in
the corresponding component. Finally, we return the original pointer on
- the stack. */
+ the stack. */
void
bc_expand_constructor (constr)
/* Literal constructors are handled as constants, whereas
non-literals are evaluated and stored element by element
- into the data segment. */
+ into the data segment. */
/* Allocate space in proper segment and push pointer to space on stack.
*/
/* Add reference to pointer table and recall pointer to stack;
this code is common for both types of constructors: literals
- and non-literals. */
+ and non-literals. */
ptroffs = bc_define_pointer (l);
bc_emit_instruction (constP, ptroffs);
- /* This is all that has to be done if it's a literal. */
+ /* This is all that has to be done if it's a literal. */
if (TREE_CONSTANT (constr))
return;
/* At this point, we have the pointer to the structure on top of the stack.
- Generate sequences of store_memory calls for the constructor. */
+ Generate sequences of store_memory calls for the constructor. */
/* constructor type is structure */
if (TREE_CODE (TREE_TYPE (constr)) == RECORD_TYPE)
/* Store each element of the constructor into the corresponding
- element of TARGET, determined by counting the elements. */
+ element of TARGET, determined by counting the elements. */
for (elt = CONSTRUCTOR_ELTS (constr), i = 0;
elt;
/* Store SI/SU in bitfield */
+
void
bc_store_bit_field (offset, size, unsignedp)
int offset, size, unsignedp;
/* Load SI/SU from bitfield */
+
void
bc_load_bit_field (offset, size, unsignedp)
int offset, size, unsignedp;
/* Adjust interpreter stack by NLEVELS. Positive means drop NLEVELS
(adjust stack pointer upwards), negative means add that number of
levels (adjust the stack pointer downwards). Only positive values
- normally make sense. */
+ normally make sense. */
void
bc_adjust_stack (nlevels)
extern void emit_group_store PROTO((rtx, rtx));
/* Mark REG as holding a parameter for the next CALL_INSN. */
-extern void use_reg PROTO((rtx*, rtx));
+extern void use_reg PROTO((rtx *, rtx));
/* Mark NREGS consecutive regs, starting at REGNO, as holding parameters
for the next CALL_INSN. */
-extern void use_regs PROTO((rtx*, int, int));
+extern void use_regs PROTO((rtx *, int, int));
/* Mark a PARALLEL as holding a parameter for the next CALL_INSN. */
-extern void use_group_regs PROTO((rtx*, rtx));
+extern void use_group_regs PROTO((rtx *, rtx));
/* Write zeros through the storage of OBJECT.
If OBJECT has BLKmode, SIZE is its length in bytes and ALIGN is its
7: address of table of function names (LPBX4).
8: address of table of line numbers (LPBX5) or 0.
9: address of table of file names (LPBX6) or 0.
- 10: space reserved for basic block profiling. */
+ 10: space reserved for basic block profiling. */
ASM_OUTPUT_ALIGN (asm_out_file, align);
#endif
/* Inside a delay slot sequence, we do not do any branch shortening
if the shortening could change the number of delay slots
- of the branch. */
+ of the branch. */
for (i = 0; i < XVECLEN (body, 0); i++)
{
rtx inner_insn = XVECEXP (body, 0, i);
/* For SDB and XCOFF, the function beginning must be marked between
the function label and the prologue. We always need this, even when
-g1 was used. Defer on MIPS systems so that parameter descriptions
- follow function entry. */
+ follow function entry. */
#if defined(SDB_DEBUGGING_INFO) && !defined(MIPS_DEBUGGING_INFO)
if (write_symbols == SDB_DEBUG)
sdbout_begin_function (last_linenum);
string = p;
}
else
- for (ptr = sbb_head; ptr != (struct bb_str *)0; ptr = ptr->next)
+ for (ptr = sbb_head; ptr != (struct bb_str *) 0; ptr = ptr->next)
if (ptr->string == string)
break;
{
#if defined(SDB_DEBUGGING_INFO) && defined(MIPS_DEBUGGING_INFO)
/* MIPS stabs require the parameter descriptions to be after the
- function entry point rather than before. */
+ function entry point rather than before. */
if (write_symbols == SDB_DEBUG)
sdbout_begin_function (last_linenum);
else
VA_START (argptr, p);
#ifndef __STDC__
- file = va_arg (argptr, FILE*);
- p = va_arg (argptr, char*);
+ file = va_arg (argptr, FILE *);
+ p = va_arg (argptr, char *);
#endif
buf[0] = '%';
/* Note, this converts the REAL_VALUE_TYPE to the target's
format, splits up the floating point double and outputs
exactly 32 bits of it into each of l[0] and l[1] --
- not necessarily BITS_PER_WORD bits. */
+ not necessarily BITS_PER_WORD bits. */
REAL_VALUE_TO_TARGET_DOUBLE (r, l);
*first = GEN_INT ((HOST_WIDE_INT) l[0]);
if anything needs to be done. (e.g. ./include/stdio.h)
* OPTIONS are such as you would pass to cpp.
- Written by Per Bothner <bothner@cygnus.com>, July 1993. */
+ Written by Per Bothner <bothner@cygnus.com>, July 1993. */
#include <stdio.h>
#include <ctype.h>
#include "xsys-protos.h"
#ifdef FIXPROTO_IGNORE_LIST
-/* This is a currently unused feature. */
+/* This is a currently unused feature. */
/* List of files and directories to ignore.
A directory name (ending in '/') means ignore anything in that
};
/* A NAMELIST is a sequence of names, separated by '\0', and terminated
- by an empty name (i.e. by "\0\0"). */
+ by an empty name (i.e. by "\0\0"). */
-typedef const char* namelist;
+typedef const char *namelist;
-/* The following macros provide the bits for symbol_flags. */
+/* The following macros provide the bits for symbol_flags. */
typedef int symbol_flags;
-/* Used to mark names defined in the ANSI/ISO C standard. */
+/* Used to mark names defined in the ANSI/ISO C standard. */
#define ANSI_SYMBOL 1
-/* Used to mark names defined in the Posix.1 or Posix.2 standard. */
+/* Used to mark names defined in the Posix.1 or Posix.2 standard. */
#define POSIX1_SYMBOL 2
#define POSIX2_SYMBOL 4
-/* Used to mark names defined in X/Open Portability Guide. */
+/* Used to mark names defined in X/Open Portability Guide. */
#define XOPEN_SYMBOL 8
-/* Used to mark names defined in X/Open UNIX Extensions. */
+/* Used to mark names defined in X/Open UNIX Extensions. */
#define XOPEN_EXTENDED_SYMBOL 16
/* Used to indicate names that are not functions */
cur_symbol_table_size++;
if (cur_symbol_table_size >= SYMBOL_TABLE_SIZE)
fatal ("too many calls to add_symbols");
- symbol_table[cur_symbol_table_size].names = NULL; /* Termination. */
+ symbol_table[cur_symbol_table_size].names = NULL; /* Termination. */
}
struct std_include_entry {
namelist names;
};
-const char NONE[] = ""; /* The empty namelist. */
+const char NONE[] = ""; /* The empty namelist. */
-/* Special name to indicate a continuation line in std_include_table. */
+/* Special name to indicate a continuation line in std_include_table. */
const char CONTINUED[] = "";
struct std_include_entry *include_entry;
{ "errno.h", ANSI_SYMBOL|MACRO_SYMBOL, "errno\0" },
- /* ANSI_SYMBOL is wrong, but ... */
+ /* ANSI_SYMBOL is wrong, but ... */
{ "curses.h", ANSI_SYMBOL, "box\0delwin\0endwin\0getcurx\0getcury\0initscr\0\
mvcur\0mvwprintw\0mvwscanw\0newwin\0overlay\0overwrite\0\
scroll\0subwin\0touchwin\0waddstr\0wclear\0wclrtobot\0wclrtoeol\0\
{ "pwd.h", POSIX1_SYMBOL, "getpwnam\0getpwuid\0" },
- /* Left out siglongjmp sigsetjmp - these depend on sigjmp_buf. */
+ /* Left out siglongjmp sigsetjmp - these depend on sigjmp_buf. */
{ "setjmp.h", ANSI_SYMBOL, "longjmp\0setjmp\0" },
/* Left out signal() - its prototype is too complex for us!
Also left out "sigaction sigaddset sigdelset sigemptyset
sigfillset sigismember sigpending sigprocmask sigsuspend"
because these need sigset_t or struct sigaction.
- Most systems that provide them will also declare them. */
+ Most systems that provide them will also declare them. */
{ "signal.h", ANSI_SYMBOL, "kill\0raise\0" },
{ "stdio.h", ANSI_SYMBOL,
setvbuf\0sprintf\0sscanf\0vprintf\0vsprintf\0vfprintf\0tmpfile\0\
tmpnam\0ungetc\0" },
{ CONTINUED, POSIX1_SYMBOL, "fdopen\0fileno\0" },
- { CONTINUED, POSIX2_SYMBOL, "pclose\0popen\0" }, /* I think ... */
+ { CONTINUED, POSIX2_SYMBOL, "pclose\0popen\0" }, /* I think ... */
/* Should perhaps also handle NULL, EOF, ... ? */
/* "div ldiv", - ignored because these depend on div_t, ldiv_t
/* Actually, XPG4 does not seem to have <sys/ioctl.h>, but defines
ioctl in <strops.h>. However, many systems have it is sys/ioctl.h,
- and many systems do have <sys/ioctl.h> but not <strops.h>. */
+ and many systems do have <sys/ioctl.h> but not <strops.h>. */
{ "sys/ioctl.h", XOPEN_EXTENDED_SYMBOL, "ioctl\0" },
{ "sys/socket.h", XOPEN_EXTENDED_SYMBOL, "socket\0" },
enum special_file special_file_handling = no_special;
-/* They are set if the corresponding macro has been seen. */
+/* They are set if the corresponding macro has been seen. */
/* The following are only used when handling sys/stat.h */
int seen_S_IFBLK = 0, seen_S_ISBLK = 0;
int seen_S_IFCHR = 0, seen_S_ISCHR = 0;
/* The following are only used when handling stdlib.h */
int seen_EXIT_FAILURE = 0, seen_EXIT_SUCCESS = 0;
\f
-/* Wrapper around free, to avoid prototype clashes. */
+/* Wrapper around free, to avoid prototype clashes. */
void
xfree (ptr)
struct obstack scan_file_obstack;
/* NOTE: If you edit this, also edit gen-protos.c !! */
+
struct fn_decl *
lookup_std_proto (name, name_length)
const char *name;
recognized_macro (fname)
char *fname;
{
- /* The original include file defines fname as a macro. */
+ /* The original include file defines fname as a macro. */
struct fn_decl *fn = lookup_std_proto (fname, strlen (fname));
- /* Since fname is a macro, don't require a prototype for it. */
+ /* Since fname is a macro, don't require a prototype for it. */
if (fn)
{
if (REQUIRED (fn))
KIND is 'I' for an inline function;
'F' if a normal function declaration preceded by 'extern "C"'
(or nested inside 'extern "C"' braces); or
- 'f' for other function declarations. */
+ 'f' for other function declarations. */
void
recognized_function (fname, fname_length,
fn = lookup_std_proto (fname, fname_length);
- /* Remove the function from the list of required function. */
+ /* Remove the function from the list of required function. */
if (fn)
{
if (REQUIRED (fn))
SET_SEEN (fn);
}
- /* If we have a full prototype, we're done. */
+ /* If we have a full prototype, we're done. */
if (have_arg_list)
return;
return;
/* If the partial prototype was included from some other file,
- we don't need to patch it up (in this run). */
+ we don't need to patch it up (in this run). */
i = strlen (file_seen);
if (i < inc_filename_length
|| strcmp (inc_filename, file_seen + (i - inc_filename_length)) != 0)
return;
/* We only have a partial function declaration,
- so remember that we have to add a complete prototype. */
+ so remember that we have to add a complete prototype. */
partial_count++;
- partial = (struct partial_proto*)
+ partial = (struct partial_proto *)
obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
partial->fname = obstack_alloc (&scan_file_obstack, fname_length + 1);
bcopy (fname, partial->fname, fname_length);
}
/* For any name in NAMES that is defined as a macro,
- call recognized_macro on it. */
+ call recognized_macro on it. */
void
check_macro_names (pfile, names)
exit (0);
/* Traditionally, getc and putc are defined in terms of _filbuf and _flsbuf.
- If so, those functions are also required. */
+ If so, those functions are also required. */
if (special_file_handling == stdio_h
&& (fn = lookup_std_proto ("_filbuf", 7)) != NULL)
{
int old_written = CPP_WRITTEN (&scan_in);
int seen_filbuf = 0;
- /* Scan the macro expansion of "getchar();". */
+ /* Scan the macro expansion of "getchar();". */
for (;;)
{
enum cpp_token token = cpp_get_token (&scan_in);
int length = CPP_WRITTEN (&scan_in) - old_written;
CPP_SET_WRITTEN (&scan_in, old_written);
- if (token == CPP_EOF) /* Should not happen ... */
+ if (token == CPP_EOF) /* Should not happen ... */
break;
if (token == CPP_POP && CPP_BUFFER (&scan_in) == buf)
{
int need_flsbuf
= flsbuf_fn && !SEEN (flsbuf_fn) && !REQUIRED (flsbuf_fn);
- /* Append "_filbuf" and/or "_flsbuf" to the required functions. */
+ /* Append "_filbuf" and/or "_flsbuf" to the required functions. */
if (need_filbuf + need_flsbuf)
{
char *new_list;
#endif
}
- /* Now we print out prototypes for those functions that we haven't seen. */
+ /* Now we print out prototypes for those functions that we haven't seen. */
for (cur_symbols = &symbol_table[0]; cur_symbols->names; cur_symbols++)
{
int if_was_emitted = 0;
*/
-#define INF_GET() (inf_ptr < inf_limit ? *(unsigned char*)inf_ptr++ : EOF)
+#define INF_GET() (inf_ptr < inf_limit ? *(unsigned char *) inf_ptr++ : EOF)
#define INF_UNGET(c) ((c)!=EOF && inf_ptr--)
int
return c;
}
-/* Read into STR from inf_buffer upto DELIM. */
+/* Read into STR from inf_buffer upto DELIM. */
int
inf_read_upto (str, delim)
/* Returns 1 if the file is correctly protected against multiple
inclusion, setting *ifndef_line to the line number of the initial #ifndef
and setting *endif_line to the final #endif.
- Otherwise return 0. */
+ Otherwise return 0. */
int
check_protection (ifndef_line, endif_line)
char *protect_name = NULL; /* Identifier following initial #ifndef */
int define_seen = 0;
- /* Skip initial white space (including comments). */
+ /* Skip initial white space (including comments). */
for (;; lineno++)
{
c = inf_skip_spaces (' ');
if (SSTRING_LENGTH (&buf) == 0 || strcmp (buf.base, "ifndef") != 0)
return 0;
- /* So far so good: We've seen an initial #ifndef. */
+ /* So far so good: We've seen an initial #ifndef. */
*ifndef_line = lineno;
c = inf_scan_ident (&buf, inf_skip_spaces (c));
if (SSTRING_LENGTH (&buf) == 0 || c == EOF)
if (!define_seen)
return 0;
*endif_line = lineno;
- /* Skip final white space (including comments). */
+ /* Skip final white space (including comments). */
for (;;)
{
c = inf_skip_spaces (' ');
else
symbol_table[0].names = NULL;
- /* Count and mark the prototypes required for this include file. */
+ /* Count and mark the prototypes required for this include file. */
for (cur_symbols = &symbol_table[0]; cur_symbols->names; cur_symbols++)
{
int name_len;
exit (-1);
}
inf_size = sbuf.st_size;
- inf_buffer = (char*) xmalloc (inf_size + 2);
+ inf_buffer = (char *) xmalloc (inf_size + 2);
inf_buffer[inf_size] = '\n';
inf_buffer[inf_size + 1] = '\0';
inf_limit = inf_buffer + inf_size;
close (inf_fd);
- /* If file doesn't end with '\n', add one. */
+ /* If file doesn't end with '\n', add one. */
if (inf_limit > inf_buffer && inf_limit[-1] != '\n')
inf_limit++;
rbrac_line = -1;
}
- /* Reset input file. */
+ /* Reset input file. */
inf_ptr = inf_buffer;
lineno = 1;
fn = lookup_std_proto (buf.base, strlen (buf.base));
/* We only want to edit the declaration matching the one
seen by scan-decls, as there can be multiple
- declarations, selected by #ifdef __STDC__ or whatever. */
+ declarations, selected by #ifdef __STDC__ or whatever. */
if (fn && fn->partial && fn->partial->line_seen == lineno)
{
c = inf_skip_spaces (' ');
}
\f
/* Stub error functions. These replace cpperror.c,
- because we want to suppress error messages. */
+ because we want to suppress error messages. */
void
cpp_file_line_for_message (pfile, filename, line, column)
}
/* IS_ERROR is 2 for fatal error, 1 for error, 0 for warning */
+
void cpp_message (pfile, is_error, msg, arg1, arg2, arg3)
int is_error;
cpp_reader *pfile;
extern int flag_pic;
+/* Nonzero means generate extra code for exception handling and enable
+ exception handling. */
+
+extern int flag_exceptions;
+
/* Nonzero means don't place uninitialized global data in common storage
by default. */
--- /dev/null
+/*
+** libgcc support for software floating point.
+** Copyright (C) 1991 by Pipeline Associates, Inc. All rights reserved.
+** Permission is granted to do *anything* you want with this file,
+** commercial or otherwise, provided this message remains intact. So there!
+** I would appreciate receiving any updates/patches/changes that anyone
+** makes, and am willing to be the repository for said changes (am I
+** making a big mistake?).
+
+Warning! Only single-precision is actually implemented. This file
+won't really be much use until double-precision is supported.
+
+However, once that is done, this file might eventually become a
+replacement for libgcc1.c. It might also make possible
+cross-compilation for an IEEE target machine from a non-IEEE
+host such as a VAX.
+
+If you'd like to work on completing this, please talk to rms@gnu.ai.mit.edu.
+
+
+**
+** Pat Wood
+** Pipeline Associates, Inc.
+** pipeline!phw@motown.com or
+** sun!pipeline!phw or
+** uunet!motown!pipeline!phw
+**
+** 05/01/91 -- V1.0 -- first release to gcc mailing lists
+** 05/04/91 -- V1.1 -- added float and double prototypes and return values
+** -- fixed problems with adding and subtracting zero
+** -- fixed rounding in truncdfsf2
+** -- fixed SWAP define and tested on 386
+*/
+
+/*
+** The following are routines that replace the libgcc soft floating point
+** routines that are called automatically when -msoft-float is selected.
+** The support single and double precision IEEE format, with provisions
+** for byte-swapped machines (tested on 386). Some of the double-precision
+** routines work at full precision, but most of the hard ones simply punt
+** and call the single precision routines, producing a loss of accuracy.
+** long long support is not assumed or included.
+** Overall accuracy is close to IEEE (actually 68882) for single-precision
+** arithmetic. I think there may still be a 1 in 1000 chance of a bit
+** being rounded the wrong way during a multiply. I'm not fussy enough to
+** bother with it, but if anyone is, knock yourself out.
+**
+** Efficiency has only been addressed where it was obvious that something
+** would make a big difference. Anyone who wants to do this right for
+** best speed should go in and rewrite in assembler.
+**
+** I have tested this only on a 68030 workstation and 386/ix integrated
+** in with -msoft-float.
+*/
+
+/* the following deal with IEEE single-precision numbers */
+#define D_PHANTOM_BIT 0x00100000
+#define EXCESS 126
+#define SIGNBIT 0x80000000
+#define HIDDEN (1 << 23)
+#define SIGN(fp) ((fp) & SIGNBIT)
+#define EXP(fp) (((fp) >> 23) & 0xFF)
+#define MANT(fp) (((fp) & 0x7FFFFF) | HIDDEN)
+#define PACK(s,e,m) ((s) | ((e) << 23) | (m))
+
+/* the following deal with IEEE double-precision numbers */
+#define EXCESSD 1022
+#define HIDDEND (1 << 20)
+#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
+#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
+#define MANTD(fp) (((((fp.l.upper) & 0xFFFFF) | HIDDEND) << 10) | \
+ (fp.l.lower >> 22))
+
+/* define SWAP for 386/960 reverse-byte-order brain-damaged CPUs */
+union double_long
+ {
+ double d;
+#ifdef SWAP
+ struct {
+ unsigned long lower;
+ long upper;
+ } l;
+#else
+ struct {
+ long upper;
+ unsigned long lower;
+ } l;
+#endif
+ };
+
+union float_long
+ {
+ float f;
+ long l;
+ };
+
+ struct _ieee {
+#ifdef SWAP
+ unsigned mantissa2 : 32;
+ unsigned mantissa1 : 20;
+ unsigned exponent : 11;
+ unsigned sign : 1;
+#else
+ unsigned exponent : 11;
+ unsigned sign : 1;
+ unsigned mantissa2 : 32;
+ unsigned mantissa1 : 20;
+#endif
+ };
+
+ union _doubleu {
+ double d;
+ struct _ieee ieee;
+#ifdef SWAP
+ struct {
+ unsigned long lower;
+ long upper;
+ } l;
+#else
+ struct {
+ long upper;
+ unsigned long lower;
+ } l;
+#endif
+ };
+
+/* add two floats */
+
+float
+__addsf3 (float a1, float a2)
+{
+ register long mant1, mant2;
+ register union float_long fl1, fl2;
+ register int exp1, exp2;
+ int sign = 0;