Navigation Menu

Skip to content

Commit

Permalink
cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjs committed Jun 24, 2012
1 parent 86d1027 commit 394809c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/gencode.c
Expand Up @@ -162,7 +162,7 @@ unfreeze_registers(M1_compiler *comp, m1_symboltable *table) {
while (iter != NULL) {
/* if num elems == 1 take the typedecl's type, otherwise it's an array. */
m1_valuetype type = iter->num_elems == 1 ? iter->typedecl->valtype : VAL_INT;
unsigned regno = iter->regno;
int regno = iter->regno;

if (regno != NO_REG_ALLOCATED_YET) {
assert(comp->registers[type][regno] == REG_SYMBOL);
Expand Down
5 changes: 0 additions & 5 deletions src/m1.y
Expand Up @@ -514,11 +514,6 @@ function_init : return_type TK_IDENT
$$ = chunk(comp, $1, $2, 0);
comp->currentchunk = $$;

/* enter name of function declaration in table
XXX is this still needed? Dont think so but leave it for now.
*/
//sym_enter_chunk(comp, &comp->currentchunk->constants, $2);


/* enter name of this function in global symbol table, so
compiler can find it whenever another function calls this one.
Expand Down
5 changes: 2 additions & 3 deletions src/semcheck.c
Expand Up @@ -250,7 +250,7 @@ check_for(M1_compiler *comp, m1_forexpr *i, unsigned line) {
/* break and continue are allowed in for loops. */

if (i->init)
check_expr(comp, i->init);
(void)check_expr(comp, i->init);

if (i->cond) {
m1_type *t = check_expr(comp, i->cond);
Expand Down Expand Up @@ -471,7 +471,6 @@ check_funcall(M1_compiler *comp, m1_funcall *f, unsigned line) {

}
else {
assert(f->funsym->typedecl != NULL);
f->typedecl = f->funsym->typedecl;
}

Expand All @@ -491,7 +490,7 @@ static void
check_exprlist(M1_compiler *comp, m1_expression *expr) {
m1_expression *iter = expr;
while (iter != NULL) {
check_expr(comp, iter);
(void)check_expr(comp, iter);
iter = iter->next;
}
}
Expand Down

0 comments on commit 394809c

Please sign in to comment.