/* $Header$ */
/* L E X I C A L A N A L Y Z E R */
+#include "nofloat.h"
#include "idfsize.h"
#include "numsize.h"
#include "debug.h"
#include "strsize.h"
#include "nopp.h"
-
#include "input.h"
#include "alloc.h"
#include "arith.h"
to it.
*/
+#include "nofloat.h"
+
/* the structure of a token: */
struct token {
int tok_symb; /* the token itself */
/* $Header$ */
/* PARSER ERROR ADMINISTRATION */
+#include "nofloat.h"
#include "idf.h"
#include "alloc.h"
#include "arith.h"
# .h files generated by `make hfiles'; PLEASE KEEP THIS UP-TO-DATE!
GHSRC = botch_free.h dataflow.h debug.h density.h errout.h \
idepth.h idfsize.h ifdepth.h inputtype.h inumlength.h lapbuf.h \
- maxincl.h myalloc.h nobitfield.h nopp.h \
+ maxincl.h myalloc.h nobitfield.h nofloat.h nopp.h \
nparams.h numsize.h parbufsize.h pathlength.h predefine.h \
strsize.h target_sizes.h textsize.h use_tmp.h spec_arith.h static.h
$(SIM) $(SIMFLAGS) `sources $(COBJ)` $(GSRC) $(LSRC)
#AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h
-idf.o: LLlex.h Lpars.h align.h alloc.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h idf.h idfsize.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h specials.h stack.h storage.h struct.h type.h
-declarator.o: Lpars.h alloc.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h
-decspecs.o: Lpars.h arith.h decspecs.h def.h level.h nobitfield.h spec_arith.h type.h
-struct.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h def.h field.h idf.h level.h nobitfield.h nopp.h sizes.h spec_arith.h stack.h storage.h struct.h type.h
-expr.o: LLlex.h Lpars.h alloc.h arith.h botch_free.h declar.h decspecs.h def.h expr.h idf.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h
-ch7.o: Lpars.h arith.h assert.h debug.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h struct.h type.h
-ch7bin.o: Lpars.h arith.h botch_free.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h storage.h struct.h type.h
-cstoper.o: Lpars.h arith.h assert.h debug.h expr.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h target_sizes.h type.h
-arith.o: Lpars.h alloc.h arith.h botch_free.h expr.h field.h idf.h label.h mes.h nobitfield.h nopp.h spec_arith.h storage.h type.h
+LLlex.o: LLlex.h Lpars.h alloc.h arith.h assert.h class.h debug.h def.h idf.h idfsize.h input.h nofloat.h nopp.h numsize.h sizes.h spec_arith.h strsize.h
+LLmessage.o: LLlex.h Lpars.h alloc.h arith.h idf.h nofloat.h nopp.h spec_arith.h
+Lpars.o: Lpars.h
alloc.o: alloc.h assert.h debug.h myalloc.h
-code.o: LLlex.h Lpars.h alloc.h arith.h assert.h atw.h botch_free.h code.h dataflow.h debug.h declar.h decspecs.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nopp.h sizes.h spec_arith.h specials.h stack.h stmt.h storage.h type.h use_tmp.h
-dumpidf.o: Lpars.h arith.h debug.h def.h expr.h field.h idf.h label.h nobitfield.h nopp.h spec_arith.h stack.h static.h struct.h type.h
-error.o: LLlex.h arith.h debug.h errout.h expr.h label.h nopp.h spec_arith.h tokenname.h use_tmp.h
-field.o: Lpars.h arith.h assert.h code.h debug.h expr.h field.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h type.h
-tokenname.o: LLlex.h Lpars.h arith.h idf.h nopp.h spec_arith.h tokenname.h
-LLlex.o: LLlex.h Lpars.h alloc.h arith.h assert.h class.h debug.h def.h idf.h idfsize.h input.h nopp.h numsize.h sizes.h spec_arith.h strsize.h
-LLmessage.o: LLlex.h Lpars.h alloc.h arith.h idf.h nopp.h spec_arith.h
-input.o: LLlex.h alloc.h arith.h assert.h debug.h idepth.h input.h inputtype.h interface.h nopp.h pathlength.h spec_arith.h static.h
-domacro.o: LLlex.h Lpars.h alloc.h arith.h assert.h botch_free.h class.h debug.h idf.h idfsize.h ifdepth.h input.h interface.h macro.h nopp.h nparams.h parbufsize.h spec_arith.h storage.h textsize.h
-replace.o: LLlex.h alloc.h arith.h assert.h class.h debug.h idf.h input.h interface.h macro.h nopp.h pathlength.h spec_arith.h static.h strsize.h
+arith.o: Lpars.h alloc.h arith.h botch_free.h expr.h field.h idf.h label.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h type.h
+blocks.o: arith.h atw.h nofloat.h sizes.h spec_arith.h
+ch7.o: Lpars.h arith.h assert.h debug.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h struct.h type.h
+ch7bin.o: Lpars.h arith.h botch_free.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h struct.h type.h
+ch7mon.o: Lpars.h arith.h botch_free.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h type.h
+char.o: class.h
+code.o: LLlex.h Lpars.h alloc.h arith.h assert.h atw.h botch_free.h code.h dataflow.h debug.h declar.h decspecs.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h stmt.h storage.h type.h use_tmp.h
+conversion.o: Lpars.h arith.h nobitfield.h nofloat.h sizes.h spec_arith.h type.h
+cstoper.o: Lpars.h arith.h assert.h debug.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h target_sizes.h type.h
+dataflow.o: dataflow.h
+declar.o: LLlex.h Lpars.h arith.h debug.h declar.h decspecs.h def.h expr.h field.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h struct.h type.h
+declarator.o: Lpars.h alloc.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h type.h
+decspecs.o: Lpars.h arith.h decspecs.h def.h level.h nobitfield.h nofloat.h spec_arith.h type.h
+domacro.o: LLlex.h Lpars.h alloc.h arith.h assert.h botch_free.h class.h debug.h idf.h idfsize.h ifdepth.h input.h interface.h macro.h nofloat.h nopp.h nparams.h parbufsize.h spec_arith.h storage.h textsize.h
+dumpidf.o: Lpars.h arith.h debug.h def.h expr.h field.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h static.h struct.h type.h
+error.o: LLlex.h arith.h debug.h errout.h expr.h label.h nofloat.h nopp.h spec_arith.h tokenname.h use_tmp.h
+eval.o: Lpars.h align.h arith.h assert.h atw.h code.h dataflow.h debug.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h stack.h type.h
+expr.o: LLlex.h Lpars.h alloc.h arith.h botch_free.h declar.h decspecs.h def.h expr.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h type.h
+expression.o: LLlex.h Lpars.h arith.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
+field.o: Lpars.h arith.h assert.h code.h debug.h expr.h field.h idf.h label.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h type.h
+idf.o: LLlex.h Lpars.h align.h alloc.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h idf.h idfsize.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h specials.h stack.h storage.h struct.h type.h
init.o: alloc.h class.h idf.h interface.h macro.h nopp.h predefine.h
-options.o: align.h arith.h class.h idf.h idfsize.h macro.h maxincl.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h use_tmp.h
+input.o: LLlex.h alloc.h arith.h assert.h debug.h idepth.h input.h inputtype.h interface.h nofloat.h nopp.h pathlength.h spec_arith.h static.h
+ival.o: Lpars.h align.h arith.h assert.h class.h debug.h def.h expr.h field.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h struct.h type.h
+label.o: Lpars.h arith.h def.h idf.h label.h level.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
+main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nofloat.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h
+options.o: align.h arith.h class.h idf.h idfsize.h macro.h maxincl.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h use_tmp.h
+program.o: LLlex.h Lpars.h alloc.h arith.h code.h declar.h decspecs.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h type.h
+replace.o: LLlex.h alloc.h arith.h assert.h class.h debug.h idf.h input.h interface.h macro.h nofloat.h nopp.h pathlength.h spec_arith.h static.h strsize.h
scan.o: class.h idf.h input.h interface.h lapbuf.h macro.h nopp.h nparams.h
-skip.o: LLlex.h arith.h class.h input.h interface.h nopp.h spec_arith.h
-stack.o: Lpars.h alloc.h arith.h botch_free.h debug.h def.h idf.h level.h mes.h nobitfield.h nopp.h spec_arith.h stack.h storage.h struct.h type.h use_tmp.h
-type.o: Lpars.h align.h alloc.h arith.h def.h idf.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h
-ch7mon.o: Lpars.h arith.h botch_free.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h storage.h type.h
-label.o: Lpars.h arith.h def.h idf.h label.h level.h nobitfield.h nopp.h spec_arith.h type.h
-eval.o: Lpars.h align.h arith.h assert.h atw.h code.h dataflow.h debug.h def.h expr.h idf.h label.h level.h mes.h nobitfield.h nopp.h sizes.h spec_arith.h stack.h type.h
-switch.o: Lpars.h arith.h assert.h botch_free.h code.h debug.h density.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h storage.h switch.h type.h
+skip.o: LLlex.h arith.h class.h input.h interface.h nofloat.h nopp.h spec_arith.h
+stack.o: Lpars.h alloc.h arith.h botch_free.h debug.h def.h idf.h level.h mes.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h storage.h struct.h type.h use_tmp.h
+statement.o: LLlex.h Lpars.h arith.h botch_free.h code.h debug.h def.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h stack.h storage.h type.h
storage.o: alloc.h assert.h botch_free.h debug.h storage.h
-ival.o: Lpars.h align.h arith.h assert.h class.h debug.h def.h expr.h field.h idf.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h struct.h type.h
-conversion.o: Lpars.h arith.h nobitfield.h sizes.h spec_arith.h type.h
-blocks.o: arith.h atw.h sizes.h spec_arith.h
-dataflow.o: dataflow.h
-tokenfile.o: Lpars.h
-declar.o: LLlex.h Lpars.h arith.h debug.h declar.h decspecs.h def.h expr.h field.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h struct.h type.h
-statement.o: LLlex.h Lpars.h arith.h botch_free.h code.h debug.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h stack.h storage.h type.h
-expression.o: LLlex.h Lpars.h arith.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h type.h
-program.o: LLlex.h Lpars.h alloc.h arith.h code.h declar.h decspecs.h def.h expr.h idf.h label.h nobitfield.h nopp.h spec_arith.h type.h
-Lpars.o: Lpars.h
-char.o: class.h
+struct.o: LLlex.h Lpars.h align.h arith.h assert.h botch_free.h debug.h def.h field.h idf.h level.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h stack.h storage.h struct.h type.h
+switch.o: Lpars.h arith.h assert.h botch_free.h code.h debug.h density.h expr.h idf.h label.h nobitfield.h nofloat.h nopp.h spec_arith.h storage.h switch.h type.h
symbol2str.o: Lpars.h
+tokenfile.o: Lpars.h
+tokenname.o: LLlex.h Lpars.h arith.h idf.h nofloat.h nopp.h spec_arith.h tokenname.h
+type.o: Lpars.h align.h alloc.h arith.h def.h idf.h nobitfield.h nofloat.h nopp.h sizes.h spec_arith.h storage.h type.h
!File: static.h
#define GSTATIC /* for large global "static" arrays */
+
+
+!File: nofloat.h
+#undef NOFLOAT /* floats implemented by default */
+
/* $Header$ */
/* A L I G N M E N T D E F I N I T I O N S */
+#include "nofloat.h"
+
extern int
short_align, word_align, int_align, long_align,
#ifndef NOFLOAT
semantics of C is a mess.
*/
+#include "nofloat.h"
#include "botch_free.h"
#include "nobitfield.h"
#include "alloc.h"
int
arithbalance(e1p, oper, e2p) /* RM 6.6 */
- struct expr **e1p, **e2p;
+ register struct expr **e1p, **e2p;
+ int oper;
{
/* The expressions *e1p and *e2p are balanced to be operands
of the arithmetic operator oper.
/* Turns any expression into int_type, long_type or
double_type.
*/
- int fund = (*expp)->ex_type->tp_fund;
+ int fund;
- switch (fund) {
+ switch (fund = (*expp)->ex_type->tp_fund) {
case CHAR:
case SHORT:
int2int(expp,
}
erroneous2int(expp)
- struct expr **expp;
+ register struct expr **expp;
{
/* the (erroneous) expression *expp is replaced by an
int expression
arith2arith(tp, oper, expr)
struct type *tp;
int oper;
- struct expr *expr;
+ register struct expr *expr;
{
/* arith2arith constructs a new expression containing a
run-time conversion between some arithmetic types.
}
function2pointer(expp)
- struct expr **expp;
+ register struct expr **expp;
{
/* The expression, which must be a function, is converted
to a pointer to the function.
/* The expression, which must be a string constant, is converted
to a pointer to the string-containing area.
*/
- struct expr *ex = *expp;
+ register struct expr *ex = *expp;
label lbl = data_label();
code_string(ex->SG_VALUE, ex->SG_LEN, lbl);
}
opnd2integral(expp, oper)
- struct expr **expp;
+ register struct expr **expp;
int oper;
{
register int fund = (*expp)->ex_type->tp_fund;
}
opnd2logical(expp, oper)
- struct expr **expp;
+ register struct expr **expp;
int oper;
{
register int fund;
if ((*expp)->ex_type->tp_fund == FIELD)
field2arith(expp);
#endif NOBITFIELD
-
- fund = (*expp)->ex_type->tp_fund;
-
- switch (fund) {
-
+ switch (fund = (*expp)->ex_type->tp_fund) {
case CHAR:
case SHORT:
case INT:
}
opnd2test(expp, oper)
- struct expr **expp;
+ register struct expr **expp;
{
opnd2logical(expp, oper);
if ((*expp)->ex_class == Oper && is_test_op((*expp)->OP_OPER))
}
any2opnd(expp, oper)
- struct expr **expp;
+ register struct expr **expp;
{
if (!*expp)
return;
/* $Header$ */
/* S E M A N T I C A N A L Y S I S -- C H A P T E R 7 RM */
+#include "nofloat.h"
#include "debug.h"
#include "nobitfield.h"
#include "idf.h"
/* $Header$ */
/* SEMANTIC ANALYSIS (CHAPTER 7RM) -- BINARY OPERATORS */
-#include "botch_free.h" /* UF */
+#include "nofloat.h"
+#include "botch_free.h"
#include "idf.h"
#include "arith.h"
#include "type.h"
/* $Header$ */
/* SEMANTIC ANALYSIS (CHAPTER 7RM) -- MONADIC OPERATORS */
+#include "nofloat.h"
#include "nobitfield.h"
#include "botch_free.h"
#include "Lpars.h"
/* $Header$ */
/* C O D E - G E N E R A T I N G R O U T I N E S */
+#include "nofloat.h"
#include <em.h>
-
#include "dataflow.h"
#include "use_tmp.h"
#include "botch_free.h"
-
#include "arith.h"
#include "type.h"
#include "idf.h"
int len;
label dlb;
{
- struct string_cst *sc = new_string_cst();
+ register struct string_cst *sc = new_string_cst();
C_ina_dlb(dlb);
sc->next = str_list;
and generates those exa's, exp's, ina's and inp's
that superior hindsight has provided, on the file dst_file.
*/
- struct stack_entry *se = local_level->sl_entry;
+ register struct stack_entry *se = local_level->sl_entry;
if (C_open(dst_file) == 0)
fatal("cannot create %s", dst_file ? dst_file : "stdout");
famous_first_words();
while (se != 0) {
- struct idf *idf = se->se_idf;
- struct def *def = idf->id_def;
+ register struct idf *idf = se->se_idf;
+ register struct def *def = idf->id_def;
if (def &&
( def->df_initialized ||
code_scope(text, def)
char *text;
- struct def *def;
+ register struct def *def;
{
/* generates code for one name, text, of the storage class
as given by def, if meaningful.
begin_proc(name, def) /* to be called when entering a procedure */
char *name;
- struct def *def;
+ register struct def *def;
{
/* begin_proc() is called at the entrance of a new function
and performs the necessary code generation:
}
code_declaration(idf, expr, lvl, sc)
- struct idf *idf; /* idf to be declared */
+ register struct idf *idf; /* idf to be declared */
struct expr *expr; /* initialisation; NULL if absent */
int lvl; /* declaration level */
int sc; /* storage class, as in the declaration */
extern int a = 5;
*/
char *text = idf->id_text;
- struct def *def = idf->id_def;
+ register struct def *def = idf->id_def;
arith size = def->df_type->tp_size;
int def_sc = def->df_sc;
}
bss(idf)
- struct idf *idf;
+ register struct idf *idf;
{
/* bss() allocates bss space for the global idf.
*/
C_bss_cst(align(size, word_align), (arith)0, 1);
}
-formal_cvt(def)
- struct def *def;
+formal_cvt(df)
+ register struct def *df;
{
/* formal_cvt() converts a formal parameter of type char or
short from int to that type.
*/
- register struct type* tp = def->df_type;
+ register struct type *tp = df->df_type;
if (tp->tp_size != int_size)
if (tp->tp_fund == CHAR || tp->tp_fund == SHORT) {
- C_lol(def->df_address);
- conversion(int_type, def->df_type);
- C_lal(def->df_address);
+ C_lol(df->df_address);
+ conversion(int_type, df->df_type);
+ C_lal(df->df_address);
C_sti(tp->tp_size);
- def->df_register = REG_NONE;
+ df->df_register = REG_NONE;
}
}
/* $Header$ */
/* C O N V E R S I O N - C O D E G E N E R A T O R */
+#include "nofloat.h"
#include <em.h>
#include "arith.h"
#include "type.h"
arith from_size;
arith to_size;
- if (from_type == to_type) { /* a little optimisation */
+ if (from_type == to_type) /* a little optimisation */
return;
- }
-
from_size = from_type->tp_size;
to_size = to_type->tp_size;
-
switch (fundamental(from_type)) {
-
case T_SIGNED:
switch (fundamental(to_type)) {
-
case T_SIGNED:
C_loc(from_size);
C_loc(to_size < word_size ? word_size : to_size);
C_cii();
break;
-
case T_UNSIGNED:
C_loc(from_size < word_size ? word_size : from_size);
C_loc(to_size < word_size ? word_size : to_size);
C_ciu();
break;
-
#ifndef NOFLOAT
case T_FLOATING:
C_loc(from_size < word_size ? word_size : from_size);
#endif NOFLOAT
}
break;
-
case T_UNSIGNED:
C_loc(from_size < word_size ? word_size : from_size);
C_loc(to_size < word_size ? word_size : to_size);
-
switch (fundamental(to_type)) {
-
case T_SIGNED:
C_cui();
break;
-
case T_UNSIGNED:
C_cuu();
break;
-
#ifndef NOFLOAT
case T_FLOATING:
C_cuf();
#endif NOFLOAT
}
break;
-
#ifndef NOFLOAT
case T_FLOATING:
C_loc(from_size < word_size ? word_size : from_size);
C_loc(to_size < word_size ? word_size : to_size);
-
switch (fundamental(to_type)) {
-
case T_SIGNED:
C_cfi();
break;
-
case T_UNSIGNED:
C_cfu();
break;
-
case T_FLOATING:
C_cff();
break;
*/
int
fundamental(tp)
- struct type *tp;
+ register struct type *tp;
{
switch (tp->tp_fund) {
-
case CHAR:
case SHORT:
case INT:
case LONG:
case ENUM:
return tp->tp_unsigned ? T_UNSIGNED : T_SIGNED;
-
#ifndef NOFLOAT
case FLOAT:
case DOUBLE:
return T_FLOATING;
#endif NOFLOAT
-
case POINTER: /* pointer : signed / unsigned ??? */
return T_SIGNED;
}
/* $Header$ */
/* C O N S T A N T E X P R E S S I O N H A N D L I N G */
-#include "target_sizes.h" /* UF */
-
+#include "target_sizes.h"
#include "idf.h"
#include "arith.h"
#include "type.h"
arith max_unsigned; /* maximum unsigned on target machine */
cstbin(expp, oper, expr)
- struct expr **expp, *expr;
+ register struct expr **expp, *expr;
{
/* The operation oper is performed on the constant
expressions *expp(ld) and expr(ct), and the result restored in
*expp.
*/
- arith o1 = (*expp)->VL_VALUE;
- arith o2 = expr->VL_VALUE;
+ register arith o1 = (*expp)->VL_VALUE;
+ register arith o2 = expr->VL_VALUE;
int uns = (*expp)->ex_type->tp_unsigned;
ASSERT(is_ld_cst(*expp) && is_cp_cst(expr));
}
cut_size(expr)
- struct expr *expr;
+ register struct expr *expr;
{
/* The constant value of the expression expr is made to
conform to the size of the type of the expression.
init_cst()
{
- int i = 0;
- arith bt = (arith)0;
+ register int i = 0;
+ register arith bt = (arith)0;
while (!(bt < 0)) {
bt = (bt << 8) + 0377, i++;
mach_long_sign = 1 << (mach_long_size * 8 - 1);
if (long_size < mach_long_size)
fatal("sizeof (long) insufficient on this machine");
-
-
max_int = full_mask[int_size] & ~(1 << (int_size * 8 - 1));
max_unsigned = full_mask[int_size];
}
}
add_decl_unary(dc, fund, count, fm)
- struct declarator *dc;
+ register struct declarator *dc;
arith count;
struct formal *fm;
{
}
reject_params(dc)
- struct declarator *dc;
+ register struct declarator *dc;
{
/* The declarator is checked to have no parameters, if it
is a function.
}
array_subscript(expr)
- struct expr *expr;
+ register struct expr *expr;
{
arith size = expr->VL_VALUE;
/* $Header$ */
/* D E C L A R A T I O N S P E C I F I E R C H E C K I N G */
+#include "nofloat.h"
#include "Lpars.h"
#include "decspecs.h"
#include "arith.h"
struct decspecs null_decspecs;
do_decspecs(ds)
- struct decspecs *ds;
+ register struct decspecs *ds;
{
/* The provisional decspecs ds as obtained from the program
is turned into a legal consistent decspecs.
*/
- struct type *tp = ds->ds_type;
+ register struct type *tp = ds->ds_type;
if (level == L_FORMAL1)
crash("do_decspecs");
#include "debug.h"
#ifdef DEBUG
+#include "nofloat.h"
#include "nopp.h"
#include "nobitfield.h"
#include "arith.h"
static
newline() {
- int dl = dumplevel;
+ register int dl = dumplevel;
print("\n");
while (dl >= 2) {
print(">>> DUMPIDF, %s (start)", msg);
dumpstack();
for (i = 0; i < HASHSIZE; i++) {
- struct idf *notch = idf_hashtable[i];
+ register struct idf *notch = idf_hashtable[i];
while (notch) {
dumpidf(notch, opt);
print(">>> DUMPIDF, %s (end)\n", msg);
}
-dumpstack() {
+dumpstack()
+{
/* Dumps the identifier stack, starting at the top.
*/
- struct stack_level *stl = local_level;
+ register struct stack_level *stl = local_level;
while (stl) {
- struct stack_entry *se = stl->sl_entry;
+ register struct stack_entry *se = stl->sl_entry;
newline();
print("%3d: ", stl->sl_level);
}
dumpidf(idf, opt)
- struct idf *idf;
+ register struct idf *idf;
{
/* All information about the identifier idf is divulged in a
hopefully readable format.
}
dumptags(tag)
- struct tag *tag;
+ register struct tag *tag;
{
dumplevel++;
while (tag) {
}
dumpsdefs(sdef, sdk)
- struct sdef *sdef;
+ register struct sdef *sdef;
enum sdef_kind sdk;
{
/* Since sdef's are members of two chains, there are actually
char *
type2str(tp)
- struct type *tp;
+ register struct type *tp;
{
/* Yields a pointer to a one-line description of the type tp.
*/
}
p1_expr(lvl, expr)
- struct expr *expr;
+ register struct expr *expr;
{
extern char *type2str(), *symbol2str();
}
}
-p1_indent(lvl) {
+p1_indent(lvl)
+ register int lvl;
+{
while (lvl--)
print(" ");
}
compare()
*/
+#include "nofloat.h"
#include <em.h>
-
#include "debug.h"
#include "nobitfield.h"
-
#include "dataflow.h"
#include "arith.h"
#include "type.h"
*/
EVAL(expr, val, code, true_label, false_label)
- struct expr *expr; /* the expression tree itself */
+ register struct expr *expr; /* the expression tree itself */
int val; /* either RVAL or LVAL */
int code; /* generate explicit code or not */
label true_label;
label false_label; /* labels to jump to in logical expr's */
{
- register gencode = (code == TRUE);
+ register int gencode = (code == TRUE);
switch (expr->ex_class) {
case Value: /* just a simple value */
case String: /* a string constant */
expr_warning(expr, "(DEBUG) value-class 'String' seen");
if (gencode) {
- string2pointer(&expr);
+ struct expr *ex = expr;
+ string2pointer(&ex);
+ expr = ex;
C_lae_dlb(expr->VL_LBL, expr->VL_VALUE);
}
break;
#endif NOFLOAT
case Oper: /* compound expression */
{
- register int oper = expr->OP_OPER;
+ int oper = expr->OP_OPER;
register struct expr *leftop = expr->OP_LEFT;
register struct expr *rightop = expr->OP_RIGHT;
register struct type *tp = expr->OP_TYPE;
EVAL(leftop, RVAL, code, NO_LABEL, NO_LABEL);
EVAL(rightop, RVAL, code, NO_LABEL, NO_LABEL);
ASSERT(tp->tp_fund==INT || tp->tp_fund==LONG);
- if (gencode) {
+ if (gencode)
if (tp->tp_unsigned)
C_rmu(tp->tp_size);
else
C_rmi(tp->tp_size);
- }
break;
case LEFT:
EVAL(leftop, RVAL, code, NO_LABEL, NO_LABEL);
}
case '(':
{
- register struct expr *expr;
+ register struct expr *ex;
arith ParSize = (arith)0;
- if (expr = rightop) {
+ if ((ex = rightop) != NILEXPR) {
/* function call with parameters*/
- while ( expr->ex_class == Oper &&
- expr->OP_OPER == PARCOMMA
- ) {
- EVAL(expr->OP_RIGHT, RVAL, TRUE,
+ while ( ex->ex_class == Oper &&
+ ex->OP_OPER == PARCOMMA
+ ) {
+ EVAL(ex->OP_RIGHT, RVAL, TRUE,
NO_LABEL, NO_LABEL);
- ParSize +=
- ATW(expr->ex_type->tp_size);
- expr = expr->OP_LEFT;
+ ParSize += ATW(ex->ex_type->tp_size);
+ ex = ex->OP_LEFT;
}
- EVAL(expr, RVAL, TRUE, NO_LABEL, NO_LABEL);
- ParSize += ATW(expr->ex_type->tp_size);
+ EVAL(ex, RVAL, TRUE, NO_LABEL, NO_LABEL);
+ ParSize += ATW(ex->ex_type->tp_size);
}
if ( leftop->ex_class == Value
&& leftop->VL_CLASS == Name
/* remove parameters from stack */
if (ParSize > (arith)0)
C_asp(ParSize);
- if (!gencode)
- break;
- if (is_struct_or_union(tp->tp_fund)) {
- C_lfr(pointer_size);
- load_block(tp->tp_size, tp->tp_align);
+ if (gencode) {
+ if (is_struct_or_union(tp->tp_fund)) {
+ C_lfr(pointer_size);
+ load_block(tp->tp_size, tp->tp_align);
+ }
+ else
+ C_lfr(ATW(tp->tp_size));
}
- else
- C_lfr(ATW(tp->tp_size));
break;
}
case '.':
{
arith old_offset, tmp;
arith esize = tp->tp_size;
+ int compl; /* Complexity of left operand */
#ifndef NOBITFIELD
if (leftop->ex_type->tp_fund == FIELD) {
eval_field(expr, code);
break;
}
#endif NOBITFIELD
- if (leftop->ex_class != Value) {
+ if (leftop->ex_class == Value) {
+ compl = 0; /* Value */
+ load_val(leftop, RVAL);
+ }
+ else
+ if (leftop->ex_depth == 1 && leftop->OP_OPER == ARROW) {
+ compl = 1; /* Value->sel */
+ ASSERT(leftop->OP_LEFT->ex_class == Value);
+ EVAL(leftop, RVAL, TRUE, NO_LABEL, NO_LABEL);
+ }
+ else {
+ compl = 2; /* otherwise */
tmp = tmp_pointer_var(&old_offset);
EVAL(leftop, LVAL, TRUE, NO_LABEL, NO_LABEL);
C_dup(pointer_size);
C_lal(tmp);
C_sti(pointer_size);
- C_loi(tp->tp_size);
+ C_loi(esize);
}
- else
- load_val(leftop, RVAL);
/* We made the choice to put this stuff here
and not to put the conversion in the expression
C_dup(esize);
if (tp->tp_size < word_size)
conversion(word_type, tp);
- if (leftop->ex_class != Value) {
+ if (compl == 0) {
+ store_val(
+ &(leftop->ex_object.ex_value),
+ leftop->ex_type
+ );
+ }
+ else
+ if (compl == 1) {
+ EVAL(leftop, LVAL, TRUE, NO_LABEL, NO_LABEL);
+ C_sti(tp->tp_size);
+ }
+ else {
C_lal(tmp); /* always init'd */
C_loi(pointer_size);
C_sti(tp->tp_size);
free_tmp_var(old_offset);
}
- else
- store_val(
- &(leftop->ex_object.ex_value),
- leftop->ex_type
- );
break;
}
case '?': /* must be followed by ':' */
expr->ex_type->tp_align);
break;
}
- case Type:
default:
crash("(EVAL) bad expression class");
}
/* assop() generates the opcode of an assignment operators op= */
assop(type, oper)
- struct type *type;
+ register struct type *type;
int oper;
{
- register arith size = type->tp_size;
+ register arith size;
register uns = type->tp_unsigned;
- if (size < word_size)
+ if ((size = type->tp_size) < word_size)
size = word_size;
switch (type->tp_fund) {
case CHAR:
tmp_pointer_var(oldoffset)
arith *oldoffset; /* previous allocated address */
{
- struct stack_level *stl = local_level;
+ register struct stack_level *stl = local_level;
*oldoffset = stl->sl_local_offset;
stl->sl_local_offset =
- local variable
*/
load_val(expr, val)
- struct expr *expr; /* expression containing the value */
+ register struct expr *expr; /* expression containing the value */
int val; /* generate either LVAL or RVAL */
{
register struct type *tp = expr->ex_type;
- register int rvalue = (val == RVAL && expr->ex_lvalue != 0);
- register arith size = tp->tp_size;
- register int tpalign = tp->tp_align;
- register int al_on_word;
+ int rvalue = (val == RVAL && expr->ex_lvalue != 0);
+ arith size = tp->tp_size;
+ int tpalign = tp->tp_align;
+ int al_on_word;
register int inword, indword;
- register arith val = expr->VL_VALUE;
+ arith val = expr->VL_VALUE;
if (expr->VL_CLASS == Const) {
if (rvalue) { /* absolute addressing */
/* $Header$ */
/* EXPRESSION TREE HANDLING */
-#include "botch_free.h" /* UF */
+#include "nofloat.h"
+#include "botch_free.h"
#include "alloc.h"
#include "idf.h"
#include "arith.h"
int
rank_of_expression(expr)
- struct expr *expr;
+ register struct expr *expr;
{
/* Returns the rank of the top node in the expression.
*/
}
dot2expr(expp)
- struct expr **expp;
+ register struct expr **expp;
{
/* The token in dot is converted into an expression, a
pointer to which is stored in *expp.
}
idf2expr(expr)
- struct expr *expr;
+ register struct expr *expr;
{
/* Dot contains an identifier which is turned into an
expression.
}
string2expr(expr)
- struct expr *expr;
+ register struct expr *expr;
{
/* Dot contains a string which is turned into an expression.
*/
#ifndef NOFLOAT
float2expr(expr)
- struct expr *expr;
+ register struct expr *expr;
{
/* Dot contains a floating point constant which is turned
into an expression.
struct expr*
intexpr(ivalue, fund)
arith ivalue;
+ int fund;
{
/* The value ivalue is turned into an integer expression of
the size indicated by fund.
*/
- struct expr *expr = new_expr();
+ register struct expr *expr = new_expr();
clear((char *)expr, sizeof(struct expr));
expr->ex_file = dot.tk_file;
}
fill_int_expr(expr, ivalue, fund)
- struct expr *expr;
+ register struct expr *expr;
arith ivalue;
+ int fund;
{
/* Details derived from ivalue and fund are put into the
constant integer expression expr.
During the construction of the right recursive initialisation
tree it is possible for e2 to be NILEXPR.
*/
- struct expr *expr = new_expr();
- struct oper *op;
+ register struct expr *expr = new_expr();
+ register struct oper *op;
clear((char *)expr, sizeof(struct expr));
if (e2) {
- struct expr *e = e2;
+ register struct expr *e = e2;
while (e->ex_class == Oper && e->OP_LEFT)
e = e->OP_LEFT;
}
else
if (e1) {
- struct expr *e = e1;
+ register struct expr *e = e1;
while (e->ex_class == Oper && e->OP_RIGHT)
e = e->OP_RIGHT;
register struct expr *expr = *expp;
register int fund = expr->ex_type->tp_fund;
register int flags = expr->ex_flags;
- register int err = 0;
+ int err = 0;
#ifdef DEBUG
print_expr("constant_expression", expr);
}
init_expression(eppp, expr)
- struct expr ***eppp, *expr;
+ register struct expr ***eppp, *expr;
{
/* The expression expr is added to the tree designated
indirectly by **eppp.
#endif NOFLOAT
free_expression(expr)
- struct expr *expr;
+ register struct expr *expr;
{
/* The expression expr is freed recursively.
*/
a union of various goodies, we define them first; so be patient.
*/
+#include "nofloat.h"
+
/* classes of value */
#define Const 1
#define Name 2
/* $Header$ */
/* IDENTIFIER FIDDLING & SYMBOL TABLE HANDLING */
+#include "nofloat.h"
#include "debug.h"
#include "idfsize.h"
#include "botch_free.h"
hash_stat()
{
if (options['h']) {
- int i;
+ register int i;
print("Hash table tally:\n");
for (i = 0; i < HASHSIZE; i++) {
- struct idf *notch = idf_hashtable[i];
+ register struct idf *notch = idf_hashtable[i];
int cnt = 0;
while (notch) {
}
global_redecl(idf, new_sc, tp)
- struct idf *idf;
- struct type *tp;
+ register struct idf *idf;
+ register struct type *tp;
{
/* A global identifier may be declared several times,
provided the declarations do not conflict; they might
register struct def *def = idf->id_def;
if (tp != def->df_type) {
- struct type *otp = def->df_type;
+ register struct type *otp = def->df_type;
if ( tp->tp_fund != ARRAY || otp->tp_fund != ARRAY ||
tp->tp_up != otp->tp_up
return; /* no new information */
switch (def->df_sc) { /* the old storage class */
-
case EXTERN:
switch (new_sc) { /* the new storage class */
-
case EXTERN:
case GLOBAL:
break;
break;
}
break;
-
case GLOBAL:
switch (new_sc) { /* the new storage class */
-
case EXTERN:
def->df_sc = EXTERN;
break;
break;
}
break;
-
case STATIC:
switch (new_sc) { /* the new storage class */
-
case EXTERN:
if (def->df_initialized) {
error("cannot redeclare %s to extern",
break;
}
break;
-
case IMPLICIT:
switch (new_sc) { /* the new storage class */
-
case EXTERN:
case GLOBAL:
def->df_sc = new_sc;
break;
}
break;
-
case ENUM:
case TYPEDEF:
error("illegal redeclaration of %s", idf->id_text);
}
declare_params(dc)
- struct declarator *dc;
+ register struct declarator *dc;
{
/* Declares the formal parameters if they exist.
*/
An address is assigned to each formal parameter.
The total size of the formals is returned in *fp;
*/
- struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry;
+ register struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry;
arith f_offset = (arith)0;
#ifdef DEBUG
dumpidftab("start declare_formals", 0);
#endif DEBUG
while (se) {
- struct idf *idf = se->se_idf;
- struct def *def = idf->id_def;
+ register struct def *def = se->se_idf->id_def;
def->df_address = f_offset;
word boundaries, i.e. take care that the following
parameter starts on a new word boundary.
*/
- f_offset = align(f_offset + def->df_type->tp_size,
- word_align);
+ f_offset = align(f_offset + def->df_type->tp_size, word_align);
/* the following is absurd: any char or short formal
must be converted from integer to that type
}
free_formals(fm)
- struct formal *fm;
+ register struct formal *fm;
{
while (fm) {
register struct formal *tmp = fm->next;
char hmask[IDFSIZE];
-init_hmask() {
+init_hmask()
+{
/* A simple congruence random number generator, as
described in Knuth, vol 2.
*/
- int h, rnd = HASH_X;
+ register int h, rnd = HASH_X;
for (h = 0; h < IDFSIZE; h++) {
hmask[h] = rnd;
/* $Header$ */
/* CODE FOR THE INITIALISATION OF GLOBAL VARIABLES */
+#include "nofloat.h"
#include <em.h>
-
#include "debug.h"
#include "nobitfield.h"
-
#include "arith.h"
#include "align.h"
#include "label.h"
struct expr *
IVAL(tpp, ex)
struct type **tpp; /* type of global variable */
- struct expr *ex; /* initialiser expression */
+ register struct expr *ex; /* initialiser expression */
{
register struct type *tp = *tpp;
*/
struct expr *
do_array(ex, tpp)
- struct expr *ex;
+ register struct expr *ex;
struct type **tpp;
{
register struct type *tp = *tpp;
*/
struct expr *
do_struct(ex, tp)
- struct expr *ex;
- struct type *tp;
+ register struct expr *ex;
+ register struct type *tp;
{
- struct sdef *sd = tp->tp_sdef;
+ register struct sdef *sd = tp->tp_sdef;
arith bytes_upto_here = (arith)0;
arith last_offset = (arith)-1;
put_bf(sd->sd_type, (arith)0);
else {
/* fundamental type, not embraced */
- check_ival(ex->OP_LEFT,
- sd->sd_type);
+ check_ival(ex->OP_LEFT, sd->sd_type);
ex = ex->OP_RIGHT;
}
#endif NOBITFIELD
the rest is zeroed.
*/
check_and_pad(ex, tpp)
- struct expr *ex;
+ register struct expr *ex;
struct type **tpp;
{
/* ex is of a fundamental type */
- struct type *tp = *tpp;
+ register struct type *tp = *tpp;
if (tp->tp_fund == ARRAY) {
if (valid_type(tp->tp_up, "array element") == 0)
If the element is an aggregate, pad() is called recursively.
*/
pad(tp)
- struct type *tp;
+ register struct type *tp;
{
switch (tp->tp_fund) {
case ARRAY:
*/
check_ival(ex, tp)
struct expr *ex;
- struct type *tp;
+ register struct type *tp;
{
/* The philosophy here is that ch7cast puts an explicit
conversion node in front of the expression if the types
{
register struct type *tp = *tpp;
register arith length;
- char *s = ex->SG_VALUE;
- arith ntopad;
+ register char *s = ex->SG_VALUE;
+ register arith ntopad;
ASSERT(ex->ex_class == String);
length = ex->SG_LEN;
int
zero_bytes(sd)
- struct sdef *sd;
+ register struct sdef *sd;
{
/* fills the space between a selector of a struct
and the next selector of that struct with zero-bytes.
}
aggregate_type(tp)
- struct type *tp;
+ register struct type *tp;
{
return tp->tp_fund == ARRAY || tp->tp_fund == STRUCT;
}
/* $Header$ */
/* MAIN PROGRAM */
+#include "nofloat.h"
#include <system.h>
#include "nopp.h"
#include "target_sizes.h"
#include "use_tmp.h"
#include "maxincl.h"
#include "inputtype.h"
-
#include "input.h"
#include "level.h"
#include "idf.h"
#endif OWNALLOC
init_hmask();
+
#ifndef NOPP
init_pp(); /* initialise the preprocessor macros */
#endif NOPP
}
init_specials(si)
- struct sp_id *si;
+ register struct sp_id *si;
{
while (si->si_identifier) {
struct idf *idf = str2idf(si->si_identifier);
/* $Header$ */
/* U S E R O P T I O N - H A N D L I N G */
+#include "nofloat.h"
#include "nopp.h"
#include "idfsize.h"
#include "maxincl.h"
align = txt2int(&text);
}
switch (c) {
-
case 's': /* short */
if (size != (arith)0)
short_size = size;
}
break;
}
-
case 'n':
options['n'] = 1; /* use no registers */
break;
-
case 'w':
options['w'] = 1; /* no warnings will be given */
break;
/* the integer pointed to by *tp is read, while increasing
*tp; the resulting value is yielded.
*/
- register int val = 0;
- register int ch;
+ register int val = 0, ch;
while (ch = **tp, ch >= '0' && ch <= '9') {
val = val * 10 + ch - '0';
/* $Header$ */
/* VARIOUS TARGET MACHINE SIZE DESCRIPTORS */
+#include "nofloat.h"
+
extern arith
short_size, word_size, dword_size, int_size, long_size,
#ifndef NOFLOAT
/* $Header$ */
/* S T A C K / U N S T A C K R O U T I N E S */
+#include "nofloat.h"
#include <system.h>
#include <em.h>
#include <em_reg.h>
-
#include "debug.h"
#include "use_tmp.h"
#include "botch_free.h"
-
#include "alloc.h"
#include "Lpars.h"
#include "arith.h"
stack_level() {
/* A new level is added on top of the identifier stack.
*/
- struct stack_level *stl = new_stack_level();
+ register struct stack_level *stl = new_stack_level();
clear((char *)stl, sizeof(struct stack_level));
local_level->sl_next = stl;
stack_idf(idf, stl)
struct idf *idf;
- struct stack_level *stl;
+ register struct stack_level *stl;
{
/* The identifier idf is inserted in the stack on level stl.
*/
*/
add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */
- struct type *stp; /* type of the structure */
- struct type *tp; /* type of the selector */
- struct idf *idf; /* idf of the selector */
+ register struct type *stp; /* type of the structure */
+ struct type *tp; /* type of the selector */
+ register struct idf *idf; /* idf of the selector */
struct sdef ***sdefpp; /* address of hook to selector definition */
arith *szp; /* pointer to struct size upto here */
struct field *fd;
extern arith add_field();
#endif NOBITFIELD
- register struct tag *tg = stp->tp_idf->id_struct; /* or union */
- register struct sdef *sdef = idf->id_sdef;
+ struct tag *tg = stp->tp_idf->id_struct; /* or union */
+ struct sdef *sdef = idf->id_sdef;
register struct sdef *newsdef;
int lvl = tg->tg_level;
/* checks if idf occurs already as a selector in
struct or union *stp.
*/
- struct sdef *sdef = stp->tp_sdef;
+ register struct sdef *sdef = stp->tp_sdef;
while (sdef) {
if (sdef->sd_idf == idf)
}
declare_struct(fund, idf, tpp)
- struct idf *idf;
+ register struct idf *idf;
struct type **tpp;
{
/* A struct, union or enum (depending on fund) with tag (!)
}
apply_struct(fund, idf, tpp)
- struct idf *idf;
+ register struct idf *idf;
struct type **tpp;
{
/* The occurrence of a struct, union or enum (depending on
struct sdef *
idf2sdef(idf, tp)
- struct idf *idf;
+ register struct idf *idf;
struct type *tp;
{
/* The identifier idf is identified as a selector, preferably
If the attempt fails, a selector of type error_type is
created.
*/
- struct sdef **sdefp = &idf->id_sdef, *sdef;
+ register struct sdef **sdefp = &idf->id_sdef, *sdef;
/* Follow chain from idf, to meet tp. */
while ((sdef = *sdefp)) {
int
uniq_selector(idf_sdef)
- struct sdef *idf_sdef;
+ register struct sdef *idf_sdef;
{
/* Returns true if idf_sdef (which is guaranteed to exist)
is unique for this level, i.e there is no other selector
case!
*/
- struct sdef *sdef = idf_sdef->next;
+ register struct sdef *sdef = idf_sdef->next;
while (sdef && sdef->sd_level == idf_sdef->sd_level) {
if ( sdef->sd_type != idf_sdef->sd_type
#ifndef NOBITFIELD
arith
add_field(szp, fd, fdtpp, idf, stp)
- arith *szp; /* size of struct upto here */
- struct field *fd; /* bitfield, containing width */
- struct type **fdtpp; /* type of selector */
- struct idf *idf; /* name of selector */
- struct type *stp; /* current struct descriptor */
+ arith *szp; /* size of struct upto here */
+ register struct field *fd; /* bitfield, containing width */
+ register struct type **fdtpp; /* type of selector */
+ struct idf *idf; /* name of selector */
+ register struct type *stp; /* current struct descriptor */
{
/* The address where this selector is put is returned. If the
selector with specified width does not fit in the word, or
}
switch ((*fdtpp)->tp_fund) {
-
case CHAR:
case SHORT:
case INT:
bits_declared = fd->fd_width;
}
else
- if (fd->fd_width == 0) {
+ if (fd->fd_width == 0)
/* next field should be aligned on the next boundary.
This will take care that no field will fit in the
space allocated upto here.
*/
bits_declared = bits_in_type + 1;
- }
- else { /* the bitfield fits in the current field */
+ else /* the bitfield fits in the current field */
bits_declared += fd->fd_width;
- }
/* Arrived here, the place where the selector is stored in the
struct is computed.
Now we need a mask to use its value in expressions.
*/
-
*fdtpp = construct_type(FIELD, *fdtpp, (arith)0);
(*fdtpp)->tp_field = fd;
*/
fd->fd_mask = (1 << fd->fd_width) - 1;
- if (options['r']) { /* adjust the field at the right */
+ if (options['r']) /* adjust the field at the right */
fd->fd_shift = bits_declared - fd->fd_width;
- }
- else { /* adjust the field at the left */
+ else /* adjust the field at the left */
fd->fd_shift = bits_in_type - bits_declared;
- }
return field_offset;
}
/* $Header$ */
/* S W I T C H - S T A T E M E N T A D M I N I S T R A T I O N */
+#include "nofloat.h"
#include <em.h>
-
#include "debug.h"
#include "botch_free.h"
#include "density.h"
-
#include "Lpars.h"
#include "idf.h"
#include "label.h"
/* $Header$ */
/* T Y P E D E F I N I T I O N M E C H A N I S M */
+#include "nofloat.h"
#include "nobitfield.h"
#include "alloc.h"
#include "Lpars.h"
struct type *
construct_type(fund, tp, count)
- struct type *tp;
+ register struct type *tp;
arith count; /* for fund == ARRAY only */
{
/* fund must be a type constructor: FIELD, FUNCTION, POINTER or
ARRAY. The pointer to the constructed type is returned.
*/
- struct type *dtp;
+ register struct type *dtp;
switch (fund) {
#ifndef NOBITFIELD
struct type *
function_of(tp)
- struct type *tp;
+ register struct type *tp;
{
- struct type *dtp = tp->tp_function;
+ register struct type *dtp = tp->tp_function;
if (!dtp) {
tp->tp_function = dtp = create_type(FUNCTION);
struct type *
pointer_to(tp)
- struct type *tp;
+ register struct type *tp;
{
- struct type *dtp = tp->tp_pointer;
+ register struct type *dtp = tp->tp_pointer;
if (!dtp) {
tp->tp_pointer = dtp = create_type(POINTER);
struct type *
array_of(tp, count)
- struct type *tp;
+ register struct type *tp;
arith count;
{
- struct type *dtp = tp->tp_array;
+ register struct type *dtp = tp->tp_array;
/* look for a type with the right size */
while (dtp && dtp->tp_size != count)
#ifndef NOBITFIELD
struct type *
field_of(tp)
- struct type *tp;
+ register struct type *tp;
{
- struct type *dtp = create_type(FIELD);
+ register struct type *dtp = create_type(FIELD);
dtp->tp_up = tp;
dtp->tp_align = tp->tp_align;
}
idf2type(idf, tpp)
- struct idf *idf;
+ register struct idf *idf;
struct type **tpp;
{
/* Decoding a typedef-ed identifier: if the size is yet
/* $Header$ */
/* TYPE DESCRIPTOR */
-#include "nobitfield.h"
+#include "nofloat.h"
+#include "nobitfield.h"
struct type {
struct type *next; /* used only with ARRAY */