Browse Source

Very minor style changes

Ginger Bill 8 years ago
parent
commit
062a2c63e1
3 changed files with 6 additions and 5 deletions
  1. 2 3
      src/checker/expr.c
  2. 2 1
      src/parser.c
  3. 2 1
      src/ssa.c

+ 2 - 3
src/checker/expr.c

@@ -4455,10 +4455,9 @@ void check_expr_or_type(Checker *c, Operand *o, AstNode *e) {
 	check_not_tuple(c, o);
 	check_not_tuple(c, o);
 	if (o->mode == Addressing_NoValue) {
 	if (o->mode == Addressing_NoValue) {
 		gbString str = expr_to_string(o->expr);
 		gbString str = expr_to_string(o->expr);
-		error_node(o->expr,
-		      "`%s` used as value or type", str);
-		o->mode = Addressing_Invalid;
+		error_node(o->expr, "`%s` used as value or type", str);
 		gb_string_free(str);
 		gb_string_free(str);
+		o->mode = Addressing_Invalid;
 	}
 	}
 }
 }
 
 

+ 2 - 1
src/parser.c

@@ -1602,8 +1602,9 @@ AstNode *parse_call_expr(AstFile *f, AstNode *operand) {
 	while (f->curr_token.kind != Token_CloseParen &&
 	while (f->curr_token.kind != Token_CloseParen &&
 	       f->curr_token.kind != Token_EOF &&
 	       f->curr_token.kind != Token_EOF &&
 	       ellipsis.pos.line == 0) {
 	       ellipsis.pos.line == 0) {
-		if (f->curr_token.kind == Token_Comma)
+		if (f->curr_token.kind == Token_Comma) {
 			syntax_error(f->curr_token, "Expected an expression not a ,");
 			syntax_error(f->curr_token, "Expected an expression not a ,");
+		}
 
 
 		if (f->curr_token.kind == Token_Ellipsis) {
 		if (f->curr_token.kind == Token_Ellipsis) {
 			ellipsis = f->curr_token;
 			ellipsis = f->curr_token;

+ 2 - 1
src/ssa.c

@@ -4842,7 +4842,8 @@ String ssa_mangle_name(ssaGen *s, String path, String name) {
 ssaValue *ssa_get_type_info_ptr(ssaProcedure *proc, ssaValue *type_info_data, Type *type) {
 ssaValue *ssa_get_type_info_ptr(ssaProcedure *proc, ssaValue *type_info_data, Type *type) {
 	i32 index = cast(i32)ssa_type_info_index(proc->module->info, type);
 	i32 index = cast(i32)ssa_type_info_index(proc->module->info, type);
 	// gb_printf_err("%d %s\n", index, type_to_string(type));
 	// gb_printf_err("%d %s\n", index, type_to_string(type));
-	return ssa_emit_array_epi(proc, type_info_data, index);
+	ssaValue *ptr = ssa_emit_array_epi(proc, type_info_data, index);
+	return ssa_emit_bitcast(proc, ptr, t_type_info_ptr);
 }
 }
 
 
 ssaValue *ssa_type_info_member_offset(ssaProcedure *proc, ssaValue *data, isize count, i32 *index) {
 ssaValue *ssa_type_info_member_offset(ssaProcedure *proc, ssaValue *data, isize count, i32 *index) {