Skip to content

Commit

Permalink
Allow `file' as an object class
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed May 6, 2012
1 parent d29cb33 commit 562c193
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/cgen.c
Expand Up @@ -599,6 +599,9 @@ static void cgen_prototype(tree_t t, LLVMTypeRef *args, bool procedure)
args[i] = llvm_type(type);
}
break;

case C_FILE:
assert(false);
}
}
}
Expand Down Expand Up @@ -2694,6 +2697,9 @@ static void cgen_func_body(tree_t t)
case C_CONSTANT:
tree_add_attr_ptr(p, local_var_i, LLVMGetParam(fn, i));
break;

case C_FILE:
assert(false);
}
}

Expand Down Expand Up @@ -2749,6 +2755,9 @@ static void cgen_proc_body(tree_t t)
case C_CONSTANT:
tree_add_attr_ptr(p, local_var_i, LLVMGetParam(fn, i));
break;

case C_FILE:
assert(false);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/dump.c
Expand Up @@ -493,6 +493,7 @@ static void dump_port(tree_t t, int indent)
case C_VARIABLE: class = "variable"; break;
case C_DEFAULT: class = ""; break;
case C_CONSTANT: class = "constant"; break;
case C_FILE: class = "file"; break;
}
switch (tree_port_mode(t)) {
case PORT_IN: dir = "in"; break;
Expand Down
1 change: 1 addition & 0 deletions src/parse.y
Expand Up @@ -685,6 +685,7 @@ object_class
: tSIGNAL { $$ = C_SIGNAL; }
| tVARIABLE { $$ = C_VARIABLE; }
| tCONSTANT { $$ = C_CONSTANT; }
| tFILE { $$ = C_FILE; }
| /* empty */ { $$ = C_DEFAULT; }
;

Expand Down
3 changes: 2 additions & 1 deletion src/tree.h
Expand Up @@ -37,7 +37,8 @@ typedef enum class {
C_DEFAULT,
C_SIGNAL,
C_VARIABLE,
C_CONSTANT
C_CONSTANT,
C_FILE
} class_t;

typedef enum tree_kind {
Expand Down

0 comments on commit 562c193

Please sign in to comment.