@@ -43,11 +43,13 @@ static std::vector<LocalVarData> define_builtin_parameters(const std::vector<Typ
4343static void define_builtin_func (const std::string& name, const std::vector<TypePtr>& params_types, TypePtr return_type, const GenericsDeclaration* genericTs, const std::function<FunctionBodyBuiltinAsmOp::CompileToAsmOpImpl>& func, int flags) {
4444 auto * f_sym = new FunctionData (name, {}, " " , nullptr , return_type, define_builtin_parameters (params_types, flags), flags, FunctionInlineMode::notCalculated, genericTs, nullptr , new FunctionBodyBuiltinAsmOp (func), nullptr );
4545 G.symtable .add_function (f_sym);
46+ G.all_builtins .push_back (f_sym);
4647}
4748
4849static void define_builtin_func (const std::string& name, const std::vector<TypePtr>& params_types, TypePtr return_type, const GenericsDeclaration* genericTs, const std::function<FunctionBodyBuiltinGenerateOps::GenerateOpsImpl>& func, int flags) {
4950 auto * f_sym = new FunctionData (name, {}, " " , nullptr , return_type, define_builtin_parameters (params_types, flags), flags, FunctionInlineMode::notCalculated, genericTs, nullptr , new FunctionBodyBuiltinGenerateOps (func), nullptr );
5051 G.symtable .add_function (f_sym);
52+ G.all_builtins .push_back (f_sym);
5153}
5254
5355static void define_builtin_method (const std::string& name, TypePtr receiver_type, const std::vector<TypePtr>& params_types, TypePtr return_type, const GenericsDeclaration* genericTs, const std::function<FunctionBodyBuiltinAsmOp::CompileToAsmOpImpl>& func, int flags,
@@ -57,13 +59,15 @@ static void define_builtin_method(const std::string& name, TypePtr receiver_type
5759 f_sym->arg_order = arg_order;
5860 f_sym->ret_order = ret_order;
5961 G.symtable .add_function (f_sym);
62+ G.all_builtins .push_back (f_sym);
6063 G.all_methods .push_back (f_sym);
6164}
6265
6366void define_builtin_method (const std::string& name, TypePtr receiver_type, const std::vector<TypePtr>& params_types, TypePtr return_type, const GenericsDeclaration* genericTs, const std::function<FunctionBodyBuiltinGenerateOps::GenerateOpsImpl>& func, int flags) {
6467 std::string method_name = name.substr (name.find (' .' ) + 1 );
6568 auto * f_sym = new FunctionData (name, {}, std::move (method_name), receiver_type, return_type, define_builtin_parameters (params_types, flags), flags, FunctionInlineMode::notCalculated, genericTs, nullptr , new FunctionBodyBuiltinGenerateOps (func), nullptr );
6669 G.symtable .add_function (f_sym);
70+ G.all_builtins .push_back (f_sym);
6771 G.all_methods .push_back (f_sym);
6872}
6973
@@ -1500,7 +1504,7 @@ void define_builtins() {
15001504 define_builtin_func (" __throw" , ParamsInt1, Never, nullptr ,
15011505 compile_throw,
15021506 0 );
1503- define_builtin_func (" __throw_arg" , {typeT , Int}, Never, declGenericT ,
1507+ define_builtin_func (" __throw_arg" , {TypeDataUnknown::create () , Int}, Never, nullptr ,
15041508 compile_throw_arg,
15051509 0 );
15061510 define_builtin_func (" __throw_if_unless" , ParamsInt3, Unit, nullptr ,
0 commit comments