Fix fmt for type; remove dead stuff

This commit is contained in:
Ginger Bill
2017-04-13 19:29:17 +01:00
parent 627ee002e8
commit d8d22e34dd
5 changed files with 24 additions and 36 deletions
+1 -8
View File
@@ -28,7 +28,6 @@ typedef enum BuiltinProcId {
BuiltinProc_new,
BuiltinProc_free,
// BuiltinProc_new_slice,
BuiltinProc_make,
BuiltinProc_reserve,
@@ -64,8 +63,6 @@ typedef enum BuiltinProcId {
BuiltinProc_kmag,
BuiltinProc_conj,
// BuiltinProc_ptr_offset,
// BuiltinProc_ptr_sub,
BuiltinProc_slice_ptr,
BuiltinProc_slice_to_bytes,
@@ -84,7 +81,6 @@ gb_global BuiltinProc builtin_procs[BuiltinProc_Count] = {
{STR_LIT("new"), 1, false, Expr_Expr},
{STR_LIT("free"), 1, false, Expr_Stmt},
// {STR_LIT("new_slice"), 2, true, Expr_Expr},
{STR_LIT("make"), 1, true, Expr_Expr},
{STR_LIT("reserve"), 2, false, Expr_Stmt},
@@ -108,7 +104,6 @@ gb_global BuiltinProc builtin_procs[BuiltinProc_Count] = {
{STR_LIT("panic"), 1, false, Expr_Stmt},
{STR_LIT("copy"), 2, false, Expr_Expr},
// {STR_LIT("append"), 2, false, Expr_Expr},
{STR_LIT("swizzle"), 1, true, Expr_Expr},
@@ -120,8 +115,6 @@ gb_global BuiltinProc builtin_procs[BuiltinProc_Count] = {
{STR_LIT("kmag"), 1, false, Expr_Expr},
{STR_LIT("conj"), 1, false, Expr_Expr},
// {STR_LIT("ptr_offset"), 2, false, Expr_Expr},
// {STR_LIT("ptr_sub"), 2, false, Expr_Expr},
{STR_LIT("slice_ptr"), 2, true, Expr_Expr},
{STR_LIT("slice_to_bytes"), 1, false, Expr_Stmt},
@@ -310,7 +303,7 @@ typedef struct CheckerInfo {
MapScope scopes; // Key: AstNode * | Node -> Scope
MapExprInfo untyped; // Key: AstNode * | Expression -> ExprInfo
MapDeclInfo entities; // Key: Entity *
MapEntity implicits; // Key: AstNode *
MapEntity implicits; // Key: AstNode *
MapEntity foreigns; // Key: String
MapAstFile files; // Key: String (full path)
MapIsize type_info_map; // Key: Type *
+2 -5
View File
@@ -5410,11 +5410,9 @@ void ir_build_range_string(irProcedure *proc, irValue *expr, Type *val_type,
irBlock *done = NULL;
irBlock *body = NULL;
irValue *index = ir_add_local_generated(proc, t_int);
ir_emit_store(proc, index, v_zero);
irValue *offset_ = ir_add_local_generated(proc, t_int);
ir_emit_store(proc, index, v_zero);
ir_emit_store(proc, offset_, v_zero);
loop = ir_new_block(proc, NULL, "for.string.loop");
ir_emit_jump(proc, loop);
@@ -5441,11 +5439,10 @@ void ir_build_range_string(irProcedure *proc, irValue *expr, Type *val_type,
ir_emit_store(proc, offset_, ir_emit_arith(proc, Token_Add, offset, len, t_int));
idx = ir_emit_load(proc, index);
idx = offset;
if (val_type != NULL) {
val = ir_emit_struct_ev(proc, rune_and_len, 0);
}
ir_emit_increment(proc, index);
if (val_) *val_ = val;
if (idx_) *idx_ = idx;
+1 -16
View File
@@ -1724,11 +1724,7 @@ AstNode *parse_operand(AstFile *f, bool lhs) {
AstNode *operand = NULL; // Operand
switch (f->curr_token.kind) {
case Token_Ident:
operand = parse_ident(f);
if (!lhs) {
// TODO(bill): Handle?
}
return operand;
return parse_ident(f);
case Token_context:
return ast_implicit(f, expect_token(f, Token_context));
@@ -1834,17 +1830,6 @@ AstNode *parse_operand(AstFile *f, bool lhs) {
return type;
}
// case Token_if:
// if (!lhs && f->expr_level >= 0) {
// return parse_if_expr(f);
// }
// break;
// case Token_OpenBrace:
// if (!lhs && f->expr_level >= 0) {
// return parse_block_expr(f);
// }
// break;
default: {
AstNode *type = parse_type_or_ident(f);
if (type != NULL) {