Skip to content
Browse files

Allow `file' as an object class

  • Loading branch information...
1 parent d29cb33 commit 562c193b0e6b6c221cb57bc81574b08e29954eff @nickg committed May 6, 2012
Showing with 13 additions and 1 deletion.
  1. +9 −0 src/cgen.c
  2. +1 −0 src/dump.c
  3. +1 −0 src/parse.y
  4. +2 −1 src/tree.h
View
9 src/cgen.c
@@ -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);
}
}
}
@@ -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);
}
}
@@ -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);
}
}
View
1 src/dump.c
@@ -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;
View
1 src/parse.y
@@ -685,6 +685,7 @@ object_class
: tSIGNAL { $$ = C_SIGNAL; }
| tVARIABLE { $$ = C_VARIABLE; }
| tCONSTANT { $$ = C_CONSTANT; }
+| tFILE { $$ = C_FILE; }
| /* empty */ { $$ = C_DEFAULT; }
;
View
3 src/tree.h
@@ -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 {

0 comments on commit 562c193

Please sign in to comment.
Something went wrong with that request. Please try again.