aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyze.c')
-rw-r--r--src/analyze.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/analyze.c b/src/analyze.c
index 04b7856..c05542a 100644
--- a/src/analyze.c
+++ b/src/analyze.c
@@ -447,16 +447,9 @@ static int analyze_str(struct state *state, struct scope *scope,
(void)scope;
/** @todo do this properly, very hacky, bad bad bad */
- char *i = strdup("char");
- if (!i) {
- internal_error("failed allocating constant char type string");
- return -1;
- }
-
- struct type *ch = tgen_id(i, node->loc);
+ struct type *ch = tgen_type(TYPE_U8, NULL, NULL, node->loc);
if (!ch) {
internal_error("failed allocating constant char type");
- free(i);
return -1;
}
@@ -1117,13 +1110,15 @@ static struct type *fwd_type_kind(fwd_type_t type)
{
switch (type) {
case FWD_VOID: return tgen_void(NULL_LOC());
+ case FWD_I8: return tgen_type(TYPE_I8, NULL, NULL, NULL_LOC());
+ case FWD_I16: return tgen_type(TYPE_I16, NULL, NULL, NULL_LOC());
+ case FWD_I32: return tgen_type(TYPE_I32, NULL, NULL, NULL_LOC());
case FWD_I64: return tgen_type(TYPE_I64, NULL, NULL, NULL_LOC());
+ case FWD_U8: return tgen_type(TYPE_U8, NULL, NULL, NULL_LOC());
+ case FWD_U16: return tgen_type(TYPE_U16, NULL, NULL, NULL_LOC());
+ case FWD_U32: return tgen_type(TYPE_U32, NULL, NULL, NULL_LOC());
case FWD_U64: return tgen_type(TYPE_U64, NULL, NULL, NULL_LOC());
- case FWD_PTR: {
- /* hack? */
- return tgen_nil(NULL_LOC());
- }
-
+ case FWD_PTR: return tgen_nil(NULL_LOC());
default:
break;
}