authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2019-12-09 21:34:40+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-10 11:09:30-05:00
logf0ee0688f20dd012b4e069324abdba081ff19369
tree1ce5af447206921e64411fbf9b14cbf9127f0dc5
parentc519bb02df4df0938c5ac12e8b4e8f8ab503df63
signature Commit is signed but in an unrecognized format.

Replace typeOf with TypeOf in stage0


6 files changed, 17 insertions(+), 17 deletions(-)

src/all_types.hpp+1-1
......@@ -2393,7 +2393,7 @@ struct ScopeFnDef {
23932393 ZigFn *fn_entry;
23942394};
23952395
2396// This scope is created for a @typeOf.
2396// This scope is created for a @TypeOf.
23972397// All runtime side-effects are elided within it.
23982398// NodeTypeFnCallExpr
23992399struct ScopeTypeOf {
src/analyze.cpp+2-2
......@@ -121,7 +121,7 @@ static ScopeExpr *find_expr_scope(Scope *scope) {
121121}
122122
123123static void update_progress_display(CodeGen *g) {
124 stage2_progress_update_node(g->sub_progress_node,
124 stage2_progress_update_node(g->sub_progress_node,
125125 g->resolve_queue_index + g->fn_defs_index,
126126 g->resolve_queue.length + g->fn_defs.length);
127127}
......@@ -1732,7 +1732,7 @@ Error type_allowed_in_extern(CodeGen *g, ZigType *type_entry, bool *result) {
17321732ZigType *get_auto_err_set_type(CodeGen *g, ZigFn *fn_entry) {
17331733 ZigType *err_set_type = new_type_table_entry(ZigTypeIdErrorSet);
17341734 buf_resize(&err_set_type->name, 0);
1735 buf_appendf(&err_set_type->name, "@typeOf(%s).ReturnType.ErrorSet", buf_ptr(&fn_entry->symbol_name));
1735 buf_appendf(&err_set_type->name, "@TypeOf(%s).ReturnType.ErrorSet", buf_ptr(&fn_entry->symbol_name));
17361736 err_set_type->data.error_set.err_count = 0;
17371737 err_set_type->data.error_set.errors = nullptr;
17381738 err_set_type->data.error_set.infer_fn = fn_entry;
src/codegen.cpp+3-3
......@@ -1647,7 +1647,7 @@ static void gen_assign_raw(CodeGen *g, LLVMValueRef ptr, ZigType *ptr_type,
16471647 ptr_type->data.pointer.vector_index, false);
16481648 LLVMValueRef loaded_vector = gen_load(g, ptr, ptr_type, "");
16491649 LLVMValueRef new_vector = LLVMBuildInsertElement(g->builder, loaded_vector, value,
1650 index_val, "");
1650 index_val, "");
16511651 gen_store(g, new_vector, ptr, ptr_type);
16521652 return;
16531653 }
......@@ -8067,7 +8067,7 @@ static void define_builtin_fns(CodeGen *g) {
80678067 create_builtin_fn(g, BuiltinFnIdTypeInfo, "typeInfo", 1);
80688068 create_builtin_fn(g, BuiltinFnIdType, "Type", 1);
80698069 create_builtin_fn(g, BuiltinFnIdHasField, "hasField", 2);
8070 create_builtin_fn(g, BuiltinFnIdTypeof, "typeOf", 1); // TODO rename to TypeOf
8070 create_builtin_fn(g, BuiltinFnIdTypeof, "TypeOf", 1);
80718071 create_builtin_fn(g, BuiltinFnIdAddWithOverflow, "addWithOverflow", 4);
80728072 create_builtin_fn(g, BuiltinFnIdSubWithOverflow, "subWithOverflow", 4);
80738073 create_builtin_fn(g, BuiltinFnIdMulWithOverflow, "mulWithOverflow", 4);
......@@ -8407,7 +8407,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
84078407 break;
84088408 }
84098409 buf_appendf(contents, "pub const output_mode = OutputMode.%s;\n", out_type);
8410 const char *link_type = g->is_dynamic ? "Dynamic" : "Static";
8410 const char *link_type = g->is_dynamic ? "Dynamic" : "Static";
84118411 buf_appendf(contents, "pub const link_mode = LinkMode.%s;\n", link_type);
84128412 buf_appendf(contents, "pub const is_test = %s;\n", bool_to_str(g->is_test_build));
84138413 buf_appendf(contents, "pub const single_threaded = %s;\n", bool_to_str(g->is_single_threaded));
src/ir.cpp+6-6
......@@ -9267,7 +9267,7 @@ static ZigValue *ir_exec_const_result(CodeGen *codegen, IrExecutable *exec) {
92679267 }
92689268 }
92699269 if (get_scope_typeof(instruction->scope) != nullptr) {
9270 // doesn't count, it's inside a @typeOf()
9270 // doesn't count, it's inside a @TypeOf()
92719271 continue;
92729272 }
92739273 exec_add_error_node(codegen, exec, instruction->source_node,
......@@ -10413,7 +10413,7 @@ static ConstCastOnly types_match_const_cast_only(IrAnalyze *ira, ZigType *wanted
1041310413 return result;
1041410414 }
1041510415
10416 bool ok_cv_qualifiers =
10416 bool ok_cv_qualifiers =
1041710417 (!actual_ptr_type->data.pointer.is_const || wanted_ptr_type->data.pointer.is_const) &&
1041810418 (!actual_ptr_type->data.pointer.is_volatile || wanted_ptr_type->data.pointer.is_volatile);
1041910419 if (!ok_cv_qualifiers) {
......@@ -13779,7 +13779,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
1377913779 (wanted_type->id == ZigTypeIdOptional && wanted_type->data.maybe.child_type->id == ZigTypeIdEnum))
1378013780 {
1378113781 IrInstruction *result = ir_analyze_enum_literal(ira, source_instr, value, wanted_type->data.maybe.child_type);
13782 if (result == ira->codegen->invalid_instruction)
13782 if (result == ira->codegen->invalid_instruction)
1378313783 return result;
1378413784
1378513785 return ir_analyze_optional_wrap(ira, result, value, wanted_type, nullptr);
......@@ -13790,9 +13790,9 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
1379013790 (wanted_type->id == ZigTypeIdErrorUnion && wanted_type->data.error_union.payload_type->id == ZigTypeIdEnum))
1379113791 {
1379213792 IrInstruction *result = ir_analyze_enum_literal(ira, source_instr, value, wanted_type->data.error_union.payload_type);
13793 if (result == ira->codegen->invalid_instruction)
13793 if (result == ira->codegen->invalid_instruction)
1379413794 return result;
13795
13795
1379613796 return ir_analyze_err_wrap_payload(ira, result, value, wanted_type, nullptr);
1379713797 }
1379813798
......@@ -19328,7 +19328,7 @@ static IrInstruction *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstruct
1932819328 {
1932919329 size_t offset = ptr_field->data.x_ptr.data.base_array.elem_index;
1933019330 uint64_t new_index = offset + index;
19331 if (ptr_field->data.x_ptr.data.base_array.array_val->data.x_array.special !=
19331 if (ptr_field->data.x_ptr.data.base_array.array_val->data.x_array.special !=
1933219332 ConstArraySpecialBuf)
1933319333 {
1933419334 ir_assert(new_index <
src/ir_print.cpp+1-1
......@@ -873,7 +873,7 @@ static void ir_print_vector_store_elem(IrPrint *irp, IrInstructionVectorStoreEle
873873}
874874
875875static void ir_print_typeof(IrPrint *irp, IrInstructionTypeOf *instruction) {
876 fprintf(irp->f, "@typeOf(");
876 fprintf(irp->f, "@TypeOf(");
877877 ir_print_other_instruction(irp, instruction->value);
878878 fprintf(irp->f, ")");
879879}
src/translate_c.cpp+4-4
......@@ -4230,7 +4230,7 @@ static AstNode *resolve_typedef_decl(Context *c, const ZigClangTypedefNameDecl *
42304230 emit_warning(c, ZigClangTypedefNameDecl_getLocation(typedef_decl),
42314231 "typedef %s - unresolved child type", buf_ptr(type_name));
42324232 c->decl_table.put(typedef_decl, nullptr);
4233 // TODO add global var with type_name equal to @compileError("unable to resolve C type")
4233 // TODO add global var with type_name equal to @compileError("unable to resolve C type")
42344234 return nullptr;
42354235 }
42364236 add_global_var(c, type_name, type_node);
......@@ -4919,9 +4919,9 @@ static AstNode *parse_ctok_primary_expr(Context *c, CTokenize *ctok, size_t *tok
49194919 *tok_i += 1;
49204920
49214921
4922 //if (@typeId(@typeOf(x)) == @import("builtin").TypeId.Pointer)
4922 //if (@typeId(@TypeOf(x)) == @import("builtin").TypeId.Pointer)
49234923 // @ptrCast(dest, x)
4924 //else if (@typeId(@typeOf(x)) == @import("builtin").TypeId.Integer)
4924 //else if (@typeId(@TypeOf(x)) == @import("builtin").TypeId.Integer)
49254925 // @intToPtr(dest, x)
49264926 //else
49274927 // (dest)(x)
......@@ -4931,7 +4931,7 @@ static AstNode *parse_ctok_primary_expr(Context *c, CTokenize *ctok, size_t *tok
49314931 AstNode *typeid_type = trans_create_node_field_access_str(c, import_builtin, "TypeId");
49324932 AstNode *typeid_pointer = trans_create_node_field_access_str(c, typeid_type, "Pointer");
49334933 AstNode *typeid_integer = trans_create_node_field_access_str(c, typeid_type, "Int");
4934 AstNode *typeof_x = trans_create_node_builtin_fn_call_str(c, "typeOf");
4934 AstNode *typeof_x = trans_create_node_builtin_fn_call_str(c, "TypeOf");
49354935 typeof_x->data.fn_call_expr.params.append(node_to_cast);
49364936 AstNode *typeid_value = trans_create_node_builtin_fn_call_str(c, "typeId");
49374937 typeid_value->data.fn_call_expr.params.append(typeof_x);