aboutsummaryrefslogtreecommitdiff
path: root/src/checker/type.cpp
diff options
context:
space:
mode:
authorgingerBill <ginger.bill.22@gmail.com>2016-08-17 18:36:37 +0100
committergingerBill <ginger.bill.22@gmail.com>2016-08-17 18:36:37 +0100
commit6f9d11b3810190d606a4be89426e203226e648a5 (patch)
treef9de1d468448c2e473f5ecc23cfc847ed21a8457 /src/checker/type.cpp
parentc4fe2ace0595ae51f620aaada1807295e41cd6b5 (diff)
Remove scalar*vector; swizzle; broadcast
Diffstat (limited to 'src/checker/type.cpp')
-rw-r--r--src/checker/type.cpp38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/checker/type.cpp b/src/checker/type.cpp
index 0931774e5..650143ef5 100644
--- a/src/checker/type.cpp
+++ b/src/checker/type.cpp
@@ -64,7 +64,6 @@ struct BasicType {
TYPE_KIND(Structure), \
TYPE_KIND(Pointer), \
TYPE_KIND(Named), \
- TYPE_KIND(Alias), \
TYPE_KIND(Tuple), \
TYPE_KIND(Proc), \
TYPE_KIND(Count),
@@ -111,11 +110,6 @@ struct Type {
Entity *type_name; // Entity_TypeName
} named;
struct {
- String name;
- Type * base;
- Entity *alias_name; // Entity_AliasName
- } alias;
- struct {
Entity **variables; // Entity_Variable
isize variable_count;
} tuple;
@@ -130,12 +124,8 @@ struct Type {
};
Type *get_base_type(Type *t) {
- while (t->kind == Type_Named || t->kind == Type_Alias) {
- if (t->kind == Type_Named) {
- t = t->named.base;
- } else {
- t = t->alias.base;
- }
+ while (t->kind == Type_Named) {
+ t = t->named.base;
}
return t;
}
@@ -143,8 +133,6 @@ Type *get_base_type(Type *t) {
void set_base_type(Type *t, Type *base) {
if (t && t->kind == Type_Named) {
t->named.base = base;
- } else if (t && t->kind == Type_Alias) {
- t->alias.base = base;
}
}
@@ -201,14 +189,6 @@ Type *make_type_named(gbAllocator a, String name, Type *base, Entity *type_name)
return t;
}
-Type *make_type_alias(gbAllocator a, String name, Type *base, Entity *alias_name) {
- Type *t = alloc_type(a, Type_Alias);
- t->alias.name = name;
- t->alias.base = base;
- t->alias.alias_name = alias_name;
- return t;
-}
-
Type *make_type_tuple(gbAllocator a) {
Type *t = alloc_type(a, Type_Tuple);
return t;
@@ -465,16 +445,11 @@ b32 are_types_identical(Type *x, Type *y) {
return are_types_identical(x->pointer.elem, y->pointer.elem);
break;
-
- case Type_Alias:
- return are_types_identical(get_base_type(x), y);
-
case Type_Named:
if (y->kind == Type_Named)
return x->named.base == y->named.base;
break;
-
case Type_Tuple:
if (y->kind == Type_Tuple) {
if (x->tuple.variable_count == y->tuple.variable_count) {
@@ -737,15 +712,6 @@ gbString write_type_to_string(gbString str, Type *type) {
}
break;
- case Type_Alias:
- if (type->alias.alias_name != NULL) {
- str = gb_string_append_length(str, type->alias.name.text, type->alias.name.len);
- } else {
- // NOTE(bill): Just in case
- str = gb_string_appendc(str, "<alias type>");
- }
- break;
-
case Type_Tuple:
if (type->tuple.variable_count > 0) {
for (isize i = 0; i < type->tuple.variable_count; i++) {