[hackers] [scc] Add debug information and some TODO's || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 27 Aug 2015 18:17:48 +0200 (CEST)

commit f693fc0846b9cd1727a65994793c460bc0387e8f
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Aug 27 16:18:01 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Aug 27 16:18:01 2015 +0200

    Add debug information and some TODO's

diff --git a/cc1/decl.c b/cc1/decl.c
index 62ea6f1..c92d546 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -398,6 +398,8 @@ newtag(void)
                 tp->p.fields = NULL;
                 sym->type = tp;
                 tp->tag = sym;
+ DBG(stderr, "declared tag '%s' with ns = %d\n",
+ (sym->name) ? sym->name : "anonymous", tp->ns);
         }
 
         if ((op = sym->type->op) != tag && op != INT)
_AT_@ -535,6 +537,7 @@ field(struct decl *dcl)
         sym->flags |= ISFIELD;
         if (n == NR_FIELDS)
                 error("too much fields in struct/union");
+ DBG(stderr, "New field '%s' in namespace %d\n", name, structp->ns);
         structp->p.fields = xrealloc(structp->p.fields, ++n * sizeof(*sym));
         structp->p.fields[n-1] = sym;
         structp->n.elem = n;
diff --git a/cc1/types.c b/cc1/types.c
index 2bf3a84..ee1dad0 100644
--- a/cc1/types.c
+++ b/cc1/types.c
_AT_@ -283,6 +283,7 @@ typesize(Type *tp)
                         size = size + align & ~align;
                         size += tp->size;
                 }
+ /* TODO: Add aligment of the first field */
                 return size;
         case UNION:
                 size = 0;
_AT_@ -292,6 +293,7 @@ typesize(Type *tp)
                         if (tp->size > size)
                                 size = tp->size;
                 }
+ /* TODO: Add aligment of the worst field */
                 return size;
         case ENUM:
                 return inttype->size;
_AT_@ -325,6 +327,7 @@ mktype(Type *tp, unsigned op, short nelem, Type *pars[])
         type.p.pars = pars;
         type.n.elem = nelem;
         type.ns = 0;
+ /* TODO: Set aligment for new types */
 
         switch (op) {
         case ARY:
Received on Thu Aug 27 2015 - 18:17:48 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 27 2015 - 18:24:17 CEST