print_(f32|f64)

This commit is contained in:
Ginger Bill
2016-08-18 15:58:36 +01:00
parent 6b2cd1b33f
commit f931b089d5
12 changed files with 714 additions and 813 deletions
+8 -16
View File
@@ -7,7 +7,6 @@ enum BuiltinProcId;
ENTITY_KIND(Constant), \
ENTITY_KIND(Variable), \
ENTITY_KIND(TypeName), \
ENTITY_KIND(AliasName), \
ENTITY_KIND(Procedure), \
ENTITY_KIND(Builtin), \
ENTITY_KIND(Count),
@@ -38,16 +37,14 @@ struct Entity {
isize order;
union {
struct { ExactValue value; } constant;
struct { ExactValue value; } Constant;
struct {
b8 visited;
b8 is_field;
b8 used;
} variable;
struct {} type_name;
struct {} alias_name;
struct {} procedure;
struct { BuiltinProcId id; } builtin;
} Variable;
struct { b8 used; } Procedure;
struct { BuiltinProcId id; } Builtin;
};
};
@@ -74,7 +71,7 @@ Entity *make_entity_variable(gbAllocator a, Scope *parent, Token token, Type *ty
Entity *make_entity_constant(gbAllocator a, Scope *parent, Token token, Type *type, ExactValue value) {
Entity *entity = alloc_entity(a, Entity_Constant, parent, token, type);
entity->constant.value = value;
entity->Constant.value = value;
return entity;
}
@@ -83,20 +80,15 @@ Entity *make_entity_type_name(gbAllocator a, Scope *parent, Token token, Type *t
return entity;
}
Entity *make_entity_alias_name(gbAllocator a, Scope *parent, Token token, Type *type) {
Entity *entity = alloc_entity(a, Entity_AliasName, parent, token, type);
return entity;
}
Entity *make_entity_param(gbAllocator a, Scope *parent, Token token, Type *type) {
Entity *entity = make_entity_variable(a, parent, token, type);
entity->variable.used = true;
entity->Variable.used = true;
return entity;
}
Entity *make_entity_field(gbAllocator a, Scope *parent, Token token, Type *type) {
Entity *entity = make_entity_variable(a, parent, token, type);
entity->variable.is_field = true;
entity->Variable.is_field = true;
return entity;
}
@@ -107,7 +99,7 @@ Entity *make_entity_procedure(gbAllocator a, Scope *parent, Token token, Type *s
Entity *make_entity_builtin(gbAllocator a, Scope *parent, Token token, Type *type, BuiltinProcId id) {
Entity *entity = alloc_entity(a, Entity_Builtin, parent, token, type);
entity->builtin.id = id;
entity->Builtin.id = id;
return entity;
}