aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill+github@gingerbill.org>2017-07-24 07:57:09 +0100
committergingerBill <bill+github@gingerbill.org>2017-07-24 07:57:09 +0100
commitf0980c0a98aad1ce4712197e98608e0b1a886a44 (patch)
treead1c82a0b4b4ffa8449ab46a61339e41b0957c43 /src
parent1df4aa90ce10dca629b8af73e74f884ab2339096 (diff)
Fix import name exportation bug; Fix procedure type printing
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp6
-rw-r--r--src/ir_print.cpp18
2 files changed, 12 insertions, 12 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index fcaf943a7..a57ebbd0d 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -4630,10 +4630,10 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
bool implicit_is_found = is_entity_implicitly_imported(e, entity);
bool is_not_exported = !is_entity_exported(entity);
- if (!implicit_is_found) {
- is_not_exported = false;
- } else if (entity->kind == Entity_ImportName) {
+ if (entity->kind == Entity_ImportName) {
is_not_exported = true;
+ } else if (!implicit_is_found) {
+ is_not_exported = false;
}
if (is_not_exported) {
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 23c385140..42a304afc 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -183,10 +183,9 @@ void ir_print_proc_type_without_pointer(irFileBuffer *f, irModule *m, Type *t) {
ir_fprintf(f, " (");
if (t->Proc.return_by_pointer) {
ir_print_type(f, m, reduce_tuple_to_single_type(t->Proc.results));
- ir_fprintf(f, "* sret noalias ");
- if (param_count > 0) {
- ir_fprintf(f, ", ");
- }
+ // ir_fprintf(f, "* sret noalias ");
+ ir_fprintf(f, "* noalias ");
+ if (param_count > 0) ir_fprintf(f, ", ");
}
isize param_index = 0;
for (isize i = 0; i < param_count; i++) {
@@ -333,12 +332,16 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t) {
case Type_Named:
- if (is_type_struct(t) || is_type_union(t)) {
+ switch (base_type(t)->kind) {
+ case Type_Struct:
+ case Type_Union: {
String *name = map_get(&m->entity_names, hash_pointer(t->Named.type_name));
GB_ASSERT_MSG(name != nullptr, "%.*s %p", LIT(t->Named.name), t->Named.type_name);
ir_print_encoded_local(f, *name);
- } else {
+ } break;
+ default:
ir_print_type(f, m, base_type(t));
+ break;
}
return;
case Type_Tuple:
@@ -1718,9 +1721,6 @@ void ir_print_proc(irFileBuffer *f, irModule *m, irProcedure *proc) {
void ir_print_type_name(irFileBuffer *f, irModule *m, irValue *v) {
GB_ASSERT(v->kind == irValue_TypeName);
Type *bt = base_type(ir_type(v));
- if (!is_type_struct(bt) && !is_type_union(bt)) {
- return;
- }
ir_print_encoded_local(f, v->TypeName.name);
ir_fprintf(f, " = type ");
ir_print_type(f, m, base_type(v->TypeName.type));