From 6c48b8d583b66061099f88c4e7b40815c09e6d42 Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Thu, 4 Dec 2025 18:03:51 +0100 Subject: [PATCH 1/8] chore: update to LLVM 15 --- .cargo/config.toml | 6 + .vscode/launch.json | 52 +- Cargo.lock | 17 +- Cargo.toml | 3 +- Makefile | 32 + ...al_files__external_file_function_call.snap | 9 +- ...ernal_files__external_file_global_var.snap | 13 +- ...n_different_locations_with_debug_info.snap | 48 +- ...files__multiple_files_with_debug_info.snap | 48 +- ...iles__multiple_source_files_generated.snap | 39 +- src/builtins.rs | 25 +- src/codegen.rs | 2 +- src/codegen/generators/data_type_generator.rs | 76 +- .../generators/expression_generator.rs | 589 ++-- src/codegen/generators/llvm.rs | 46 +- src/codegen/generators/pou_generator.rs | 106 +- src/codegen/generators/statement_generator.rs | 15 +- src/codegen/llvm_index.rs | 18 +- src/codegen/llvm_typesystem.rs | 16 +- src/codegen/tests.rs | 1 - src/codegen/tests/address_tests.rs | 32 +- src/codegen/tests/code_gen_tests.rs | 230 +- src/codegen/tests/debug_tests.rs | 769 +++-- ...ate_return_value_variable_in_function.snap | 22 +- ...rray_size_correctly_set_in_dwarf_info.snap | 22 +- ...g__assignment_statement_have_location.snap | 13 +- ...ging__case_conditions_location_marked.snap | 21 +- ...bugging__exit_statement_have_location.snap | 13 +- ...l_is_not_added_as_external_subroutine.snap | 4 +- ...gging__for_conditions_location_marked.snap | 23 +- ...bugging__function_calls_have_location.snap | 11 +- ...on_calls_in_expressions_have_location.snap | 11 +- ...ugging__if_conditions_location_marked.snap | 19 +- ...g__implementation_added_as_subroutine.snap | 22 +- ...g__nested_function_calls_get_location.snap | 15 +- ...callable_expressions_have_no_location.snap | 13 +- ...on_function_pous_have_struct_as_param.snap | 28 +- ...ng__repeat_conditions_location_marked.snap | 17 +- ...gging__return_statement_have_location.snap | 13 +- ...temp_variables_in_pous_added_as_local.snap | 58 +- ...out_inout_in_function_added_as_params.snap | 24 +- ...ing__while_conditions_location_marked.snap | 17 +- src/codegen/tests/directaccess_test.rs | 239 +- src/codegen/tests/expression_tests.rs | 262 +- src/codegen/tests/fnptr.rs | 273 +- .../complex_initializers.rs | 2405 ++++++++------- .../global_initializers.rs | 4 +- .../initialization_test/pou_initializers.rs | 6 +- ...initializer_gets_declared_initializer.snap | 21 +- ..._initializer_gets_default_initializer.snap | 32 +- ...lues_in_global_variables_out_of_order.snap | 12 +- ..._class_struct_initialized_in_function.snap | 29 +- ...ues_for_not_initialized_function_vars.snap | 22 +- ...global_variables_in_inline_assignment.snap | 13 +- ..._block_struct_initialized_in_function.snap | 31 +- ..._function_return_value_is_initialized.snap | 23 +- ..._is_initialized_with_type_initializer.snap | 39 +- ...alue_with_initializers_is_initialized.snap | 23 +- ...e_without_initializers_is_initialized.snap | 23 +- ...tial_constant_values_in_pou_variables.snap | 7 +- ..._initial_values_in_function_block_pou.snap | 22 +- ...lizers__initial_values_in_program_pou.snap | 15 +- ...lizers__initialized_array_in_function.snap | 14 +- ...s__initialized_array_type_in_function.snap | 14 +- ...for_struct_initialization_in_function.snap | 14 +- ..._for_struct_initialization_in_program.snap | 5 +- ...nt_functions_are_referenced_correctly.snap | 13 +- ...imilar_names_are_referenced_correctly.snap | 25 +- ...izers__array_of_struct_initialization.snap | 7 +- ...th_inline_initializer_are_initialized.snap | 13 +- ...lizers__initial_values_in_fb_variable.snap | 18 +- ...array_of_structs_are_zero_initialized.snap | 5 +- src/codegen/tests/online_change_tests.rs | 145 - src/codegen/tests/oop_tests.rs | 2296 +++++++------- src/codegen/tests/oop_tests/debug_tests.rs | 1597 +++++----- src/codegen/tests/oop_tests/super_tests.rs | 2701 ++++++++--------- src/codegen/tests/parameters_tests.rs | 788 +++-- src/codegen/tests/polymorphism.rs | 814 +++-- ...enerates_in_separate_global_variables.snap | 3 +- ...sts__accessing_nested_array_in_struct.snap | 11 +- ...e_gen_tests__accessing_nested_structs.snap | 17 +- ...e_gen_tests__action_called_in_program.snap | 13 +- ...sts__array_of_cast_int_type_generated.snap | 5 +- ..._int_non_zero_negative_type_generated.snap | 5 +- ..._array_of_int_non_zero_type_generated.snap | 5 +- ...en_tests__array_of_int_type_generated.snap | 5 +- ...ode_gen_tests__array_of_int_type_used.snap | 17 +- ...ype_with_non_zero_negative_start_used.snap | 17 +- ..._of_int_type_with_non_zero_start_used.snap | 17 +- ...d_variable_declaration_is_initialized.snap | 5 +- ...mber_of_another_struct_is_initialized.snap | 5 +- ...onstant_expressions_in_case_selectors.snap | 29 +- ...th_enum_expressions_in_case_selectors.snap | 29 +- ...__case_with_multiple_labels_statement.snap | 15 +- ...gen_tests__case_with_ranges_statement.snap | 15 +- ...s__casted_literals_bool_code_gen_test.snap | 13 +- ..._tests__casted_literals_code_gen_test.snap | 11 +- ...ts__casted_literals_hex_code_gen_test.snap | 11 +- ...asted_literals_hex_ints_code_gen_test.snap | 9 +- ...__casted_literals_lreal_code_gen_test.snap | 11 +- ...s__casted_literals_real_code_gen_test.snap | 11 +- ...ests__class_member_access_from_method.snap | 28 +- ...__code_gen_tests__class_method_in_pou.snap | 48 +- ...sts__code_gen_tests__complex_pointers.snap | 63 +- ...ion_in_function_blocks_are_propagated.snap | 12 +- ...anged_type_declaration_are_propagated.snap | 21 +- ...gation_of_struct_fields_on_assignment.snap | 11 +- ..._contants_in_case_statements_resolved.snap | 23 +- ..._date_and_time_addition_in_var_output.snap | 27 +- ..._and_time_global_constants_initialize.snap | 67 +- ...sts__code_gen_tests__date_comparisons.snap | 19 +- ...ues_for_not_initialized_function_vars.snap | 22 +- ..._gen_tests__different_case_references.snap | 9 +- ...tion_with_name_generates_int_function.snap | 5 +- ...lobal_variable_list_generates_nothing.snap | 3 +- ...ram_with_name_generates_void_function.snap | 3 +- ...pty_statements_dont_generate_anything.snap | 11 +- ...num_members_can_be_used_in_asignments.snap | 11 +- ...ests__enums_custom_type_are_generated.snap | 5 +- ...__external_function_called_in_program.snap | 3 +- ...global_variable_generates_as_external.snap | 3 +- ...ternal_program_global_var_is_external.snap | 3 +- ...n_tests__fb_method_called_as_function.snap | 48 +- ...sts__code_gen_tests__fb_method_in_pou.snap | 56 +- ..._gen_tests__fb_method_with_var_in_out.snap | 38 +- ...ts__fb_method_with_var_input_defaults.snap | 32 +- ...ode_gen_tests__for_statement_continue.snap | 17 +- ...ts__code_gen_tests__for_statement_int.snap | 17 +- ...s__code_gen_tests__for_statement_lint.snap | 17 +- ...s__code_gen_tests__for_statement_sint.snap | 17 +- ...en_tests__for_statement_with_continue.snap | 23 +- ...de_gen_tests__for_statement_with_exit.snap | 23 +- ..._statement_with_references_steps_test.snap | 33 +- ..._tests__for_statement_with_steps_test.snap | 17 +- ...sts__for_statement_without_steps_test.snap | 17 +- ...n_tests__function_block_instance_call.snap | 16 +- ...unction_block_qualified_instance_call.snap | 22 +- ...on_call_with_same_name_as_return_type.snap | 7 +- ...gen_tests__function_called_in_program.snap | 13 +- ..._tests__function_called_when_shadowed.snap | 13 +- ...on_with_local_temp_var_initialization.snap | 19 +- ...ith_local_var_initialization_and_call.snap | 17 +- ...ion_with_parameters_called_in_program.snap | 15 +- ...with_two_parameters_called_in_program.snap | 17 +- ...lobal_variable_reference_is_generated.snap | 11 +- ...n_tests__if_elsif_else_generator_test.snap | 31 +- ...ts__code_gen_tests__if_generator_test.snap | 11 +- ...ts__if_with_expression_generator_test.snap | 13 +- ...rray_size_from_local_scoped_constants.snap | 11 +- ...code_gen_tests__method_codegen_return.snap | 12 +- ...__code_gen_tests__method_codegen_void.snap | 10 +- ...method_codegen_with_initialized_input.snap | 26 +- ...s__method_codegen_with_multiple_input.snap | 30 +- ...ts__method_with_aggregate_return_type.snap | 55 +- ...s__code_gen_tests__methods_var_output.snap | 49 +- ...do_not_result_in_an_under_or_overflow.snap | 11 +- ...code_gen_tests__multidim_array_access.snap | 17 +- ...gen_tests__multidim_array_declaration.snap | 5 +- ...__code_gen_tests__nested_array_access.snap | 23 +- ...e_gen_tests__nested_array_cube_writes.snap | 27 +- ...sted_array_cube_writes_negative_start.snap | 27 +- ...e_gen_tests__nested_array_declaration.snap | 5 +- ...ts__nested_function_called_in_program.snap | 21 +- ...n_tests__order_var_and_var_temp_block.snap | 7 +- ...__code_gen_tests__pass_inout_to_inout.snap | 35 +- ...s__pointer_and_array_access_to_in_out.snap | 33 +- ...s__code_gen_tests__pointers_generated.snap | 43 +- ..._gen_tests__program_called_in_program.snap | 7 +- ...gen_tests__program_with_and_statement.snap | 11 +- ...tes_void_function_and_struct_and_body.snap | 11 +- ...tes_void_function_and_struct_and_body.snap | 9 +- ..._program_with_casted_chars_assignment.snap | 11 +- ...s__code_gen_tests__program_with_chars.snap | 19 +- ...n_tests__program_with_date_assignment.snap | 35 +- ..._assignment_whit_short_datatype_names.snap | 29 +- ...arison_assignment_generates_correctly.snap | 31 +- ...am_with_local_temp_var_initialization.snap | 17 +- ...ts__program_with_long_date_assignment.snap | 27 +- ...tes_void_function_and_struct_and_body.snap | 15 +- ...tes_void_function_and_struct_and_body.snap | 13 +- ..._gen_tests__program_with_or_statement.snap | 11 +- ...en_tests__program_with_real_additions.snap | 19 +- ...n_tests__program_with_real_assignment.snap | 11 +- ...ts__program_with_real_cast_assignment.snap | 11 +- ...gram_with_signed_combined_expressions.snap | 13 +- ..._program_with_special_chars_in_string.snap | 29 +- ...tests__program_with_string_assignment.snap | 19 +- ...n_tests__program_with_time_assignment.snap | 23 +- ...__program_with_time_of_day_assignment.snap | 21 +- ...explicit_parameters_called_in_program.snap | 15 +- ...with_two_parameters_called_in_program.snap | 15 +- ...gram_with_var_inout_called_in_program.snap | 25 +- ...rogram_with_var_out_called_in_program.snap | 19 +- ..._with_var_out_called_mixed_in_program.snap | 19 +- ...tes_void_function_and_struct_and_body.snap | 7 +- ...tes_void_function_and_struct_and_body.snap | 27 +- ...tes_void_function_and_struct_and_body.snap | 31 +- ...tes_void_function_and_struct_and_body.snap | 7 +- ...tes_void_function_and_struct_and_body.snap | 11 +- ...tes_void_function_and_struct_and_body.snap | 11 +- ...es_generates_void_function_and_struct.snap | 7 +- ...gen_tests__program_with_xor_statement.snap | 15 +- ...fied_action_from_fb_called_in_program.snap | 24 +- ...fied_foreign_action_called_in_program.snap | 15 +- ...lified_local_action_called_in_program.snap | 13 +- ...ests__real_function_called_in_program.snap | 13 +- ...e_gen_tests__reference_qualified_name.snap | 32 +- ...nce_assignments_in_function_arguments.snap | 23 +- ...sts__code_gen_tests__repeat_statement.snap | 9 +- ...en_tests__returning_early_in_function.snap | 11 +- ...ts__returning_early_in_function_block.snap | 10 +- ...e_gen_tests__simple_case_i8_statement.snap | 17 +- ...code_gen_tests__simple_case_statement.snap | 17 +- ...binary_expression_with_different_size.snap | 19 +- ...ts__structs_members_can_be_referenced.snap | 9 +- ..._gen_tests__sub_range_check_functions.snap | 90 +- ...nge_type_calls_check_function_missing.snap | 21 +- ...ype_calls_check_function_on_assigment.snap | 21 +- ...ariables_have_nano_seconds_resolution.snap | 13 +- ...enerates_in_separate_global_variables.snap | 3 +- ..._tests__typed_enums_are_used_properly.snap | 15 +- ...ng_cast_statement_as_const_expression.snap | 5 +- ..._using_const_expression_in_range_type.snap | 23 +- ...s__using_global_consts_in_expressions.snap | 7 +- ..._variable_with_same_name_as_data_type.snap | 11 +- ...de_gen_tests__while_loop_with_if_exit.snap | 13 +- ...ests__code_gen_tests__while_statement.snap | 9 +- ...ests__while_with_expression_statement.snap | 9 +- ...s__aliased_number_type_comparing_test.snap | 17 +- ...sed_ranged_number_type_comparing_test.snap | 17 +- ...uctions_tests__compare_datetime_types.snap | 23 +- ...uction_functions_with_different_types.snap | 95 +- ...are_instructions_with_different_types.snap | 91 +- ...s_tests__pointer_compare_instructions.snap | 71 +- ...er_function_call_compare_instructions.snap | 53 +- ...ts__ranged_number_type_comparing_test.snap | 17 +- ...uctions_tests__string_comparison_test.snap | 51 +- ...ests__string_equal_with_constant_test.snap | 51 +- ...g_greater_or_equal_with_constant_test.snap | 81 +- ...ts__string_greater_with_constant_test.snap | 43 +- ...tests__string_less_with_constant_test.snap | 43 +- ...__string_not_equal_with_constant_test.snap | 49 +- ...g_smaller_or_equal_with_constant_test.snap | 81 +- ...tests__assigning_const_array_variable.snap | 14 +- ...ests__assigning_const_string_variable.snap | 14 +- ...ests__assigning_const_struct_variable.snap | 14 +- ...var_nested_struct_added_to_debug_info.snap | 42 +- ...lobal_var_pointer_added_to_debug_info.snap | 4 +- ...global_var_struct_added_to_debug_info.snap | 18 +- ...rectaccess_test__bitaccess_assignment.snap | 23 +- ...ectaccess_test__byteaccess_assignment.snap | 11 +- ...ctaccess_test__chained_bit_assignment.snap | 11 +- ...ctaccess_test__dwordaccess_assignment.snap | 11 +- ...ctaccess_test__lwordaccess_assignment.snap | 11 +- ..._test__qualified_reference_assignment.snap | 30 +- ...ectaccess_test__wordaccess_assignment.snap | 11 +- ...n_tests__access_string_via_byte_array.snap | 17 +- ...ssion_tests__allowed_assignable_types.snap | 43 +- ...__expression_tests__builtin_add_float.snap | 21 +- ...s__expression_tests__builtin_add_ints.snap | 25 +- ...__expression_tests__builtin_add_mixed.snap | 21 +- ...__expression_tests__builtin_div_float.snap | 13 +- ...s__expression_tests__builtin_div_ints.snap | 13 +- ...__expression_tests__builtin_div_mixed.snap | 13 +- ...sion_tests__builtin_function_call_mux.snap | 33 +- ...function_call_mux_with_aggregate_type.snap | 41 +- ...iltin_function_call_sel_as_expression.snap | 15 +- ...uiltin_function_call_upper_bound_expr.snap | 58 +- ...__expression_tests__builtin_mul_float.snap | 21 +- ...s__expression_tests__builtin_mul_ints.snap | 25 +- ...__expression_tests__builtin_mul_mixed.snap | 21 +- ...__expression_tests__builtin_sub_float.snap | 13 +- ...s__expression_tests__builtin_sub_ints.snap | 13 +- ...__expression_tests__builtin_sub_mixed.snap | 13 +- ...s__calling_strings_in_function_return.snap | 37 +- ...ion_tests__cast_between_pointer_types.snap | 12 +- ...pression_tests__cast_lword_to_pointer.snap | 17 +- ...pression_tests__cast_pointer_to_lword.snap | 17 +- ...ion_tests__compare_date_time_literals.snap | 35 +- ...gen__tests__expression_tests__max_int.snap | 40 +- ...ression_tests__nested_call_statements.snap | 9 +- ...expression_tests__pointer_arithmetics.snap | 89 +- ...ts__pointer_arithmetics_function_call.snap | 21 +- ...on_tests__pointers_in_function_return.snap | 11 +- ...ion_tests__strings_in_function_return.snap | 26 +- ...ion_tests__structs_in_function_return.snap | 11 +- ...s__expression_tests__type_mix_in_call.snap | 11 +- ..._tests__unary_expressions_can_be_real.snap | 13 +- ...necessary_casts_between_pointer_types.snap | 19 +- ...ests__argument_fed_by_ref_then_by_val.snap | 48 +- ...t_argument_literals_for_function_call.snap | 49 +- ...argument_references_for_function_call.snap | 123 +- ...ests__function_call_with_array_access.snap | 31 +- ...ized_string_varargs_called_in_program.snap | 26 +- ..._with_sized_varargs_called_in_program.snap | 26 +- ...nction_with_varargs_called_in_program.snap | 9 +- ...literal_string_argument_passed_by_ref.snap | 29 +- ...ction_tests__member_variables_in_body.snap | 37 +- ..._output_should_be_passed_as_a_pointer.snap | 17 +- ...tests__passing_a_string_to_a_function.snap | 33 +- ...g_a_string_to_a_function_as_reference.snap | 20 +- ...arguments_to_functions_by_ref_and_val.snap | 43 +- ...tests__return_variable_in_nested_call.snap | 19 +- ...n__tests__function_tests__simple_call.snap | 15 +- ...on_tests__var_output_in_function_call.snap | 23 +- ...t__any_real_function_called_with_ints.snap | 49 +- ...eneric_call_gets_cast_to_biggest_type.snap | 28 +- ...generic_codegen_with_aggregate_return.snap | 44 +- ...unction_call_generates_real_type_call.snap | 19 +- ...eneric_function_with_aggregate_return.snap | 17 +- ...nerics_test__generic_output_parameter.snap | 27 +- ...pe_defined_in_external_file_in_module.snap | 8 +- ...ed_in_external_file_no_deps_in_module.snap | 9 +- ...nitialized_in_external_file_in_module.snap | 5 +- ...n_tests__enum_referenced_in_fb_nested.snap | 27 +- ...ts__function_defined_in_external_file.snap | 34 +- ...sts__global_value_from_different_file.snap | 4 +- ...ct_with_custom_init_in_different_file.snap | 6 +- ...ccepts_empty_statement_as_input_param.snap | 20 +- ...cepts_empty_statement_as_output_param.snap | 24 +- ...ccepts_empty_statement_as_input_param.snap | 9 +- ...cepts_empty_statement_as_output_param.snap | 17 +- ...sts__function_all_parameters_assigned.snap | 37 +- ...function_default_value_parameter_type.snap | 35 +- ...ests__function_empty_inout_assignment.snap | 29 +- ...ests__function_empty_input_assignment.snap | 29 +- ...sts__function_empty_output_assignment.snap | 29 +- ...empty_output_default_value_assignment.snap | 31 +- ...ts__function_missing_inout_assignment.snap | 29 +- ...ts__function_missing_input_assignment.snap | 29 +- ...issing_input_default_value_assignment.snap | 27 +- ...s__function_missing_output_assignment.snap | 29 +- ...ssing_output_default_value_assignment.snap | 31 +- ...unction_block_pointer_are_assigned_to.snap | 28 +- ...ccepts_empty_statement_as_input_param.snap | 13 +- ...cepts_empty_statement_as_output_param.snap | 21 +- ...gram_all_parameters_assigned_explicit.snap | 43 +- ...gram_all_parameters_assigned_implicit.snap | 31 +- ...tests__program_empty_inout_assignment.snap | 31 +- ...sts__program_missing_input_assignment.snap | 27 +- ...ts__program_missing_output_assignment.snap | 27 +- ...var_in_out_params_can_be_out_of_order.snap | 82 +- ...taccess_generated_as_rsh_and_trunc_i1.snap | 17 +- ...eaccess_generated_as_rsh_and_trunc_i8.snap | 21 +- ...access_generated_as_rsh_and_trunc_i32.snap | 21 +- ...gen_test__floating_point_type_casting.snap | 29 +- ...n_result_assignment_on_aliased_string.snap | 47 +- ..._function_result_assignment_on_string.snap | 47 +- ...t_codegen_test__nested_bitwise_access.snap | 11 +- ...n_test__variable_based_bitwise_access.snap | 23 +- ...access_generated_as_rsh_and_trunc_i16.snap | 21 +- ..._casted_string_assignment_uses_memcpy.snap | 25 +- ...g_generic_string_should_return_by_ref.snap | 48 +- ...ts__function_returns_a_literal_string.snap | 37 +- ...es_string_paramter_and_returns_string.snap | 47 +- ...rings_should_be_collected_as_literals.snap | 27 +- ...__string_tests__program_string_output.snap | 33 +- ...program_with_casted_string_assignment.snap | 19 +- ...__program_with_string_type_assignment.snap | 24 +- ...ing_tests__string_function_parameters.snap | 48 +- ...stant_var_string_should_be_memcpyable.snap | 48 +- ...ar_string_should_be_memcpyable_nonref.snap | 50 +- ...ariable_length_strings_can_be_created.snap | 23 +- ...trings_using_constants_can_be_created.snap | 23 +- ...ests__variable_string_assignment_test.snap | 21 +- ...string_tests__vartmp_string_init_test.snap | 21 +- ...ed_datatypes_respect_conversion_rules.snap | 21 +- ...r_than_int_promote_the_second_operand.snap | 15 +- ...es_smaller_than_dint_promoted_to_dint.snap | 15 +- ...all_sint_expressions_fallback_to_dint.snap | 15 +- ...at_and_double_mix_converted_to_double.snap | 15 +- ...m_test__float_assigned_to_int_is_cast.snap | 17 +- ...t__float_assinged_to_double_to_double.snap | 11 +- ...m_test__int_assigned_to_float_is_cast.snap | 17 +- ...an_byte_promoted_on_compare_statement.snap | 11 +- ...bigger_than_float_converted_to_double.snap | 11 +- ..._or_equal_to_float_converted_to_float.snap | 15 +- ...ariadic_functions_without_declaration.snap | 33 +- ...hile_32bit_and_higher_keep_their_type.snap | 33 +- ...es_smaller_than_dint_promoted_to_dint.snap | 15 +- ...e_calls_with_differently_sized_arrays.snap | 125 +- ...al_variable_passed_to_function_as_vla.snap | 57 +- ...ruct_is_generated_for_call_statements.snap | 42 +- ...sts__vla_tests__multi_dimensional_vla.snap | 104 +- ...en__tests__vla_tests__vla_read_access.snap | 70 +- ..._vla_tests__vla_read_access_with_expr.snap | 73 +- ..._vla_tests__vla_read_access_with_lint.snap | 69 +- ...__vla_tests__vla_read_access_with_var.snap | 73 +- src/codegen/tests/statement_codegen_test.rs | 56 +- src/codegen/tests/typesystem_test.rs | 40 +- src/linker.rs | 51 +- ...default_value_compile_time_evaluation.snap | 3 +- src/test_utils.rs | 9 - src/tests/adr/arrays_adr.rs | 30 +- src/tests/adr/enum_adr.rs | 14 +- src/tests/adr/initializer_functions_adr.rs | 567 ++-- src/tests/adr/pou_adr.rs | 273 +- src/tests/adr/strings_adr.rs | 34 +- src/tests/adr/structs_adr.rs | 40 +- src/tests/adr/vla_adr.rs | 137 +- tests/integration/linking.rs | 17 +- ...__integration__cfc__ir__actions_debug.snap | 60 +- ...egration__cfc__ir__conditional_return.snap | 60 +- ...on__cfc__ir__conditional_return_debug.snap | 23 +- ...r__conditional_return_evaluating_true.snap | 93 +- ...tional_return_evaluating_true_negated.snap | 93 +- ...sts__integration__cfc__ir__jump_debug.snap | 33 +- ...on__cfc__ir__jump_to_label_with_false.snap | 25 +- ...ion__cfc__ir__jump_to_label_with_true.snap | 25 +- ...tegration__cfc__ir__sink_source_debug.snap | 31 +- ...ble_source_to_variable_and_block_sink.snap | 45 +- ...line_compile__ir_generation_full_pass.snap | 3 +- tests/lit/lit.cfg | 2 +- 413 files changed, 11483 insertions(+), 12450 deletions(-) create mode 100644 Makefile delete mode 100644 src/codegen/tests/online_change_tests.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index fc2c09a8dba..06485a4bb8b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -17,6 +17,12 @@ rustflags = [ ] linker = "clang" +[target.aarch64-apple-darwin] +rustflags = [ + "-C", + "link-arg=-lxar" +] + [profile.profiling] inherits = "release" debug = true diff --git a/.vscode/launch.json b/.vscode/launch.json index 79742a5fc0e..d9de230fd81 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,29 +4,31 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "type": "codelldb", - "request": "launch", - "name": "Debug codelldb standard_lib", - "cargo": { + { + "type": "codelldb", + "request": "launch", + "name": "Debug codelldb standard_lib", + "cargo": { + "args": [ + "build", + "--bin=plc", + "--package=plc_driver" + ], + "filter": { + "name": "plc", + "kind": "bin" + } + }, + "program": "target/debug/plc", "args": [ - "build", - "--bin=plc", - "--package=plc_driver" + "libs/stdlib/iec61131-st/*.st" ], - "filter": { - "name": "plc", - "kind": "bin" - } - }, - "program": "target/debug/plc", - "args": ["libs/stdlib/iec61131-st/*.st"], - "cwd": "${workspaceFolder}", - "env": { - "RUST_LOG": "rusty" + "cwd": "${workspaceFolder}", + "env": { + "RUST_LOG": "rusty" + }, + "terminal": "integrated" }, - "terminal": "integrated" - }, { "type": "codelldb", "request": "launch", @@ -43,7 +45,11 @@ } }, "program": "target/debug/plc", - "args": ["target/demo.st", "-g", "-c"], + "args": [ + "target/demo.st", + "-g", + "-c" + ], "cwd": "${workspaceFolder}", "env": { "RUST_LOG": "rusty" @@ -66,6 +72,7 @@ } }, "args": [ + "-j=1", "target/demo.st", "tests/lit/util/printf.pli" ], @@ -107,7 +114,6 @@ "cwd": "${workspaceFolder}", "program": "target/demo", "terminal": "integrated" - } ] -} +} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 35426fc3aac..29e2d9b7414 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2156,23 +2156,11 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" -[[package]] -name = "lld_rs" -version = "140.0.0" -source = "git+https://github.com/mun-lang/lld-rs?rev=3798ace#3798ace8dae54f2b77f40a122beec12f4c80dc98" -dependencies = [ - "cc", - "lazy_static", - "libc", - "llvm-sys", - "semver", -] - [[package]] name = "llvm-sys" -version = "140.1.3" +version = "150.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3dc78e9857c0231ec11e3bdccf63870493fdc7d0570b0ea7d50bf5df0cb1a0c" +checksum = "aa55828745895d37233756307ded95a235b058aeb89cd12717ec7c3912089ee9" dependencies = [ "cc", "lazy_static", @@ -3469,7 +3457,6 @@ dependencies = [ "insta", "itertools", "lazy_static", - "lld_rs", "log", "logos", "num", diff --git a/Cargo.toml b/Cargo.toml index 07249bc3e8e..09ae4704a25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,6 @@ generational-arena = "0.2.8" regex = "1" shell-words = "1.1.0" plc_derive = { path = "./compiler/plc_derive" } -lld_rs = { git = "https://github.com/mun-lang/lld-rs", rev = "3798ace" } which = "4.2.5" log.workspace = true inkwell.workspace = true @@ -85,7 +84,7 @@ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.6", features = ["llvm14-0"] } +inkwell = { version = "0.6", features = ["llvm15-0"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..fd5e4a4735b --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +.PHONY: test report status-debug + +test: + @clear + cargo nextest run --no-fail-fast --workspace + +report: + @clear + @cargo nextest run --no-fail-fast --workspace 2>&1 | \ + awk "/thread '.*' \\([0-9]+\\) panicked at/ { \ + match(\$$0, /thread '[^']+'/); \ + test = substr(\$$0, RSTART+8, RLENGTH-9); \ + match(\$$0, /panicked at [^:]+:[0-9]+:[0-9]+/); \ + loc = substr(\$$0, RSTART, RLENGTH); \ + count[loc]++; \ + total++; \ + if (tests[loc] == \"\") tests[loc] = test; \ + else if (split(tests[loc], arr, \"|\") < 10) tests[loc] = tests[loc] \"|\" test; \ + } END { \ + for (k in count) print count[k] \"\t\" k \"\t\" tests[k]; \ + print \"TOTAL\t\" total; \ + }" | sort -rn | while IFS=$$'\t' read cnt loc names; do \ + if [ "$$cnt" = "TOTAL" ]; then \ + echo ""; \ + echo "========================================"; \ + echo "Total failed tests: $$loc"; \ + else \ + echo ""; \ + echo "$$cnt $$loc"; \ + echo "$$names" | tr '|' '\n' | sed 's/^/ /'; \ + fi; \ + done diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap index 8cdd30a2d1e..599117b60fb 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_function_call.snap @@ -1,7 +1,6 @@ --- -source: compiler/plc_driver/./src/tests/external_files.rs +source: compiler/plc_driver/src/tests/external_files.rs expression: "results.join(\"\\n\")" -snapshot_kind: text --- ; ModuleID = 'main.st' source_filename = "main.st" @@ -11,9 +10,9 @@ target triple = "[filtered]" define i16 @main() { entry: %main = alloca i16, align 2 - store i16 0, i16* %main, align 2 + store i16 0, ptr %main, align 2 %call = call i16 @external() - %main_ret = load i16, i16* %main, align 2 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } @@ -31,7 +30,7 @@ source_filename = "__init___TestProject" target datalayout = "[filtered]" target triple = "[filtered]" -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___TestProject, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___TestProject, ptr null }] define void @__init___TestProject() { entry: diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap index e22e906de82..7429ec4568d 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__external_files__external_file_global_var.snap @@ -1,7 +1,6 @@ --- -source: compiler/plc_driver/./src/tests/external_files.rs +source: compiler/plc_driver/src/tests/external_files.rs expression: "results.join(\"\\n\")" -snapshot_kind: text --- ; ModuleID = 'main.st' source_filename = "main.st" @@ -14,11 +13,11 @@ target triple = "[filtered]" define i16 @main() { entry: %main = alloca i16, align 2 - store i16 0, i16* %main, align 2 - store i16 2, i16* @x, align 2 - store i16 2, i16* @y, align 2 + store i16 0, ptr %main, align 2 + store i16 2, ptr @x, align 2 + store i16 2, ptr @y, align 2 %call = call i16 @external() - %main_ret = load i16, i16* %main, align 2 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } @@ -39,7 +38,7 @@ source_filename = "__init___TestProject" target datalayout = "[filtered]" target triple = "[filtered]" -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___TestProject, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___TestProject, ptr null }] define void @__init___TestProject() { entry: diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap index 57e8c660916..5b6a728b830 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap @@ -14,19 +14,19 @@ target triple = "[filtered]" define i16 @main() !dbg !4 { entry: %main = alloca i16, align 2 - call void @llvm.dbg.declare(metadata i16* %main, metadata !9, metadata !DIExpression()), !dbg !11 - store i16 0, i16* %main, align 2 - call void @mainProg(%mainProg* @mainProg_instance), !dbg !12 - %main_ret = load i16, i16* %main, align 2, !dbg !13 + call void @llvm.dbg.declare(metadata ptr %main, metadata !9, metadata !DIExpression()), !dbg !11 + store i16 0, ptr %main, align 2 + call void @mainProg(ptr @mainProg_instance), !dbg !12 + %main_ret = load i16, ptr %main, align 2, !dbg !13 ret i16 %main_ret, !dbg !13 } -declare !dbg !14 void @mainProg(%mainProg*) +declare !dbg !14 void @mainProg(ptr) -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -60,16 +60,16 @@ target triple = "[filtered]" @mainProg_instance = global %mainProg zeroinitializer, !dbg !0 -define void @mainProg(%mainProg* %0) !dbg !10 { +define void @mainProg(ptr %0) !dbg !10 { entry: - call void @llvm.dbg.declare(metadata %mainProg* %0, metadata !13, metadata !DIExpression()), !dbg !14 + call void @llvm.dbg.declare(metadata ptr %0, metadata !13, metadata !DIExpression()), !dbg !14 ret void, !dbg !14 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -99,19 +99,19 @@ target triple = "[filtered]" @mainProg_instance = external global %mainProg -define void @__init_mainprog(%mainProg* %0) { +define void @__init_mainprog(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -declare void @mainProg(%mainProg*) +declare void @mainProg(ptr) -define void @__user_init_mainProg(%mainProg* %0) { +define void @__user_init_mainProg(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } @@ -123,17 +123,17 @@ target triple = "[filtered]" %mainProg = type {} @mainProg_instance = external global %mainProg -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___TestProject, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___TestProject, ptr null }] define void @__init___TestProject() { entry: - call void @__init_mainprog(%mainProg* @mainProg_instance) - call void @__user_init_mainProg(%mainProg* @mainProg_instance) + call void @__init_mainprog(ptr @mainProg_instance) + call void @__user_init_mainProg(ptr @mainProg_instance) ret void } -declare void @__init_mainprog(%mainProg*) +declare void @__init_mainprog(ptr) -declare void @mainProg(%mainProg*) +declare void @mainProg(ptr) -declare void @__user_init_mainProg(%mainProg*) +declare void @__user_init_mainProg(ptr) diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap index b7153843aae..aaf81d6074b 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap @@ -14,19 +14,19 @@ target triple = "[filtered]" define i16 @main() !dbg !4 { entry: %main = alloca i16, align 2 - call void @llvm.dbg.declare(metadata i16* %main, metadata !9, metadata !DIExpression()), !dbg !11 - store i16 0, i16* %main, align 2 - call void @mainProg(%mainProg* @mainProg_instance), !dbg !12 - %main_ret = load i16, i16* %main, align 2, !dbg !13 + call void @llvm.dbg.declare(metadata ptr %main, metadata !9, metadata !DIExpression()), !dbg !11 + store i16 0, ptr %main, align 2 + call void @mainProg(ptr @mainProg_instance), !dbg !12 + %main_ret = load i16, ptr %main, align 2, !dbg !13 ret i16 %main_ret, !dbg !13 } -declare !dbg !14 void @mainProg(%mainProg*) +declare !dbg !14 void @mainProg(ptr) -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -60,16 +60,16 @@ target triple = "[filtered]" @mainProg_instance = global %mainProg zeroinitializer, !dbg !0 -define void @mainProg(%mainProg* %0) !dbg !10 { +define void @mainProg(ptr %0) !dbg !10 { entry: - call void @llvm.dbg.declare(metadata %mainProg* %0, metadata !13, metadata !DIExpression()), !dbg !14 + call void @llvm.dbg.declare(metadata ptr %0, metadata !13, metadata !DIExpression()), !dbg !14 ret void, !dbg !14 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -99,19 +99,19 @@ target triple = "[filtered]" @mainProg_instance = external global %mainProg -define void @__init_mainprog(%mainProg* %0) { +define void @__init_mainprog(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -declare void @mainProg(%mainProg*) +declare void @mainProg(ptr) -define void @__user_init_mainProg(%mainProg* %0) { +define void @__user_init_mainProg(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } @@ -123,17 +123,17 @@ target triple = "[filtered]" %mainProg = type {} @mainProg_instance = external global %mainProg -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___TestProject, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___TestProject, ptr null }] define void @__init___TestProject() { entry: - call void @__init_mainprog(%mainProg* @mainProg_instance) - call void @__user_init_mainProg(%mainProg* @mainProg_instance) + call void @__init_mainprog(ptr @mainProg_instance) + call void @__user_init_mainProg(ptr @mainProg_instance) ret void } -declare void @__init_mainprog(%mainProg*) +declare void @__init_mainprog(ptr) -declare void @mainProg(%mainProg*) +declare void @mainProg(ptr) -declare void @__user_init_mainProg(%mainProg*) +declare void @__user_init_mainProg(ptr) diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap index f5949e19cf4..5999608f00e 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_source_files_generated.snap @@ -1,7 +1,6 @@ --- -source: compiler/plc_driver/./src/tests/multi_files.rs +source: compiler/plc_driver/src/tests/multi_files.rs expression: "results.join(\"\\n\")" -snapshot_kind: text --- ; ModuleID = 'external_file1.st' source_filename = "external_file1.st" @@ -15,13 +14,13 @@ target triple = "[filtered]" define i16 @main() { entry: %main = alloca i16, align 2 - store i16 0, i16* %main, align 2 - call void @mainProg(%mainProg* @mainProg_instance) - %main_ret = load i16, i16* %main, align 2 + store i16 0, ptr %main, align 2 + call void @mainProg(ptr @mainProg_instance) + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } -declare void @mainProg(%mainProg*) +declare void @mainProg(ptr) ; ModuleID = 'external_file2.st' source_filename = "external_file2.st" @@ -32,7 +31,7 @@ target triple = "[filtered]" @mainProg_instance = global %mainProg zeroinitializer -define void @mainProg(%mainProg* %0) { +define void @mainProg(ptr %0) { entry: ret void } @@ -46,19 +45,19 @@ target triple = "[filtered]" @mainProg_instance = external global %mainProg -define void @__init_mainprog(%mainProg* %0) { +define void @__init_mainprog(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -declare void @mainProg(%mainProg*) +declare void @mainProg(ptr) -define void @__user_init_mainProg(%mainProg* %0) { +define void @__user_init_mainProg(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } @@ -70,17 +69,17 @@ target triple = "[filtered]" %mainProg = type {} @mainProg_instance = external global %mainProg -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___TestProject, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___TestProject, ptr null }] define void @__init___TestProject() { entry: - call void @__init_mainprog(%mainProg* @mainProg_instance) - call void @__user_init_mainProg(%mainProg* @mainProg_instance) + call void @__init_mainprog(ptr @mainProg_instance) + call void @__user_init_mainProg(ptr @mainProg_instance) ret void } -declare void @__init_mainprog(%mainProg*) +declare void @__init_mainprog(ptr) -declare void @mainProg(%mainProg*) +declare void @mainProg(ptr) -declare void @__user_init_mainProg(%mainProg*) +declare void @__user_init_mainProg(ptr) diff --git a/src/builtins.rs b/src/builtins.rs index 9a23752eb46..2e457403acd 100644 --- a/src/builtins.rs +++ b/src/builtins.rs @@ -194,7 +194,8 @@ lazy_static! { builder.position_at_end(insert_block); builder.build_switch(k.into_int_value(), continue_block, &cases)?; builder.position_at_end(continue_block); - Ok(ExpressionValue::LValue(result_var)) + let pointee = result_type; + Ok(ExpressionValue::LValue(result_var, pointee)) } else { Err(Diagnostic::codegen_error("Invalid signature for MUX", location).into()) } @@ -239,7 +240,16 @@ lazy_static! { let sel = generator.llvm.builder.build_select(cond, in1, in0, "")?; if sel.is_pointer_value(){ - Ok(ExpressionValue::LValue(sel.into_pointer_value())) + // The `select` instruction requires the to be selected values to be of the same + // type, hence for the pointee we can choose either one + let pointee = { + // TODO: The code above could be simplified by reducing the two ifs into one, + // and also store the type somehwere so we don't need to re-do it for the pointee here + let datatype = generator.annotations.get_type(actual_in0, generator.index).unwrap(); + generator.llvm_index.get_associated_type(datatype.get_name()).unwrap() + }; + + Ok(ExpressionValue::LValue(sel.into_pointer_value(), pointee)) } else { Ok(ExpressionValue::RValue(sel)) } @@ -922,8 +932,9 @@ fn generate_variable_length_array_bound_function<'ink>( )); }; + let pointee = generator.llvm_index.get_associated_type(data_type_information.get_name())?; let vla = generator.generate_lvalue(actual_vla).unwrap(); - let dim = builder.build_struct_gep(vla, 1, "dim").unwrap(); + let dim = builder.build_struct_gep(pointee, vla, 1, "dim").unwrap(); let accessor = match actual_dim.get_stmt() { // e.g. LOWER_BOUND(arr, 1) @@ -965,9 +976,11 @@ fn generate_variable_length_array_bound_function<'ink>( } } }; - let gep_bound = - unsafe { llvm.builder.build_in_bounds_gep(dim, &[llvm.i32_type().const_zero(), accessor], "") }?; - let bound = llvm.builder.build_load(gep_bound, "")?; + let pointee = pointee.into_struct_type().get_field_type_at_index(1).unwrap(); + let gep_bound = unsafe { + llvm.builder.build_in_bounds_gep(pointee, dim, &[llvm.i32_type().const_zero(), accessor], "") + }?; + let bound = llvm.builder.build_load(llvm.i32_type(), gep_bound, "")?; Ok(ExpressionValue::RValue(bound)) } else { diff --git a/src/codegen.rs b/src/codegen.rs index 6060e730a86..c7a365eb7ae 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -243,7 +243,7 @@ impl<'ink> CodeGen<'ink> { .try_into() .expect("the computed custom GOT size is too large"); - let ptr_ty = llvm.context.i8_type().ptr_type(AddressSpace::default()); + let ptr_ty = llvm.context.ptr_type(AddressSpace::default()); let empty_got = ptr_ty .const_array(vec![ptr_ty.const_null(); got_size as usize].as_slice()) .as_basic_value_enum(); diff --git a/src/codegen/generators/data_type_generator.rs b/src/codegen/generators/data_type_generator.rs index 44fc56923ab..80c603ba9d1 100644 --- a/src/codegen/generators/data_type_generator.rs +++ b/src/codegen/generators/data_type_generator.rs @@ -1,8 +1,7 @@ // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder use crate::codegen::debug::Debug; -use crate::codegen::llvm_index::TypeHelper; use crate::codegen::CodegenError; -use crate::index::{FxIndexSet, Index, PouIndexEntry, VariableIndexEntry, VariableType}; +use crate::index::{FxIndexSet, Index, VariableIndexEntry, VariableType}; use crate::resolver::{AstAnnotations, Dependency}; use crate::typesystem::{self, DataTypeInformation, Dimension, StringEncoding, StructSource}; use crate::{ @@ -14,9 +13,8 @@ use crate::{ typesystem::DataType, }; -use inkwell::types::{AnyType, AnyTypeEnum, FunctionType}; +use inkwell::types::{AnyType, AnyTypeEnum, BasicTypeEnum}; use inkwell::{ - types::{BasicType, BasicTypeEnum}, values::{BasicValue, BasicValueEnum}, AddressSpace, }; @@ -276,14 +274,8 @@ impl<'ink> DataTypeGenerator<'ink, '_> { .map_err(Into::into) .and_then(|data_type| self.create_type(name, data_type)), DataTypeInformation::Void => Ok(get_llvm_int_type(self.llvm.context, 32, "Void").into()), - DataTypeInformation::Pointer { inner_type_name, .. } => { - let inner_type = if information.is_function_pointer() { - self.create_function_type(inner_type_name)?.as_any_type_enum() - } else { - self.create_type(inner_type_name, self.index.get_type(inner_type_name)?)? - }; - - Ok(inner_type.create_ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into()) + DataTypeInformation::Pointer { .. } => { + Ok(self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into()) } DataTypeInformation::Generic { .. } => { unreachable!("Generic types should not be generated") @@ -291,66 +283,6 @@ impl<'ink> DataTypeGenerator<'ink, '_> { } } - fn create_function_type(&mut self, method_name: &str) -> Result, Diagnostic> { - let return_type = self - .types_index - .find_associated_type(self.index.get_return_type_or_void(method_name).get_name()) - .map(|opt| opt.as_any_type_enum()) - .unwrap_or(self.llvm.context.void_type().as_any_type_enum()); - - let mut parameter_types = Vec::new(); - - match self.index.find_pou(method_name) { - Some(PouIndexEntry::Method { parent_name, .. }) => { - let ty = self.types_index.get_associated_type(parent_name).expect("must exist"); - let ty_ptr = ty.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into(); - - // Methods are defined as functions in the LLVM IR, but carry the underlying POU type as their - // first parameter to operate on them, hence push the POU type to the very first position. - parameter_types.push(ty_ptr); - - for parameter in self.index.get_declared_parameters(method_name) { - // Instead of relying on the LLVM index, we create data-types on the fly here because some - // types have not yet been visited and as a result may not be in the index. For example at - // the time of writing this the index was not able to find a input parameter of type - // `__auto_pointer_to_DINT`, consequently panicking - let ty = self.create_type( - parameter.get_name(), - self.index.get_type(¶meter.data_type_name).expect("must exist"), - )?; - - parameter_types.push(ty.try_into().unwrap()); - } - } - - Some(PouIndexEntry::FunctionBlock { name, .. }) => { - let ty = self.types_index.get_associated_type(name).expect("must exist"); - let ty_ptr = ty.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into(); - - // Function blocks are a bit "weird" in that they only expect an instance argument even if - // they define input, output and/or inout parameters. Effectively, while being methods per-se, - // their calling convention differs from regular methods. - parameter_types.push(ty_ptr); - } - - _ => unreachable!("internal error, invalid method call"), - } - - let fn_type = match return_type { - AnyTypeEnum::ArrayType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::FloatType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::IntType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::PointerType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::StructType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::VectorType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::VoidType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::ScalableVectorType(value) => value.fn_type(parameter_types.as_slice(), false), - AnyTypeEnum::FunctionType(_) => unreachable!(), - }; - - Ok(fn_type) - } - fn generate_initial_value( &mut self, data_type: &DataType, diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index 7dfbe04c9f5..c065ad308a6 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -2,10 +2,10 @@ use inkwell::{ builder::Builder, - types::{BasicType, BasicTypeEnum, FunctionType}, + types::{BasicType, BasicTypeEnum}, values::{ - ArrayValue, BasicMetadataValueEnum, BasicValue, BasicValueEnum, CallSiteValue, CallableValue, - FloatValue, IntValue, PointerValue, ScalableVectorValue, StructValue, VectorValue, + ArrayValue, BasicMetadataValueEnum, BasicValue, BasicValueEnum, CallSiteValue, FloatValue, IntValue, + PointerValue, ScalableVectorValue, StructValue, VectorValue, }, AddressSpace, FloatPredicate, IntPredicate, }; @@ -27,9 +27,8 @@ use plc_util::convention::qualified_name; use crate::{ codegen::{ debug::{Debug, DebugBuilderEnum}, - generators::llvm::FundamentalElementType, llvm_index::LlvmTypedIndex, - llvm_typesystem::{cast_if_needed, get_llvm_int_type}, + llvm_typesystem::cast_if_needed, CodegenError, }, index::{ @@ -39,7 +38,7 @@ use crate::{ resolver::{AnnotationMap, AstAnnotations, StatementAnnotation}, typesystem::{ self, is_same_type_class, DataType, DataTypeInformation, DataTypeInformationProvider, Dimension, - StringEncoding, VarArgs, DEFAULT_STRING_LEN, DINT_TYPE, INT_SIZE, INT_TYPE, LINT_TYPE, + StringEncoding, VarArgs, DEFAULT_STRING_LEN, DINT_TYPE, LINT_TYPE, }, }; @@ -82,7 +81,7 @@ struct CallParameterAssignment<'a, 'b> { pub enum ExpressionValue<'ink> { /// A Locator-Value /// An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address). - LValue(PointerValue<'ink>), + LValue(PointerValue<'ink>, BasicTypeEnum<'ink>), /// An expression that does not represent an object occupying some identifiable location in memory. RValue(BasicValueEnum<'ink>), } @@ -91,8 +90,8 @@ impl<'ink> ExpressionValue<'ink> { /// returns the value represented by this ExpressionValue pub fn get_basic_value_enum(&self) -> BasicValueEnum<'ink> { match self { - ExpressionValue::LValue(it) => it.as_basic_value_enum(), - ExpressionValue::RValue(it) => it.to_owned(), + ExpressionValue::LValue(value, _) => value.as_basic_value_enum(), + ExpressionValue::RValue(value) => value.to_owned(), } } @@ -104,8 +103,10 @@ impl<'ink> ExpressionValue<'ink> { load_name: Option, ) -> Result, CodegenError> { match self { - ExpressionValue::LValue(it) => llvm.load_pointer(it, load_name.as_deref().unwrap_or("")), - ExpressionValue::RValue(it) => Ok(it.to_owned()), + ExpressionValue::LValue(value, pointee) => { + llvm.load_pointer(*pointee, value, load_name.as_deref().unwrap_or_default()) + } + ExpressionValue::RValue(value) => Ok(value.to_owned()), } } } @@ -235,14 +236,25 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let message = format!("Cannot find '{}' in associated variable values", this_name); Diagnostic::codegen_error(message, expression) })?; - Ok(ExpressionValue::LValue(this_value)) + + let pointee = self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into(); + Ok(ExpressionValue::LValue(this_value, pointee)) } AstStatement::ReferenceExpr(data) => { let res = self.generate_reference_expression(&data.access, data.base.as_deref(), expression)?; let val = match res { - ExpressionValue::LValue(val) => { - ExpressionValue::LValue(self.auto_deref_if_necessary(val, expression)?) + ExpressionValue::LValue(value, _) => { + let value = self.auto_deref_if_necessary(value, expression)?; + let pointee = { + // TODO: I think it should be safe to fetch the pointee this way and return it + // as a result in `ExpressionValue::LValue` but not 100% sure + let datatype = self.annotations.get_type(expression, self.index).unwrap(); + let effective_ty = self.index.find_effective_type(datatype).unwrap_or(datatype); + self.llvm_index.get_associated_type(&effective_ty.name).unwrap() + }; + + ExpressionValue::LValue(value, pointee) } ExpressionValue::RValue(val) => { let val = if val.is_pointer_value() { @@ -256,9 +268,16 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { }; Ok(val) } - AstStatement::HardwareAccess(..) => self - .create_llvm_pointer_value_for_reference(None, "address", expression) - .map(ExpressionValue::LValue), + AstStatement::HardwareAccess(..) => { + let value = self.create_llvm_pointer_value_for_reference(None, "address", expression)?; + let pointee = { + let datatype = self.annotations.get_type(expression, self.index).unwrap(); + self.llvm_index.get_associated_type(datatype.get_name()).unwrap() + }; + + Ok(ExpressionValue::LValue(value, pointee)) + } + AstStatement::BinaryExpression(data) => self .generate_binary_expression(&data.left, &data.right, &data.operator, expression) .map(ExpressionValue::RValue), @@ -306,69 +325,6 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.generate_expression_value(const_expression) } - /// Generate an access to the appropriate GOT entry to achieve an access to the given base - /// lvalue. - pub fn generate_got_access( - &self, - context: &AstNode, - llvm_type: &BasicTypeEnum<'ink>, - ) -> Result>, CodegenError> { - match self.annotations.get(context) { - Some(StatementAnnotation::Variable { qualified_name, .. }) => { - // We will generate a GEP, which has as its base address the magic constant which - // will eventually be replaced by the location of the GOT. - let base = - self.llvm.context.i64_type().const_int(0xdeadbeef00000000, false).const_to_pointer( - llvm_type.ptr_type(AddressSpace::default()).ptr_type(AddressSpace::default()), - ); - - self.llvm_index - .find_got_index(qualified_name) - .map(|idx| { - let ptr = self.llvm.load_array_element( - base, - &[self.llvm.context.i32_type().const_int(idx, false)], - "", - )?; - Ok(self.llvm.load_pointer(&ptr, "")?.into_pointer_value()) - }) - .transpose() - } - _ => Ok(None), - } - } - - /// Generate an access to the appropriate GOT entry to achieve a call to the given function. - pub fn generate_got_call( - &self, - qualified_name: &str, - function_type: &FunctionType<'ink>, - args: &[BasicMetadataValueEnum<'ink>], - ) -> Result>, CodegenError> { - // We will generate a GEP, which has as its base address the magic constant which - // will eventually be replaced by the location of the GOT. - let base = self.llvm.context.i64_type().const_int(0xdeadbeef00000000, false).const_to_pointer( - function_type.ptr_type(AddressSpace::default()).ptr_type(AddressSpace::default()), - ); - - self.llvm_index - .find_got_index(qualified_name) - .map(|idx| { - let mut ptr = self.llvm.load_array_element( - base, - &[self.llvm.context.i32_type().const_int(idx, false)], - "", - )?; - ptr = self.llvm.load_pointer(&ptr, "")?.into_pointer_value(); - let callable = CallableValue::try_from(ptr).map_err(|_| { - CodegenError::new("Pointer was not a function pointer", SourceLocation::undefined()) - })?; - - Ok(self.llvm.builder.build_call(callable, args, "call")?) - }) - .transpose() - } - /// generates a binary expression (e.g. a + b, x AND y, etc.) and returns the resulting `BasicValueEnum` /// - `left` the AstStatement left of the operator /// - `right` the AstStatement right of the operator @@ -556,17 +512,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { // Check for the function within the GOT. If it's there, we need to generate an indirect // call to its location within the GOT, which should contain a function pointer. // First get the function type so our function pointer can have the correct type. - let qualified_name = self - .annotations - .get_qualified_name(operator) - .expect("Shouldn't have got this far without a name for the function"); - let function_type = function.get_type(); - let call = self.generate_got_call(qualified_name, &function_type, &arguments_list)?; - let call = if let Some(call) = call { - call - } else { - self.llvm.builder.build_call(function, &arguments_list, "call")? - }; + let call = self.llvm.builder.build_call(function, &arguments_list, "call")?; // if the target is a function, declare the struct locally // assign all parameters into the struct values @@ -579,7 +525,9 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { .either(Ok, |_| { // we return an uninitialized int pointer for void methods :-/ // dont deref it!! - Ok(get_llvm_int_type(self.llvm.context, INT_SIZE, INT_TYPE) + Ok(self + .llvm + .context .ptr_type(AddressSpace::from(ADDRESS_SPACE_CONST)) .const_null() .as_basic_value_enum()) @@ -622,8 +570,10 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { // Get the associated variable then load it, e.g. `%localFnPtrVariable = alloca void (%Fb*)*, align 8` // followed by `%1 = load void (%Fb*)*, void (%Fb*)** %localFnPtrVariable, align 8`` let function_pointer_value = match self.generate_expression_value(base)? { - ExpressionValue::LValue(value) => self.llvm.load_pointer(&value, "")?.into_pointer_value(), - ExpressionValue::RValue(_) => unreachable!(), + ExpressionValue::LValue(value, pointee) => { + self.llvm.load_pointer(pointee, &value, "")?.into_pointer_value() + } + ExpressionValue::RValue(_) => unreachable!("fnptr base must be an lvalue"), }; // Generate the argument list; our assumption is function pointers are only supported for methods and @@ -660,17 +610,29 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { (instance, arguments, generated_arguments) }; - // Finally generate the function pointer call - let callable = CallableValue::try_from(function_pointer_value).unwrap(); - let call = self + // Finally generate the function pointer call. + // We get the function type from the associated implementation stub in the llvm_index, + // and use it together with the loaded function pointer value. + let function_value = + self.llvm_index.find_associated_implementation(qualified_pou_name).ok_or_else(|| { + Diagnostic::codegen_error( + format!("No callable implementation associated to {qualified_pou_name:?}"), + operator, + ) + })?; + let function_type = function_value.get_type(); + + let call: CallSiteValue = self .llvm .builder - .build_call(callable, &arguments_llvm, "fnptr_call") + .build_indirect_call(function_type, function_pointer_value, &arguments_llvm, "fnptr_call") .map_err(CodegenError::from)?; let value = match call.try_as_basic_value() { Either::Left(value) => value, - Either::Right(_) => get_llvm_int_type(self.llvm.context, INT_SIZE, INT_TYPE) + Either::Right(_) => self + .llvm + .context .ptr_type(AddressSpace::from(ADDRESS_SPACE_CONST)) .const_null() .as_basic_value_enum(), @@ -821,13 +783,16 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { &self, left_statement: &AstNode, left_pointer: PointerValue, + left_type: &DataType, right_pointer: PointerValue, right_type: &DataType, ) -> Result<(), CodegenError> { - let left_value = self.llvm.builder.build_load(left_pointer, "")?.into_int_value(); + let pointee = self.llvm_index.get_associated_type(&left_type.name).unwrap(); + let left_value = self.llvm.builder.build_load(pointee, left_pointer, "")?.into_int_value(); //Generate an expression for the right size - let right = self.llvm.builder.build_load(right_pointer, "")?; + let pointee = self.llvm_index.get_associated_type(&right_type.name).unwrap(); + let right = self.llvm.builder.build_load(pointee, right_pointer, "")?; self.generate_assignment_with_direct_access( left_statement, left_value, @@ -874,11 +839,19 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let (base, _) = collect_base_and_direct_access_for_assignment(base).unwrap(); let lhs = self.generate_expression_value(base)?.get_basic_value_enum(); - let rhs = self.llvm.builder.build_struct_gep(parameter_struct, index, "").unwrap(); + let lhs_type = self.annotations.get_type(base, self.index).unwrap(); + let pointee = self.llvm_index.get_associated_pou_type(function_name).unwrap(); + let rhs = + self.llvm.builder.build_struct_gep(pointee, parameter_struct, index, "").unwrap(); + + // func(outVar => foo.bar.baz.%W3) + // ^^^^^^ ^^^^^^^^^^^^^^^ + // rhs lhs => foo.bar.baz.%W3 = outVar; self.generate_output_assignment_with_direct_access( expr, lhs.into_pointer_value(), + lhs_type, rhs, rhs_type, )?; @@ -889,12 +862,15 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let assigned_output = self.generate_lvalue(expr)?; let assigned_output_type = self.annotations.get_type_or_void(expr, self.index).get_type_information(); - let output = builder.build_struct_gep(parameter_struct, index, "").map_err(|_| { - Diagnostic::codegen_error( - format!("Cannot build generate parameter: {parameter:#?}"), - ¶meter.source_location, - ) - })?; + + let pointee = self.llvm_index.get_associated_pou_type(function_name).unwrap(); + let output = + builder.build_struct_gep(pointee, parameter_struct, index, "").map_err(|_| { + Diagnostic::codegen_error( + format!("Cannot build generate parameter: {parameter:#?}"), + ¶meter.source_location, + ) + })?; let output_value_type = self.index.get_type_information_or_void(parameter.get_type_name()); @@ -908,7 +884,8 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { parameter.source_location.clone(), )?; } else { - let output_value = builder.build_load(output, "")?; + let pointee = self.llvm_index.get_associated_type(output_value_type.get_name()).unwrap(); + let output_value = builder.build_load(pointee, output, "")?; builder.build_store(assigned_output, output_value)?; } } @@ -1126,8 +1103,8 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let value = { let value = self.generate_expression_value(argument)?; match value { - ExpressionValue::LValue(v) => v, - ExpressionValue::RValue(_v) => { + ExpressionValue::LValue(value, _) => value, + ExpressionValue::RValue(_) => { // Passed a literal to a byref parameter? let value = self.generate_expression(argument)?; let argument = self.llvm.builder.build_alloca(value.get_type(), "")?; @@ -1167,18 +1144,6 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } } - // ...check if we can bitcast an array to a pointer, i.e. `[81 x i8]*` should be passed as a `i8*` - if value.get_type().get_element_type().is_array_type() { - let fundamental_element_type = value.into_fundamental_type(); - let res = self.llvm.builder.build_bit_cast( - value, - fundamental_element_type.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)), - "", - )?; - - return Ok(res.into_pointer_value().into()); - } - // ...otherwise no bitcasting was needed, thus return the generated element pointer as is Ok(value.into()) } @@ -1223,7 +1188,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { })?; // if the variadic argument is ByRef, wrap it in a pointer. let ty = if argument_type.is_by_ref() { - ty.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into() + self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into() } else { ty }; @@ -1235,6 +1200,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let arr_storage = self.llvm.builder.build_alloca(arr, "")?; for (i, ele) in generated_params.iter().enumerate() { let ele_ptr = self.llvm.load_array_element( + arr.as_basic_type_enum(), arr_storage, &[ self.llvm.context.i32_type().const_zero(), @@ -1248,7 +1214,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { // bitcast the array to pointer so it matches the declared function signature let arr_storage = self.llvm.builder.build_bit_cast( arr_storage, - ty.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)), + self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)), "", )?; @@ -1322,7 +1288,8 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.generate_expression(initial_value) } else { let ptr_value = self.llvm.builder.build_alloca(parameter_type, "")?; - Ok(self.llvm.load_pointer(&ptr_value, "")?) + let pointee = parameter_type; + Ok(self.llvm.load_pointer(pointee, &ptr_value, "")?) } } _ => { @@ -1390,12 +1357,17 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { return Ok(None); } - let pointer_to_param = builder.build_struct_gep(parameter_struct, index, "").map_err(|_| { - Diagnostic::codegen_error( - format!("Cannot build generate parameter: {expression:#?}"), - expression, - ) - })?; + let pointee = self + .llvm_index + .get_associated_pou_type(function_name) + .expect("POU type for parameter struct must exist"); + let pointer_to_param = + builder.build_struct_gep(pointee, parameter_struct, index, "").map_err(|_| { + Diagnostic::codegen_error( + format!("Cannot build generate parameter: {expression:#?}"), + expression, + ) + })?; let parameter = self .index @@ -1485,12 +1457,12 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { /// - `context` the statement to obtain the location from when returning an error fn create_llvm_pointer_value_for_reference( &self, - qualifier: Option<&PointerValue<'ink>>, + qualifier: Option<(&AstNode, PointerValue<'ink>)>, name: &str, context: &AstNode, ) -> Result, CodegenError> { let offset = &context.get_location(); - if let Some(qualifier) = qualifier { + if let Some((qualifier_node, qualifier)) = qualifier { //if we're loading a reference like PLC_PRG.ACTION we already loaded PLC_PRG pointer into qualifier, //so we should not load anything in addition for the action (or the method) match self.annotations.get(context) { @@ -1506,8 +1478,17 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { .find_fully_qualified_variable(qualified_name) .map(VariableIndexEntry::get_location_in_parent) .ok_or_else(|| Diagnostic::unresolved_reference(qualified_name, offset))?; - let gep: PointerValue<'_> = - self.llvm.get_member_pointer_from_struct(*qualifier, member_location, name)?; + let pointee = { + let datatype = self.annotations.get_type(qualifier_node, self.index).unwrap(); + self.llvm_index.get_associated_type(&datatype.name).unwrap() + }; + + let gep: PointerValue<'_> = self.llvm.get_member_pointer_from_struct( + pointee, + qualifier, + member_location, + name, + )?; return Ok(gep); } @@ -1522,27 +1503,17 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } } - let ctx_type = self.annotations.get_type_or_void(context, self.index).get_type_information(); - // no context ... so just something like 'x' match self.annotations.get(context) { Some(StatementAnnotation::Variable { qualified_name, .. }) | Some(StatementAnnotation::Program { qualified_name, .. }) => self - .generate_got_access(context, &self.llvm_index.get_associated_type(ctx_type.get_name())?)? - .map_or( - self.llvm_index - .find_loaded_associated_variable_value(qualified_name) - .ok_or_else(|| Diagnostic::unresolved_reference(name, offset).into()), - Ok, - ), + .llvm_index + .find_loaded_associated_variable_value(qualified_name) + .ok_or_else(|| Diagnostic::unresolved_reference(name, offset).into()), _ => Err(Diagnostic::unresolved_reference(name, offset).into()), } } - fn deref(&self, accessor_ptr: PointerValue<'ink>) -> Result, CodegenError> { - Ok(self.llvm.load_pointer(&accessor_ptr, "deref")?.into_pointer_value()) - } - pub fn ptr_as_value(&self, ptr: PointerValue<'ink>) -> Result, CodegenError> { let int_type = self.llvm.context.i64_type(); Ok(if ptr.is_const() { @@ -1567,11 +1538,15 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { accessor_ptr: PointerValue<'ink>, statement: &AstNode, ) -> Result, CodegenError> { - if self.annotations.get(statement).is_some_and(|opt| opt.is_auto_deref()) { - self.deref(accessor_ptr) - } else { - Ok(accessor_ptr) + if self.annotations.get(statement).is_some_and(StatementAnnotation::is_auto_deref) { + // Normally it wouldn't be safe to just assume the pointee in the `load_pointer` call is just of + // type `ptr`. However, we return a `PointerValue` here, so LLVM actually expects a `ptr` type + // from us as it would panic with any other type otherwise. + let pointee = self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into(); + return Ok(self.llvm.load_pointer(pointee, &accessor_ptr, "deref")?.into_pointer_value()); } + + Ok(accessor_ptr) } /// generates the access-expression for an array-reference @@ -1626,7 +1601,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.generate_expression_value(reference) .map(|it| it.get_basic_value_enum().into_pointer_value()) .and_then(|lvalue| { - if let DataTypeInformation::Array { dimensions, inner_type_name, .. } = + if let DataTypeInformation::Array { name, dimensions, inner_type_name } = self.get_type_hint_info_for(reference)? { // make sure dimensions match statement list @@ -1704,66 +1679,70 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { .map_err(|_| Diagnostic::codegen_error("non-numeric index-access", access).into()) })?; - let accessor_sequence = if lvalue.get_type().get_element_type().is_array_type() { - // For typed array pointers (e.g.: [81 x i32]*): - // the first index (0) will point to the array -> [81 x i32] - // the second index (index_access) will point to the element in the array - vec![self.llvm.i32_type().const_zero(), index_access] - } else if self.index.find_effective_type_by_name(inner_type_name).is_some_and(|it| { - matches!( - it.get_type_information(), - DataTypeInformation::Array { .. } | DataTypeInformation::String { .. } - ) - }) { - // For flattened array-of-array parameters (fundamental element pointer): - // Calculate proper stride: index * element_size - // This handles cases like i8* representing [N x STRING]* or i32* representing [N x [M x i32]]* - let DataTypeInformation::Array { inner_type_name, .. } = - self.get_type_hint_info_for(reference)? - else { - log::error!("Uncaught resolve error for inner type of nested array"); - return Err(Diagnostic::codegen_error( - "Expected inner type to be resolvable", - reference, + let accessor_sequence = + if self.llvm_index.get_associated_type(name.as_str())?.is_array_type() { + // For typed array pointers (e.g.: [81 x i32]*): + // the first index (0) will point to the array -> [81 x i32] + // the second index (index_access) will point to the element in the array + vec![self.llvm.i32_type().const_zero(), index_access] + } else if self.index.find_effective_type_by_name(inner_type_name).is_some_and(|it| { + matches!( + it.get_type_information(), + DataTypeInformation::Array { .. } | DataTypeInformation::String { .. } ) - .into()); - }; - - // Get the size of the inner type (STRING or nested array) - // TODO: use `if let Some(...) if ` once rust is updated and get rid of "is_nested_array" above - let Some(inner_type) = self.index.find_effective_type_by_name(inner_type_name) else { - unreachable!("type must exist in index due to previous checks") - }; - - let element_size = match inner_type.get_type_information() { - DataTypeInformation::String { size, .. } => { - size.as_int_value(self.index).unwrap_or((DEFAULT_STRING_LEN + 1_u32).into()) - as u64 - } - DataTypeInformation::Array { dimensions, .. } => { - // For nested arrays, calculate total size - dimensions - .iter() - .map(|d| d.get_length(self.index).unwrap_or(1) as u64) - .product() - } - _ => unreachable!("Must be STRING or ARRAY type due to previous checks"), + }) { + // For flattened array-of-array parameters (fundamental element pointer): + // Calculate proper stride: index * element_size + // This handles cases like i8* representing [N x STRING]* or i32* representing [N x [M x i32]]* + let DataTypeInformation::Array { inner_type_name, .. } = + self.get_type_hint_info_for(reference)? + else { + log::error!("Uncaught resolve error for inner type of nested array"); + return Err(Diagnostic::codegen_error( + "Expected inner type to be resolvable", + reference, + ) + .into()); + }; + + // Get the size of the inner type (STRING or nested array) + // TODO: use `if let Some(...) if ` once rust is updated and get rid of "is_nested_array" above + let Some(inner_type) = self.index.find_effective_type_by_name(inner_type_name) + else { + unreachable!("type must exist in index due to previous checks") + }; + + let element_size = match inner_type.get_type_information() { + DataTypeInformation::String { size, .. } => size + .as_int_value(self.index) + .unwrap_or((DEFAULT_STRING_LEN + 1_u32).into()) + as u64, + DataTypeInformation::Array { dimensions, .. } => { + // For nested arrays, calculate total size + dimensions + .iter() + .map(|d| d.get_length(self.index).unwrap_or(1) as u64) + .product() + } + _ => unreachable!("Must be STRING or ARRAY type due to previous checks"), + }; + + let byte_offset = self.llvm.builder.build_int_mul( + index_access, + self.llvm.i32_type().const_int(element_size, false), + "array_stride_offset", + )?; + vec![byte_offset] + } else { + // lvalue is a simple pointer to type -> e.g.: i32* + // only one index (index_access) is needed to access the element + vec![index_access] }; - let byte_offset = self.llvm.builder.build_int_mul( - index_access, - self.llvm.i32_type().const_int(element_size, false), - "array_stride_offset", - )?; - vec![byte_offset] - } else { - // lvalue is a simple pointer to type -> e.g.: i32* - // only one index (index_access) is needed to access the element - vec![index_access] - }; - // load the access from that array - let pointer = self.llvm.load_array_element(lvalue, &accessor_sequence, "tmpVar")?; + let pointee = self.llvm_index.get_associated_type(name).unwrap(); + let pointer = + self.llvm.load_array_element(pointee, lvalue, &accessor_sequence, "tmpVar")?; return Ok(pointer); } @@ -1793,28 +1772,33 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let result = match operator { Operator::Plus | Operator::Minus => { - let (ptr, index, name) = if left_type.is_pointer() && right_type.is_int() { + let (ptr, pointee, index, name) = if left_type.is_pointer() && right_type.is_int() { let ptr = left_expr.into_pointer_value(); + let pointee = self.llvm_index.get_associated_type(left_type.get_inner_name()).unwrap(); let index = right_expr.into_int_value(); let name = format!("access_{}", left_type.get_name()); - (Some(ptr), Some(index), Some(name)) + (Some(ptr), Some(pointee), Some(index), Some(name)) } else if left_type.is_int() && right_type.is_pointer() { let ptr = right_expr.into_pointer_value(); + let pointee = self.llvm_index.get_associated_type(right_type.get_inner_name()).unwrap(); let index = left_expr.into_int_value(); let name = format!("access_{}", right_type.get_name()); - (Some(ptr), Some(index), Some(name)) + (Some(ptr), Some(pointee), Some(index), Some(name)) } else { // if left and right are both pointers we can not perform plus/minus - (None, None, None) + (None, None, None, None) }; - if let (Some(ptr), Some(mut index), Some(name)) = (ptr, index, name) { + if let (Some(ptr), Some(pointee), Some(mut index), Some(name)) = (ptr, pointee, index, name) { // if operator is minus we need to negate the index if let Operator::Minus = operator { index = self.int_neg(index)?; } - Ok(self.llvm.load_array_element(ptr, &[index], name.as_str())?.as_basic_value_enum()) + Ok(self + .llvm + .load_array_element(pointee, ptr, &[index], name.as_str())? + .as_basic_value_enum()) } else { Err(Diagnostic::codegen_error( format!("'{operator}' operation must contain one int type").as_str(), @@ -2147,13 +2131,14 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { ) })? as usize; + let pointee = self.llvm_index.get_associated_type(expected_type.get_name()).unwrap(); match encoding { StringEncoding::Utf8 => { let literal = self.llvm_index.find_utf08_literal_string(value).map(|it| it.as_pointer_value()); if let Some((literal_value, _)) = literal.zip(self.function_context) { //global constant string - Ok(ExpressionValue::LValue(literal_value)) + Ok(ExpressionValue::LValue(literal_value, pointee)) } else { //note that .len() will give us the number of bytes, not the number of characters let actual_length = value.chars().count() + 1; // +1 to account for a final \0 @@ -2171,7 +2156,9 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { && self.function_context.is_some() { //global constant string - Ok(literal.map(|it| ExpressionValue::LValue(it.as_pointer_value())).unwrap()) + Ok(literal + .map(|it| ExpressionValue::LValue(it.as_pointer_value(), pointee)) + .unwrap()) } else { //note that .len() will give us the number of bytes, not the number of characters let actual_length = value.encode_utf16().count() + 1; // +1 to account for a final \0 @@ -2651,39 +2638,35 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { ) -> Result, CodegenError> { let builder = &self.llvm.builder; - // array access is either directly on a reference or on another array access (ARRAY OF ARRAY) - let StatementAnnotation::Variable { resulting_type: reference_type, .. } = reference_annotation else { unreachable!(); }; let struct_ptr = reference.get_basic_value_enum().into_pointer_value(); - // GEPs into the VLA struct, getting an LValue for the array pointer and the dimension array and - // dereferences the former - let arr_ptr_gep = self.llvm.builder.build_struct_gep(struct_ptr, 0, "vla_arr_gep").map_err(|_| { - Diagnostic::codegen_error("Cannot access VLA array pointer", access.get_location()) - })?; - let vla_arr_ptr = builder.build_load(arr_ptr_gep, "vla_arr_ptr")?.into_pointer_value(); - // get pointer to array containing dimension information - let dim_arr_gep = builder.build_struct_gep(struct_ptr, 1, "dim_arr")?; - - // get lengths of dimensions + let type_ = self.index.get_type_information_or_void(reference_type); + let vla_struct_type = self.llvm_index.get_associated_type(type_.get_name())?; + + let arr_ptr_gep = + builder.build_struct_gep(vla_struct_type, struct_ptr, 0, "vla_arr_gep").map_err(|_| { + Diagnostic::codegen_error("Cannot access VLA array pointer", access.get_location()) + })?; + let ptr_type = self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)); + let vla_arr_ptr = builder.build_load(ptr_type, arr_ptr_gep, "vla_arr_ptr")?.into_pointer_value(); + + let dim_arr_gep = builder.build_struct_gep(vla_struct_type, struct_ptr, 1, "dim_arr")?; + let Some(ndims) = type_.get_type_information().get_dimension_count() else { unreachable!() }; - // get the start/end offsets for each dimension ( ARRAY[4..10, -4..4] ...) - let index_offsets = get_indices(self.llvm, ndims, dim_arr_gep)?; + let dimensions_array_type = vla_struct_type.into_struct_type().get_field_type_at_index(1).unwrap(); + let index_offsets = get_indices(self.llvm, ndims, dim_arr_gep, dimensions_array_type)?; - // calculate the required offset from the array pointer for the given accessor statements. this is - // relatively straightforward for single-dimensional arrays, but is quite costly (O(n²)) for multi-dimensional arrays let access_statements = access.get_as_list(); let accessor = if access_statements.len() == 1 { let Some(stmt) = access_statements.first() else { unreachable!("Must have exactly 1 access statement") }; - //turn it into i32 immediately - // this is the same logic we use for normal array accessors let access_value = cast_if_needed!( self, self.index.get_type(DINT_TYPE)?, @@ -2692,21 +2675,16 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { None )?; - // if start offset is not 0, adjust the access value accordingly let Some(start_offset) = index_offsets.first().map(|(start, _)| *start) else { unreachable!("VLA must have information about dimension offsets") }; self.create_llvm_int_binary_expression(&Operator::Minus, access_value, start_offset.into())? .into_int_value() } else { - // see https://plc-lang.github.io/rusty/arch/codegen.html#multi-dimensional-arrays - // for more details on multi-dimensional array accessor calculation let accessors = access_statements .iter() .map(|it| { let value = self.generate_expression(it).expect("Uncaught invalid accessor statement"); - //turn it into i32 immediately - // this is the same logic we use for normal array accessors Ok(cast_if_needed!( self, self.index.get_type(DINT_TYPE)?, @@ -2722,23 +2700,22 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { unreachable!("Amount of access statements and dimensions does not match.") } - // length of a dimension is 'end - start + 1' let lengths = get_dimension_lengths(self.llvm, &index_offsets)?; - - // calculate the accessor multiplicators for each dimension. let dimension_offsets = get_vla_accessor_factors(self.llvm, &lengths)?; - - // adjust accessors for 0-indexing let adjusted_accessors = normalize_offsets(self.llvm, &accessors, &index_offsets)?; - // calculate the resulting accessor for the given accessor statements and dimension offsets int_value_multiply_accumulate( self.llvm, &adjusted_accessors.iter().zip(&dimension_offsets).collect::>(), )? }; - unsafe { builder.build_in_bounds_gep(vla_arr_ptr, &[accessor], "arr_val").map_err(Into::into) } + let inner_type = self.index.find_elementary_pointer_type(type_.get_type_information()); + let inner_type_name = inner_type.get_inner_array_type_name().unwrap_or_else(|| inner_type.get_name()); + let element_type = self.llvm_index.get_associated_type(inner_type_name)?; + + unsafe { builder.build_in_bounds_gep(element_type, vla_arr_ptr, &[accessor], "arr_val") } + .map_err(Into::into) } /// generates a reference expression (member, index, deref, etc.) @@ -2757,11 +2734,18 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { (ReferenceAccess::Global(node), _) => { let name = node.get_flat_reference_name().unwrap_or("unknown"); - self.create_llvm_pointer_value_for_reference( + let value = self.create_llvm_pointer_value_for_reference( None, self.get_load_name(node).as_deref().unwrap_or(name), node, - ).map(ExpressionValue::LValue) + )?; + + let pointee = { + let datatype = self.annotations.get_type(node, self.index).unwrap(); + self.llvm_index.get_associated_type(&datatype.name).unwrap() + }; + + Ok(ExpressionValue::LValue(value, pointee)) } // `base.member` or just `member` @@ -2776,28 +2760,45 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { } else { let member_name = member.get_flat_reference_name().unwrap_or("unknown"); - self.create_llvm_pointer_value_for_reference( - base_value.map(|it| it.get_basic_value_enum().into_pointer_value()).as_ref(), + let value = self.create_llvm_pointer_value_for_reference( + base_value.map(|it| (base.unwrap(), it.get_basic_value_enum().into_pointer_value())), self.get_load_name(member).as_deref().unwrap_or(member_name), original_expression, - ).map(ExpressionValue::LValue) + )?; + + let pointee = { + // TODO: Not 100% sure if correct; also I feel like `create_llvm_pointer_value_for_reference` should return an ExpressionValue? + let datatype = self.annotations.get_type(original_expression, self.index).unwrap(); + let effective_ty = self.index.find_effective_type(datatype).unwrap_or(datatype); + self.llvm_index.get_associated_type(&effective_ty.name).unwrap() + }; + + Ok(ExpressionValue::LValue(value, pointee)) } } // `base[idx]` (ReferenceAccess::Index(array_idx), Some(base)) => { if self.annotations.get_type_or_void(base, self.index).is_vla() { - // vla array needs special handling - self.generate_element_pointer_for_vla( + let value = self.generate_element_pointer_for_vla( self.generate_expression_value(base)?, self.annotations.get(base).expect(""), array_idx.as_ref(), - ) - .map_err(|_| unreachable!("invalid access statement")) - .map(ExpressionValue::LValue) + )?; + let pointee = { + let datatype = self.annotations.get_type(original_expression, self.index).unwrap(); + self.llvm_index.get_associated_type(datatype.get_name()).unwrap() + }; + Ok(ExpressionValue::LValue(value, pointee)) } else { // normal array expression - self.generate_element_pointer_for_array(base, array_idx).map(ExpressionValue::LValue) + let value = self.generate_element_pointer_for_array(base, array_idx)?; + let pointee = { + let datatype = self.annotations.get_type(original_expression, self.index).unwrap(); + self.llvm_index.get_associated_type(datatype.get_name()).unwrap() + }; + + Ok(ExpressionValue::LValue(value, pointee)) } } @@ -2818,9 +2819,8 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { let target_value = self.generate_expression_value(target.as_ref())?; // Get the LLVM type for the cast target - let target_llvm_type = self.llvm_index.get_associated_type(base_type_name) - .map(|t| t.ptr_type(AddressSpace::from(0))) - .unwrap_or_else(|_| self.llvm.context.i8_type().ptr_type(AddressSpace::from(0))); + let _ = self.llvm_index.get_associated_type(base_type_name); + let target_llvm_type = self.llvm.context.ptr_type(AddressSpace::from(0)); // Perform the bitcast let basic_value = target_value.get_basic_value_enum(); @@ -2833,12 +2833,24 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { // `base^` (ReferenceAccess::Deref, Some(base)) => { - let ptr = self.generate_expression_value(base)?; - Ok(ExpressionValue::LValue( - self.llvm - .load_pointer(&ptr.get_basic_value_enum().into_pointer_value(), "deref")? - .into_pointer_value(), - )) + let base_lvalue = self.generate_expression_value(base)?; + + let value = self.llvm.load_pointer( + // Normally it wouldn't be safe to just assume the pointee in the `load_pointer` call to + // be of type `ptr`. However, we call `into_pointer_value` on the result of it, as such + // LLVM actually expects the type to be `ptr` as it will panic otherwise. + self.llvm.context.ptr_type( + AddressSpace::from(ADDRESS_SPACE_GENERIC)).into(), + &base_lvalue.get_basic_value_enum().into_pointer_value(), + "deref" + )?; + + let pointee = { + // TODO: Not 100% sure if correct + let datatype = self.annotations.get_type(original_expression, self.index).unwrap(); + self.llvm_index.get_associated_type(&datatype.name).unwrap() + }; + Ok(ExpressionValue::LValue(value.into_pointer_value(), pointee)) } // `&base` @@ -2961,24 +2973,32 @@ fn get_indices<'ink>( llvm: &Llvm<'ink>, ndims: usize, dimensions_array: PointerValue<'ink>, + dimensions_array_type: BasicTypeEnum<'ink>, ) -> Result, IntValue<'ink>)>, CodegenError> { + let i32_type = llvm.i32_type(); (0..ndims) .map(|i| unsafe { let (start_ptr, end_ptr) = ( llvm.builder.build_in_bounds_gep( + dimensions_array_type, dimensions_array, - &[llvm.i32_type().const_zero(), llvm.i32_type().const_int(i as u64 * 2, false)], + &[i32_type.const_zero(), i32_type.const_int(i as u64 * 2, false)], format!("start_idx_ptr{i}").as_str(), )?, llvm.builder.build_in_bounds_gep( + dimensions_array_type, dimensions_array, - &[llvm.i32_type().const_zero(), llvm.i32_type().const_int(1 + i as u64 * 2, false)], + &[i32_type.const_zero(), i32_type.const_int(1 + i as u64 * 2, false)], format!("end_idx_ptr{i}").as_str(), )?, ); Ok(( - llvm.builder.build_load(start_ptr, format!("start_idx_value{i}").as_str())?.into_int_value(), - llvm.builder.build_load(end_ptr, format!("end_idx_value{i}").as_str())?.into_int_value(), + llvm.builder + .build_load(i32_type, start_ptr, format!("start_idx_value{i}").as_str())? + .into_int_value(), + llvm.builder + .build_load(i32_type, end_ptr, format!("end_idx_value{i}").as_str())? + .into_int_value(), )) }) .collect::, CodegenError>>() @@ -3045,21 +3065,19 @@ fn int_value_product<'ink>( llvm: &Llvm<'ink>, values: &[IntValue<'ink>], ) -> Result, CodegenError> { - // initialize the accumulator with 1 - let accum_ptr = llvm.builder.build_alloca(llvm.i32_type(), "accum")?; - llvm.builder.build_store(accum_ptr, llvm.i32_type().const_int(1, false))?; + let i32_type = llvm.i32_type(); + let accum_ptr = llvm.builder.build_alloca(i32_type, "accum")?; + llvm.builder.build_store(accum_ptr, i32_type.const_int(1, false))?; for val in values { - // load previous value from accumulator and multiply with current value let product = llvm.builder.build_int_mul( - llvm.builder.build_load(accum_ptr, "load_accum")?.into_int_value(), + llvm.builder.build_load(i32_type, accum_ptr, "load_accum")?.into_int_value(), *val, "product", )?; - // store new value into accumulator llvm.builder.build_store(accum_ptr, product)?; } - Ok(llvm.builder.build_load(accum_ptr, "accessor_factor")?.into_int_value()) + Ok(llvm.builder.build_load(i32_type, accum_ptr, "accessor_factor")?.into_int_value()) } /// Iterates over a collection of tuples, computes the product of the two numbers @@ -3070,22 +3088,19 @@ fn int_value_multiply_accumulate<'ink>( llvm: &Llvm<'ink>, values: &[(&IntValue<'ink>, &IntValue<'ink>)], ) -> Result, CodegenError> { - // initialize the accumulator with 0 - let accum = llvm.builder.build_alloca(llvm.i32_type(), "accum")?; - llvm.builder.build_store(accum, llvm.i32_type().const_zero())?; + let i32_type = llvm.i32_type(); + let accum = llvm.builder.build_alloca(i32_type, "accum")?; + llvm.builder.build_store(accum, i32_type.const_zero())?; for (left, right) in values { - // multiply accessor with dimension factor let product = llvm.builder.build_int_mul(**left, **right, "multiply")?; - // load previous value from accum and add product let curr = llvm.builder.build_int_add( - llvm.builder.build_load(accum, "load_accum")?.into_int_value(), + llvm.builder.build_load(i32_type, accum, "load_accum")?.into_int_value(), product, "accumulate", )?; - // store new value into accumulator llvm.builder.build_store(accum, curr)?; } - Ok(llvm.builder.build_load(accum, "accessor")?.into_int_value()) + Ok(llvm.builder.build_load(i32_type, accum, "accessor")?.into_int_value()) } // XXX: Could be problematic with https://github.com/PLC-lang/rusty/issues/668 diff --git a/src/codegen/generators/llvm.rs b/src/codegen/generators/llvm.rs index dfb12a94883..f18e9916006 100644 --- a/src/codegen/generators/llvm.rs +++ b/src/codegen/generators/llvm.rs @@ -122,13 +122,14 @@ impl<'a> Llvm<'a> { /// - `name` the name of the resulting variable pub fn load_array_element( &self, + pointee: BasicTypeEnum<'a>, pointer_to_array_instance: PointerValue<'a>, accessor_sequence: &[IntValue<'a>], name: &str, ) -> Result, CodegenError> { unsafe { self.builder - .build_in_bounds_gep(pointer_to_array_instance, accessor_sequence, name) + .build_in_bounds_gep(pointee, pointer_to_array_instance, accessor_sequence, name) .map_err(Into::into) } } @@ -141,11 +142,14 @@ impl<'a> Llvm<'a> { /// - `offset` the location in case of a Diagnostic pub fn get_member_pointer_from_struct( &self, + pointee: BasicTypeEnum<'a>, pointer_to_struct_instance: PointerValue<'a>, member_index: u32, name: &str, ) -> Result, CodegenError> { - self.builder.build_struct_gep(pointer_to_struct_instance, member_index, name).map_err(Into::into) + self.builder + .build_struct_gep(pointee, pointer_to_struct_instance, member_index, name) + .map_err(Into::into) } /// loads the value behind the given pointer @@ -154,10 +158,11 @@ impl<'a> Llvm<'a> { /// - `name` the name of the temporary variable pub fn load_pointer( &self, + pointee_ty: BasicTypeEnum<'a>, lvalue: &PointerValue<'a>, name: &str, ) -> Result, CodegenError> { - self.builder.build_load(lvalue.to_owned(), name).map_err(Into::into) + self.builder.build_load(pointee_ty, lvalue.to_owned(), name).map_err(Into::into) } /// creates a placeholder datatype for a struct with the given name @@ -216,7 +221,7 @@ impl<'a> Llvm<'a> { /// create a null pointer pub fn create_null_ptr(&self) -> Result, CodegenError> { - let itype = self.context.i32_type().ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)); + let itype = self.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)); let value = itype.const_null(); Ok(value.into()) } @@ -402,36 +407,3 @@ impl<'a> Llvm<'a> { Ok(()) } } - -/// A trait to get the fundamental element type from nested arrays -pub(crate) trait FundamentalElementType<'a> { - fn into_fundamental_type(self) -> BasicTypeEnum<'a>; -} - -impl<'a> FundamentalElementType<'a> for PointerValue<'a> { - /// Gets the fundamental element type from a pointer to nested arrays - /// - /// For example: `[2 x [81 x i8]]*` -> `i8`, `[3 x i32]*` -> `i32` - fn into_fundamental_type(self) -> BasicTypeEnum<'a> { - let element_type = self.get_type().get_element_type(); - if element_type.is_array_type() { - element_type.into_array_type().into_fundamental_type() - } else { - element_type.try_into().expect("Expected basic type") - } - } -} - -impl<'a> FundamentalElementType<'a> for ArrayType<'a> { - /// Recursively gets the fundamental element type from nested arrays - /// - /// For example: `[2 x [81 x i8]` -> `i8`, `[3 x i32]` -> `i32` - fn into_fundamental_type(self) -> BasicTypeEnum<'a> { - let element_type = self.get_element_type(); - if element_type.is_array_type() { - element_type.into_array_type().into_fundamental_type() - } else { - element_type - } - } -} diff --git a/src/codegen/generators/pou_generator.rs b/src/codegen/generators/pou_generator.rs index 74a9b692767..6a8f158de03 100644 --- a/src/codegen/generators/pou_generator.rs +++ b/src/codegen/generators/pou_generator.rs @@ -10,7 +10,6 @@ use super::{ use crate::{ codegen::{ debug::{Debug, DebugBuilderEnum}, - generators::llvm::FundamentalElementType, llvm_index::LlvmTypedIndex, CodegenError, }, @@ -32,14 +31,11 @@ use index::VariableType; use inkwell::{ module::{Linkage, Module}, - types::{BasicMetadataTypeEnum, BasicTypeEnum, FunctionType}, + types::{BasicMetadataTypeEnum, BasicType, BasicTypeEnum, FunctionType}, values::{BasicValue, BasicValueEnum, FunctionValue}, AddressSpace, }; -use inkwell::{ - types::{BasicType, StructType}, - values::PointerValue, -}; +use inkwell::{types::StructType, values::PointerValue}; use plc_ast::ast::{AstNode, Implementation, PouType}; use plc_diagnostics::diagnostics::{Diagnostic, INTERNAL_LLVM_ERROR}; use plc_source::source_location::SourceLocation; @@ -215,24 +211,10 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { let param = declared_parameters.get(i); let dti = param.map(|it| self.index.get_type_information_or_void(it.get_type_name())); match param { - Some(v) - if v.is_in_parameter_by_ref() && - // parameters by ref will always be a pointer - p.into_pointer_type().get_element_type().is_array_type() => - { - // for by-ref array types we will generate a pointer to the fundamental element type - // not a pointer to array - let fundamental_element_type = p - .into_pointer_type() - .get_element_type() - .into_array_type() - .into_fundamental_type(); - - let ty = fundamental_element_type.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)); - - // set the new type for further codegen + Some(v) if v.is_in_parameter_by_ref() => { + // TODO: Not sure if this is 100% correct, previously it was `v.is_in_parameter_by_ref() && p.into_pointer_type().get_element_type().is_array_type()` but we don't distinguish between pointer types so just a `ptr` is fine here? + let ty = self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)); let _ = new_llvm_index.associate_type(v.get_type_name(), ty.into()); - ty.into() } _ => { @@ -243,15 +225,14 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { // for aggregate function parameters we will generate a pointer instead of the value type. // it will then later be memcopied into a locally allocated variable match it { - DataTypeInformation::Struct { .. } => p - .into_struct_type() + DataTypeInformation::Struct { .. } => self + .llvm + .context .ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)) .into(), DataTypeInformation::Array { .. } | DataTypeInformation::String { .. } => { - // For arrays, get the fundamental element type - let fundamental_element_type = - p.into_array_type().into_fundamental_type(); - fundamental_element_type + self.llvm + .context .ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)) .into() } @@ -345,7 +326,7 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { // Function pointer curr_f.as_global_value().as_basic_value_enum().get_type(), //Data - self.llvm.context.i8_type().ptr_type(AddressSpace::default()).as_basic_type_enum(), + self.llvm.context.ptr_type(AddressSpace::default()).as_basic_type_enum(), ], false, ); @@ -354,7 +335,7 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { let str_value = ctor_str.const_named_struct(&[ self.llvm.context.i32_type().const_zero().as_basic_value_enum(), curr_f.as_global_value().as_basic_value_enum(), - self.llvm.context.i8_type().ptr_type(AddressSpace::default()).const_zero().as_basic_value_enum(), + self.llvm.context.ptr_type(AddressSpace::default()).const_zero().as_basic_value_enum(), ]); //Create an array with the global constructor as an entry let arr = ctor_str.const_array(&[str_value]); @@ -377,11 +358,11 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { ) -> Result>, CodegenError> { if !implementation.implementation_type.is_function_method_or_init() { let mut parameters = vec![]; - let instance_struct_type: StructType = self + let _instance_struct_type: StructType = self .llvm_index .get_associated_pou_type(implementation.get_type_name()) .map(|it| it.into_struct_type())?; - parameters.push(instance_struct_type.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into()); + parameters.push(self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into()); Ok(parameters) } else { let declared_params = self.index.get_declared_parameters(implementation.get_call_name()); @@ -394,12 +375,10 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { if implementation.get_implementation_type() == &ImplementationType::Method { let class_name = implementation.get_associated_class_name().expect("Method needs to have a class-name"); - let instance_members_struct_type: StructType = + let _instance_members_struct_type: StructType = self.llvm_index.get_associated_type(class_name).map(|it| it.into_struct_type())?; - parameters.insert( - 0, - instance_members_struct_type.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into(), - ); + parameters + .insert(0, self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into()); } Ok(parameters) @@ -619,13 +598,7 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { && type_info.is_aggregate() { // a by-value aggregate type => we need to memcpy the data into the local variable - let ty = if ty.is_array_type() { - ty.into_array_type() - .get_element_type() - .ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)) - } else { - ty.into_struct_type().ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)) - }; + let ty = self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)); let bitcast = self.llvm.builder.build_bit_cast(ptr, ty, "bitcast")?.into_pointer_value(); let (size, alignment) = if let DataTypeInformation::String { size, encoding } = type_info { @@ -728,10 +701,11 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { let temp_type = index.get_associated_type(m.get_type_name())?; (parameter_name, self.llvm.create_local_variable(parameter_name, &temp_type)?) } else { + let pointee = self.llvm_index.get_associated_pou_type(type_name).unwrap(); let ptr = self .llvm .builder - .build_struct_gep(param_pointer, var_count as u32, parameter_name) + .build_struct_gep(pointee, param_pointer, var_count as u32, parameter_name) .expect(INTERNAL_LLVM_ERROR); var_count += 1; @@ -788,10 +762,9 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { .is_some_and(|it| it.is_reference_to() || it.is_alias()) { // aliases and reference to variables have special handling for initialization. initialize with a nullpointer - self.llvm.builder.build_store( - left, - left.get_type().get_element_type().into_pointer_type().const_null(), - )?; + let pointee = + self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).const_null(); + self.llvm.builder.build_store(left, pointee)?; continue; }; let right_stmt = @@ -838,28 +811,17 @@ impl<'ink, 'cg> PouGenerator<'ink, 'cg> { //Create a size parameter of type i32 (DINT) let size = self.llvm_index.find_associated_type(DINT_TYPE).map(Into::into)?; - let ty = self - .llvm_index - .find_associated_type(type_name) - .map(|it| { - if it.is_array_type() && var.get_declaration_type().is_by_ref() { - // the declaration for array types passed by ref are generatad as pointer to element type - // we need to match the declaration - it.into_array_type().get_element_type() - } else { - it - } - }) - .map(|it| { - if var.get_declaration_type().is_by_ref() { - // variadic by ref will result in a double pointer - it.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).as_basic_type_enum() - } else { - it - } - })? - .ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)) - .into(); + let _ = self.llvm_index.find_associated_type(type_name).map(|it| { + if it.is_array_type() && var.get_declaration_type().is_by_ref() { + // the declaration for array types passed by ref are generatad as pointer to element type + // we need to match the declaration + it.into_array_type().get_element_type() + } else { + it + } + })?; + + let ty = self.llvm.context.ptr_type(AddressSpace::from(ADDRESS_SPACE_GENERIC)).into(); Some([size, ty]) } else { diff --git a/src/codegen/generators/statement_generator.rs b/src/codegen/generators/statement_generator.rs index d53ce2cea3e..9954793199c 100644 --- a/src/codegen/generators/statement_generator.rs +++ b/src/codegen/generators/statement_generator.rs @@ -433,6 +433,10 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { self.generate_assignment_statement(llvm_index, &stmt.counter, &stmt.start)?; let counter = exp_gen.generate_lvalue(&stmt.counter)?; + let counter_pointee = { + let datatype = self.annotations.get_type(&stmt.counter, self.index).unwrap(); + self.llvm_index.get_associated_type(&datatype.name).unwrap() + }; // generate loop predicate selector. since `STEP` can be a reference, this needs to be a runtime eval // XXX(mhasel): IR could possibly be improved by generating phi instructions. @@ -457,10 +461,11 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { let end = exp_gen.generate_expression_value(&stmt.end).unwrap(); let end_value = match end { - ExpressionValue::LValue(ptr) => builder.build_load(ptr, "")?, + ExpressionValue::LValue(value, pointee) => builder.build_load(pointee, value, "")?, ExpressionValue::RValue(val) => val, }; - let counter_value = builder.build_load(counter, "")?; + + let counter_value = builder.build_load(counter_pointee, counter, "")?; let cmp = builder.build_int_compare( predicate, cast_if_needed!(exp_gen, cast_target_ty, counter_ty, counter_value, None)?.into_int_value(), @@ -494,7 +499,7 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { // increment counter builder.build_unconditional_branch(increment)?; builder.position_at_end(increment); - let counter_value = builder.build_load(counter, "")?; + let counter_value = builder.build_load(counter_pointee, counter, "")?; let inc = inkwell::values::BasicValue::as_basic_value_enum(&builder.build_int_add( eval_step()?.into_int_value(), cast_if_needed!(exp_gen, cast_target_ty, counter_ty, counter_value, None)?.into_int_value(), @@ -825,7 +830,9 @@ impl<'a, 'b> StatementCodeGenerator<'a, 'b> { SourceLocation::undefined(), ) })?; - let loaded_value = self.llvm.load_pointer(&value_ptr, var_name.as_str())?; + + let pointee = self.llvm_index.get_associated_type(ret_v.get_type_name()).unwrap(); + let loaded_value = self.llvm.load_pointer(pointee, &value_ptr, var_name.as_str())?; self.llvm.builder.build_return(Some(&loaded_value))?; } } else { diff --git a/src/codegen/llvm_index.rs b/src/codegen/llvm_index.rs index 521f9ab44b9..d86a8a3e56d 100644 --- a/src/codegen/llvm_index.rs +++ b/src/codegen/llvm_index.rs @@ -1,7 +1,6 @@ // Copyright (c) 2020 Ghaith Hachem and Mathias Rieder -use inkwell::types::{AnyTypeEnum, BasicType, BasicTypeEnum, PointerType}; +use inkwell::types::{AnyTypeEnum, BasicType, BasicTypeEnum}; use inkwell::values::{AnyValue, BasicValueEnum, FunctionValue, GlobalValue, PointerValue}; -use inkwell::AddressSpace; use plc_diagnostics::diagnostics::Diagnostic; use plc_source::source_location::SourceLocation; use plc_util::convention::qualified_name; @@ -28,7 +27,6 @@ pub struct LlvmTypedIndex<'ink> { pub trait TypeHelper<'ink> { #[allow(clippy::wrong_self_convention)] fn as_basic_type(self) -> Option>; - fn create_ptr_type(&self, address_space: AddressSpace) -> PointerType<'ink>; } impl<'ink> TypeHelper<'ink> for AnyTypeEnum<'ink> { @@ -45,20 +43,6 @@ impl<'ink> TypeHelper<'ink> for AnyTypeEnum<'ink> { AnyTypeEnum::FunctionType(_) => None, } } - - fn create_ptr_type(&self, address_space: AddressSpace) -> PointerType<'ink> { - match self { - AnyTypeEnum::ArrayType(value) => value.ptr_type(address_space), - AnyTypeEnum::FloatType(value) => value.ptr_type(address_space), - AnyTypeEnum::IntType(value) => value.ptr_type(address_space), - AnyTypeEnum::PointerType(value) => value.ptr_type(address_space), - AnyTypeEnum::StructType(value) => value.ptr_type(address_space), - AnyTypeEnum::VectorType(value) => value.ptr_type(address_space), - AnyTypeEnum::ScalableVectorType(value) => value.ptr_type(address_space), - AnyTypeEnum::FunctionType(value) => value.ptr_type(address_space), - AnyTypeEnum::VoidType(_) => unreachable!("Void type cannot be converted to pointer"), - } - } } impl<'ink> LlvmTypedIndex<'ink> { diff --git a/src/codegen/llvm_typesystem.rs b/src/codegen/llvm_typesystem.rs index 3f82dee9c6d..20905bebcb0 100644 --- a/src/codegen/llvm_typesystem.rs +++ b/src/codegen/llvm_typesystem.rs @@ -405,7 +405,10 @@ impl<'ctx, 'cast> Castable<'ctx, 'cast> for PointerValue<'ctx> { .. } => { // we are dealing with an auto-deref vla parameter. first we have to deref our array and build the fat pointer - let struct_val = cast_data.llvm.builder.build_load(self, "auto_deref")?.cast(cast_data)?; + let pointee = + cast_data.llvm_type_index.get_associated_type(cast_data.value_type.get_name())?; + let struct_val = + cast_data.llvm.builder.build_load(pointee, self, "auto_deref")?.cast(cast_data)?; // create a pointer to the generated StructValue let struct_ptr = @@ -463,15 +466,18 @@ impl<'ctx, 'cast> Castable<'ctx, 'cast> for ArrayValue<'ctx> { })?; // gep into the original array. the resulting address will be stored in the VLA struct - let arr_gep = unsafe { builder.build_in_bounds_gep(array_pointer, &[zero, zero], "outer_arr_gep")? }; + let pointee = cast_data.llvm_type_index.get_associated_type(cast_data.value_type.get_name())?; + let arr_gep = + unsafe { builder.build_in_bounds_gep(pointee, array_pointer, &[zero, zero], "outer_arr_gep")? }; // -- Generate struct & arr_ptr -- let ty = associated_type.into_struct_type(); let vla_struct = builder.build_alloca(ty, "vla_struct")?; - let vla_arr_ptr = builder.build_struct_gep(vla_struct, 0, "vla_array_gep")?; + let vla_arr_ptr = builder.build_struct_gep(associated_type, vla_struct, 0, "vla_array_gep")?; - let vla_dimensions_ptr = builder.build_struct_gep(vla_struct, 1, "vla_dimensions_gep")?; + let vla_dimensions_ptr = + builder.build_struct_gep(associated_type, vla_struct, 1, "vla_dimensions_gep")?; // -- Generate dimensions -- let DataTypeInformation::Array { dimensions, .. } = cast_data.value_type else { unreachable!() }; @@ -490,7 +496,7 @@ impl<'ctx, 'cast> Castable<'ctx, 'cast> for ArrayValue<'ctx> { builder.build_store(vla_arr_ptr, arr_gep)?; - builder.build_load(vla_struct, "").map_err(Into::into) + builder.build_load(associated_type, vla_struct, "").map_err(Into::into) } fn cast_constant( diff --git a/src/codegen/tests.rs b/src/codegen/tests.rs index ccbe645acf0..1ca2d2e0689 100644 --- a/src/codegen/tests.rs +++ b/src/codegen/tests.rs @@ -12,7 +12,6 @@ mod function_tests; mod generics_test; mod initialization_test; mod multifile_codegen_tests; -mod online_change_tests; mod oop_tests; mod parameters_tests; mod polymorphism; diff --git a/src/codegen/tests/address_tests.rs b/src/codegen/tests/address_tests.rs index b5b4e22bed0..fd8103716de 100644 --- a/src/codegen/tests/address_tests.rs +++ b/src/codegen/tests/address_tests.rs @@ -18,7 +18,7 @@ fn aliased_address_in_global_generated() { target datalayout = "[filtered]" target triple = "[filtered]" - @foo = global i8* null + @foo = global ptr null @__PI_1_2_3_4 = global i8 0 "#); } @@ -40,9 +40,9 @@ fn duplicate_aliased_address_in_global_generated() { target datalayout = "[filtered]" target triple = "[filtered]" - @foo = global i8* null + @foo = global ptr null @__PI_1_2_3_4 = global i8 0 - @baz = global i8* null + @baz = global ptr null "#); } @@ -70,17 +70,17 @@ fn address_variable_used_with_symbolic_name() { %mainProg = type {} - @foo = global i8* null + @foo = global ptr null @__PI_1_2_3_4 = global i8 0 - @baz = global i8* null + @baz = global ptr null @mainProg_instance = global %mainProg zeroinitializer - define void @mainProg(%mainProg* %0) { + define void @mainProg(ptr %0) { entry: - %deref = load i8*, i8** @foo, align 8 - store i8 0, i8* %deref, align 1 - %deref1 = load i8*, i8** @baz, align 8 - store i8 1, i8* %deref1, align 1 + %deref = load ptr, ptr @foo, align 8 + store i8 0, ptr %deref, align 1 + %deref1 = load ptr, ptr @baz, align 8 + store i8 1, ptr %deref1, align 1 ret void } "#); @@ -111,18 +111,18 @@ fn address_used_in_body() { %mainProg = type {} - @foo = global i8* null + @foo = global ptr null @__PI_1_2_3_4 = global i8 0 - @baz = global i8* null + @baz = global ptr null @__PI_1_2_3_5 = global i8 0 @x = global i8 1 @mainProg_instance = global %mainProg zeroinitializer - define void @mainProg(%mainProg* %0) { + define void @mainProg(ptr %0) { entry: - store i8 1, i8* @__PI_1_2_3_4, align 1 - %1 = load i8, i8* @__PI_1_2_3_5, align 1 - store i8 %1, i8* @x, align 1 + store i8 1, ptr @__PI_1_2_3_4, align 1 + %1 = load i8, ptr @__PI_1_2_3_5, align 1 + store i8 %1, ptr @x, align 1 ret void } "#); diff --git a/src/codegen/tests/code_gen_tests.rs b/src/codegen/tests/code_gen_tests.rs index acdc823d77e..f6e7f82185d 100644 --- a/src/codegen/tests/code_gen_tests.rs +++ b/src/codegen/tests/code_gen_tests.rs @@ -1115,32 +1115,32 @@ fn fb_method_called_locally() { @__foo__init = unnamed_addr constant %foo { i32 42 } - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %call = call i32 @foo__addToBar(%foo* %0, i16 42) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } - define i32 @foo__addToBar(%foo* %0, i16 %1) { + define i32 @foo__addToBar(ptr %0, i16 %1) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 - store i16 %1, i16* %in, align 2 - store i32 0, i32* %foo.addToBar, align 4 - %load_in = load i16, i16* %in, align 2 + store i16 %1, ptr %in, align 2 + store i32 0, ptr %foo.addToBar, align 4 + %load_in = load i16, ptr %in, align 2 %2 = sext i16 %load_in to i32 - %load_bar = load i32, i32* %bar, align 4 + %load_bar = load i32, ptr %bar, align 4 %tmpVar = add i32 %2, %load_bar - store i32 %tmpVar, i32* %bar, align 4 - %load_bar1 = load i32, i32* %bar, align 4 - store i32 %load_bar1, i32* %foo.addToBar, align 4 - %foo__addToBar_ret = load i32, i32* %foo.addToBar, align 4 + store i32 %tmpVar, ptr %bar, align 4 + %load_bar1 = load i32, ptr %bar, align 4 + store i32 %load_bar1, ptr %foo.addToBar, align 4 + %foo__addToBar_ret = load i32, ptr %foo.addToBar, align 4 ret i32 %foo__addToBar_ret } @@ -1148,18 +1148,17 @@ fn fb_method_called_locally() { entry: %fb = alloca %foo, align 8 %x = alloca i32, align 4 - %0 = bitcast %foo* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false) - store i32 0, i32* %x, align 4 - %call = call i32 @foo__addToBar(%foo* %fb, i16 3) - store i32 %call, i32* %x, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %x, align 4 + %call = call i32 @foo__addToBar(ptr %fb, i16 3) + store i32 %call, ptr %x, align 4 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#) } @@ -1204,34 +1203,34 @@ fn fb_local_method_var_shadows_parent_var() { @__foo__init = unnamed_addr constant %foo { i32 42 } - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %call = call i32 @foo__addToBar(%foo* %0, i16 42) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } - define i32 @foo__addToBar(%foo* %0, i16 %1) { + define i32 @foo__addToBar(ptr %0, i16 %1) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 - store i16 %1, i16* %in, align 2 + store i16 %1, ptr %in, align 2 %bar1 = alloca i32, align 4 - store i32 69, i32* %bar1, align 4 - store i32 0, i32* %foo.addToBar, align 4 - %load_in = load i16, i16* %in, align 2 + store i32 69, ptr %bar1, align 4 + store i32 0, ptr %foo.addToBar, align 4 + %load_in = load i16, ptr %in, align 2 %2 = sext i16 %load_in to i32 - %load_bar = load i32, i32* %bar1, align 4 + %load_bar = load i32, ptr %bar1, align 4 %tmpVar = add i32 %2, %load_bar - store i32 %tmpVar, i32* %bar1, align 4 - %load_bar2 = load i32, i32* %bar1, align 4 - store i32 %load_bar2, i32* %foo.addToBar, align 4 - %foo__addToBar_ret = load i32, i32* %foo.addToBar, align 4 + store i32 %tmpVar, ptr %bar1, align 4 + %load_bar2 = load i32, ptr %bar1, align 4 + store i32 %load_bar2, ptr %foo.addToBar, align 4 + %foo__addToBar_ret = load i32, ptr %foo.addToBar, align 4 ret i32 %foo__addToBar_ret } @@ -1239,18 +1238,17 @@ fn fb_local_method_var_shadows_parent_var() { entry: %fb = alloca %foo, align 8 %x = alloca i32, align 4 - %0 = bitcast %foo* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false) - store i32 0, i32* %x, align 4 - %call = call i32 @foo__addToBar(%foo* %fb, i16 3) - store i32 %call, i32* %x, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %x, align 4 + %call = call i32 @foo__addToBar(ptr %fb, i16 3) + store i32 %call, ptr %x, align 4 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#) } @@ -1292,37 +1290,37 @@ fn prog_method_called_locally() { @foo_instance = global %foo { i32 42 } - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %call = call i32 @foo__addToBar(%foo* %0, i16 42) + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } - define i32 @foo__addToBar(%foo* %0, i16 %1) { + define i32 @foo__addToBar(ptr %0, i16 %1) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 - store i16 %1, i16* %in, align 2 - store i32 0, i32* %foo.addToBar, align 4 - %load_in = load i16, i16* %in, align 2 + store i16 %1, ptr %in, align 2 + store i32 0, ptr %foo.addToBar, align 4 + %load_in = load i16, ptr %in, align 2 %2 = sext i16 %load_in to i32 - %load_bar = load i32, i32* %bar, align 4 + %load_bar = load i32, ptr %bar, align 4 %tmpVar = add i32 %2, %load_bar - store i32 %tmpVar, i32* %bar, align 4 - %load_bar1 = load i32, i32* %bar, align 4 - store i32 %load_bar1, i32* %foo.addToBar, align 4 - %foo__addToBar_ret = load i32, i32* %foo.addToBar, align 4 + store i32 %tmpVar, ptr %bar, align 4 + %load_bar1 = load i32, ptr %bar, align 4 + store i32 %load_bar1, ptr %foo.addToBar, align 4 + %foo__addToBar_ret = load i32, ptr %foo.addToBar, align 4 ret i32 %foo__addToBar_ret } define void @main() { entry: %x = alloca i32, align 4 - store i32 0, i32* %x, align 4 - %call = call i32 @foo__addToBar(%foo* @foo_instance, i16 3) - store i32 %call, i32* %x, align 4 + store i32 0, ptr %x, align 4 + %call = call i32 @foo__addToBar(ptr @foo_instance, i16 3) + store i32 %call, ptr %x, align 4 ret void } "#) @@ -1368,39 +1366,39 @@ fn prog_local_method_var_shadows_parent_var() { @foo_instance = global %foo { i32 42 } - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %call = call i32 @foo__addToBar(%foo* %0, i16 42) + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } - define i32 @foo__addToBar(%foo* %0, i16 %1) { + define i32 @foo__addToBar(ptr %0, i16 %1) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 - store i16 %1, i16* %in, align 2 + store i16 %1, ptr %in, align 2 %bar1 = alloca i32, align 4 - store i32 69, i32* %bar1, align 4 - store i32 0, i32* %foo.addToBar, align 4 - %load_in = load i16, i16* %in, align 2 + store i32 69, ptr %bar1, align 4 + store i32 0, ptr %foo.addToBar, align 4 + %load_in = load i16, ptr %in, align 2 %2 = sext i16 %load_in to i32 - %load_bar = load i32, i32* %bar1, align 4 + %load_bar = load i32, ptr %bar1, align 4 %tmpVar = add i32 %2, %load_bar - store i32 %tmpVar, i32* %bar1, align 4 - %load_bar2 = load i32, i32* %bar1, align 4 - store i32 %load_bar2, i32* %foo.addToBar, align 4 - %foo__addToBar_ret = load i32, i32* %foo.addToBar, align 4 + store i32 %tmpVar, ptr %bar1, align 4 + %load_bar2 = load i32, ptr %bar1, align 4 + store i32 %load_bar2, ptr %foo.addToBar, align 4 + %foo__addToBar_ret = load i32, ptr %foo.addToBar, align 4 ret i32 %foo__addToBar_ret } define void @main() { entry: %x = alloca i32, align 4 - store i32 0, i32* %x, align 4 - %call = call i32 @foo__addToBar(%foo* @foo_instance, i16 3) - store i32 %call, i32* %x, align 4 + store i32 0, ptr %x, align 4 + %call = call i32 @foo__addToBar(ptr @foo_instance, i16 3) + store i32 %call, ptr %x, align 4 ret void } "#) @@ -1623,44 +1621,44 @@ fn for_statement_with_binary_expressions() { @prg_instance = global %prg zeroinitializer - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %step = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %load_y = load i32, i32* %y, align 4 + %step = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %load_y = load i32, ptr %y, align 4 %tmpVar = add i32 %load_y, 1 - store i32 %tmpVar, i32* %x, align 4 - %load_step = load i32, i32* %step, align 4 + store i32 %tmpVar, ptr %x, align 4 + %load_step = load i32, ptr %step, align 4 %tmpVar1 = mul i32 %load_step, 3 %is_incrementing = icmp sgt i32 %tmpVar1, 0 br i1 %is_incrementing, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %load_z = load i32, i32* %z, align 4 + %load_z = load i32, ptr %z, align 4 %tmpVar2 = sub i32 %load_z, 2 - %1 = load i32, i32* %x, align 4 + %1 = load i32, ptr %x, align 4 %condition = icmp sle i32 %1, %tmpVar2 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %load_z3 = load i32, i32* %z, align 4 + %load_z3 = load i32, ptr %z, align 4 %tmpVar4 = sub i32 %load_z3, 2 - %2 = load i32, i32* %x, align 4 + %2 = load i32, ptr %x, align 4 %condition5 = icmp sge i32 %2, %tmpVar4 br i1 %condition5, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 br label %increment increment: ; preds = %loop - %3 = load i32, i32* %x, align 4 - %load_step6 = load i32, i32* %step, align 4 + %3 = load i32, ptr %x, align 4 + %load_step6 = load i32, ptr %step, align 4 %tmpVar7 = mul i32 %load_step6, 3 %next = add i32 %tmpVar7, %3 - store i32 %next, i32* %x, align 4 + store i32 %next, ptr %x, align 4 br i1 %is_incrementing, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle @@ -1692,44 +1690,44 @@ fn for_statement_type_casting() { entry: %a = alloca i8, align 1 %b = alloca i16, align 2 - store i8 0, i8* %a, align 1 - store i16 1, i16* %b, align 2 - store i8 0, i8* %a, align 1 - %load_b = load i16, i16* %b, align 2 + store i8 0, ptr %a, align 1 + store i16 1, ptr %b, align 2 + store i8 0, ptr %a, align 1 + %load_b = load i16, ptr %b, align 2 %0 = trunc i16 %load_b to i8 %1 = sext i8 %0 to i32 %is_incrementing = icmp sgt i32 %1, 0 br i1 %is_incrementing, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %2 = load i8, i8* %a, align 1 + %2 = load i8, ptr %a, align 1 %3 = zext i8 %2 to i32 %condition = icmp sle i32 %3, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %4 = load i8, i8* %a, align 1 + %4 = load i8, ptr %a, align 1 %5 = zext i8 %4 to i32 %condition1 = icmp sge i32 %5, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_b2 = load i16, i16* %b, align 2 + %load_b2 = load i16, ptr %b, align 2 %6 = sext i16 %load_b2 to i32 %tmpVar = mul i32 %6, 3 %7 = trunc i32 %tmpVar to i16 - store i16 %7, i16* %b, align 2 + store i16 %7, ptr %b, align 2 br label %increment increment: ; preds = %loop - %8 = load i8, i8* %a, align 1 - %load_b3 = load i16, i16* %b, align 2 + %8 = load i8, ptr %a, align 1 + %load_b3 = load i16, ptr %b, align 2 %9 = trunc i16 %load_b3 to i8 %10 = sext i8 %9 to i32 %11 = zext i8 %8 to i32 %next = add i32 %10, %11 %12 = trunc i32 %next to i8 - store i8 %12, i8* %a, align 1 + store i8 %12, ptr %a, align 1 br i1 %is_incrementing, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle @@ -3990,19 +3988,19 @@ fn variables_in_var_external_block_are_not_generated() { ret void } - define void @bar(%bar* %0) { + define void @bar(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } - define void @baz(%baz* %0) { + define void @baz(ptr %0) { entry: ret void } - define void @qux(%qux* %0) { + define void @qux(ptr %0) { entry: ret void } diff --git a/src/codegen/tests/debug_tests.rs b/src/codegen/tests/debug_tests.rs index d57a304aeaf..285a448ef5a 100644 --- a/src/codegen/tests/debug_tests.rs +++ b/src/codegen/tests/debug_tests.rs @@ -224,7 +224,7 @@ fn switch_case_debug_info() { target datalayout = "[filtered]" target triple = "[filtered]" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] define i32 @main() !dbg !4 { entry: @@ -232,14 +232,14 @@ fn switch_case_debug_info() { %x1 = alloca i16, align 2 %x2 = alloca i16, align 2 %x3 = alloca i16, align 2 - call void @llvm.dbg.declare(metadata i16* %x1, metadata !8, metadata !DIExpression()), !dbg !10 - store i16 0, i16* %x1, align 2 - call void @llvm.dbg.declare(metadata i16* %x2, metadata !11, metadata !DIExpression()), !dbg !12 - store i16 0, i16* %x2, align 2 - call void @llvm.dbg.declare(metadata i16* %x3, metadata !13, metadata !DIExpression()), !dbg !14 - store i16 0, i16* %x3, align 2 - call void @llvm.dbg.declare(metadata i32* %main, metadata !15, metadata !DIExpression()), !dbg !17 - store i32 0, i32* %main, align 4 + call void @llvm.dbg.declare(metadata ptr %x1, metadata !8, metadata !DIExpression()), !dbg !10 + store i16 0, ptr %x1, align 2 + call void @llvm.dbg.declare(metadata ptr %x2, metadata !11, metadata !DIExpression()), !dbg !12 + store i16 0, ptr %x2, align 2 + call void @llvm.dbg.declare(metadata ptr %x3, metadata !13, metadata !DIExpression()), !dbg !14 + store i16 0, ptr %x3, align 2 + call void @llvm.dbg.declare(metadata ptr %main, metadata !15, metadata !DIExpression()), !dbg !17 + store i32 0, ptr %main, align 4 br label %condition_check, !dbg !18 condition_check: ; preds = %continue2, %entry @@ -249,7 +249,7 @@ fn switch_case_debug_info() { br i1 false, label %condition_body, label %continue1, !dbg !19 continue: ; preds = %condition_body, %condition_check - %main_ret = load i32, i32* %main, align 4, !dbg !20 + %main_ret = load i32, ptr %main, align 4, !dbg !20 ret i32 %main_ret, !dbg !20 condition_body: ; preds = %while_body @@ -259,12 +259,12 @@ fn switch_case_debug_info() { br label %continue1, !dbg !21 continue1: ; preds = %buffer_block, %while_body - %load_x1 = load i16, i16* %x1, align 2, !dbg !22 + %load_x1 = load i16, ptr %x1, align 2, !dbg !22 %0 = sext i16 %load_x1 to i32, !dbg !22 %tmpVar = add i32 %0, 1, !dbg !22 %1 = trunc i32 %tmpVar to i16, !dbg !22 - store i16 %1, i16* %x1, align 2, !dbg !22 - %load_x13 = load i16, i16* %x1, align 2, !dbg !22 + store i16 %1, ptr %x1, align 2, !dbg !22 + %load_x13 = load i16, ptr %x1, align 2, !dbg !22 switch i16 %load_x13, label %else [ i16 1, label %case i16 2, label %case4 @@ -272,28 +272,28 @@ fn switch_case_debug_info() { ], !dbg !23 case: ; preds = %continue1 - store i16 1, i16* %x2, align 2, !dbg !24 + store i16 1, ptr %x2, align 2, !dbg !24 br label %continue2, !dbg !25 case4: ; preds = %continue1 - store i16 2, i16* %x2, align 2, !dbg !26 + store i16 2, ptr %x2, align 2, !dbg !26 br label %continue2, !dbg !25 case5: ; preds = %continue1 - store i16 3, i16* %x2, align 2, !dbg !27 + store i16 3, ptr %x2, align 2, !dbg !27 br label %continue2, !dbg !25 else: ; preds = %continue1 - store i16 0, i16* %x1, align 2, !dbg !28 - store i16 1, i16* %x2, align 2, !dbg !29 - store i16 2, i16* %x3, align 2, !dbg !30 + store i16 0, ptr %x1, align 2, !dbg !28 + store i16 1, ptr %x2, align 2, !dbg !29 + store i16 2, ptr %x3, align 2, !dbg !30 br label %continue2, !dbg !25 continue2: ; preds = %else, %case5, %case4, %case br label %condition_check, !dbg !18 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___Test() { @@ -301,7 +301,7 @@ fn switch_case_debug_info() { ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -357,80 +357,80 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_fb = type { void (%fb*)*, void (%fb*)* } - %fb = type { i32* } + %__vtable_fb = type { ptr, ptr } + %fb = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_fb__init = unnamed_addr constant %__vtable_fb zeroinitializer @__fb__init = unnamed_addr constant %fb zeroinitializer, !dbg !0 @__vtable_fb_instance = global %__vtable_fb zeroinitializer - define void @fb(%fb* %0) !dbg !14 { + define void @fb(ptr %0) !dbg !14 { entry: - call void @llvm.dbg.declare(metadata %fb* %0, metadata !18, metadata !DIExpression()), !dbg !19 - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !18, metadata !DIExpression()), !dbg !19 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void, !dbg !19 } - define void @fb__foo(%fb* %0) !dbg !20 { + define void @fb__foo(ptr %0) !dbg !20 { entry: - call void @llvm.dbg.declare(metadata %fb* %0, metadata !21, metadata !DIExpression()), !dbg !22 - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !21, metadata !DIExpression()), !dbg !22 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void, !dbg !22 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_fb(%__vtable_fb* %0) { + define void @__init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 - %deref = load %__vtable_fb*, %__vtable_fb** %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, %__vtable_fb* %deref, i32 0, i32 0 - store void (%fb*)* @fb, void (%fb*)** %__body, align 8 - %deref1 = load %__vtable_fb*, %__vtable_fb** %self, align 8 - %foo = getelementptr inbounds %__vtable_fb, %__vtable_fb* %deref1, i32 0, i32 1 - store void (%fb*)* @fb__foo, void (%fb*)** %foo, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @fb, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_fb, ptr %deref1, i32 0, i32 1 + store ptr @fb__foo, ptr %foo, align 8 ret void } - define void @__init_fb(%fb* %0) { + define void @__init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 - %deref = load %fb*, %fb** %self, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_fb* @__vtable_fb_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_fb(%fb* %0) { + define void @__user_init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_fb(%__vtable_fb* %0) { + define void @__user_init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) - call void @__user_init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) + call void @__init___vtable_fb(ptr @__vtable_fb_instance) + call void @__user_init___vtable_fb(ptr @__vtable_fb_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!10, !11} !llvm.dbg.cu = !{!12} @@ -494,67 +494,67 @@ fn action_with_var_temp() { %PLC_PRG = type {} - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @PLC_PRG_instance = global %PLC_PRG zeroinitializer, !dbg !0 define i32 @main() !dbg !9 { entry: %main = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %main, metadata !12, metadata !DIExpression()), !dbg !14 - store i32 0, i32* %main, align 4 - call void @PLC_PRG(%PLC_PRG* @PLC_PRG_instance), !dbg !15 - call void @PLC_PRG__act(%PLC_PRG* @PLC_PRG_instance), !dbg !16 - %main_ret = load i32, i32* %main, align 4, !dbg !17 + call void @llvm.dbg.declare(metadata ptr %main, metadata !12, metadata !DIExpression()), !dbg !14 + store i32 0, ptr %main, align 4 + call void @PLC_PRG(ptr @PLC_PRG_instance), !dbg !15 + call void @PLC_PRG__act(ptr @PLC_PRG_instance), !dbg !16 + %main_ret = load i32, ptr %main, align 4, !dbg !17 ret i32 %main_ret, !dbg !17 } - define void @PLC_PRG(%PLC_PRG* %0) !dbg !18 { + define void @PLC_PRG(ptr %0) !dbg !18 { entry: - call void @llvm.dbg.declare(metadata %PLC_PRG* %0, metadata !21, metadata !DIExpression()), !dbg !22 + call void @llvm.dbg.declare(metadata ptr %0, metadata !21, metadata !DIExpression()), !dbg !22 %x = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %x, metadata !23, metadata !DIExpression()), !dbg !24 - store i32 0, i32* %x, align 4 - store i32 0, i32* %x, align 4, !dbg !22 + call void @llvm.dbg.declare(metadata ptr %x, metadata !23, metadata !DIExpression()), !dbg !24 + store i32 0, ptr %x, align 4 + store i32 0, ptr %x, align 4, !dbg !22 ret void, !dbg !25 } - define void @PLC_PRG__act(%PLC_PRG* %0) !dbg !26 { + define void @PLC_PRG__act(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata %PLC_PRG* %0, metadata !27, metadata !DIExpression()), !dbg !28 + call void @llvm.dbg.declare(metadata ptr %0, metadata !27, metadata !DIExpression()), !dbg !28 %x = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %x, metadata !29, metadata !DIExpression()), !dbg !30 - store i32 0, i32* %x, align 4 - %load_x = load i32, i32* %x, align 4, !dbg !28 + call void @llvm.dbg.declare(metadata ptr %x, metadata !29, metadata !DIExpression()), !dbg !30 + store i32 0, ptr %x, align 4 + %load_x = load i32, ptr %x, align 4, !dbg !28 %tmpVar = add i32 %load_x, 1, !dbg !28 - store i32 %tmpVar, i32* %x, align 4, !dbg !28 + store i32 %tmpVar, ptr %x, align 4, !dbg !28 ret void, !dbg !31 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_plc_prg(%PLC_PRG* %0) { + define void @__init_plc_prg(ptr %0) { entry: - %self = alloca %PLC_PRG*, align 8 - store %PLC_PRG* %0, %PLC_PRG** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_PLC_PRG(%PLC_PRG* %0) { + define void @__user_init_PLC_PRG(ptr %0) { entry: - %self = alloca %PLC_PRG*, align 8 - store %PLC_PRG* %0, %PLC_PRG** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_plc_prg(%PLC_PRG* @PLC_PRG_instance) - call void @__user_init_PLC_PRG(%PLC_PRG* @PLC_PRG_instance) + call void @__init_plc_prg(ptr @PLC_PRG_instance) + call void @__user_init_PLC_PRG(ptr @PLC_PRG_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -645,7 +645,7 @@ END_FUNCTION ", ); - filtered_assert_snapshot!(result, @r###" + filtered_assert_snapshot!(result, @r#" ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" @@ -657,7 +657,7 @@ END_FUNCTION @__struct___init = unnamed_addr constant %struct_ { %inner { [81 x i8] c"Hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i8 1, float 0x400921CAC0000000, [3 x [81 x i8]] [[81 x i8] c"aaaa\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [81 x i8] c"bbbb\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [81 x i8] c"cccc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], i16 42 }, [3 x %inner] zeroinitializer, [81 x i8] c"Hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i8 1, float 0x400921CAC0000000, [3 x [81 x i8]] [[81 x i8] c"aa\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [81 x i8] c"bb\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [81 x i8] c"cc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], i16 42 }, !dbg !0 @__inner__init = unnamed_addr constant %inner { [81 x i8] c"Hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i8 1, float 0x400921CAC0000000, [3 x [81 x i8]] [[81 x i8] c"aaaa\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [81 x i8] c"bbbb\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [81 x i8] c"cccc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], i16 42 }, !dbg !32 @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"Hello\00" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] define void @main() !dbg !39 { entry: @@ -666,145 +666,126 @@ END_FUNCTION %b = alloca i8, align 1 %arr = alloca [3 x [81 x i8]], align 1 %i = alloca i16, align 2 - call void @llvm.dbg.declare(metadata %struct_* %st, metadata !43, metadata !DIExpression()), !dbg !44 - %0 = bitcast %struct_* %st to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%struct_, %struct_* @__struct___init, i32 0, i32 0, i32 0, i32 0), i64 ptrtoint (%struct_* getelementptr (%struct_, %struct_* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata [81 x i8]* %s, metadata !45, metadata !DIExpression()), !dbg !46 - %1 = bitcast [81 x i8]* %s to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata i8* %b, metadata !47, metadata !DIExpression()), !dbg !48 - store i8 0, i8* %b, align 1 - call void @llvm.dbg.declare(metadata [3 x [81 x i8]]* %arr, metadata !49, metadata !DIExpression()), !dbg !50 - %2 = bitcast [3 x [81 x i8]]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([3 x [81 x i8]]* getelementptr ([3 x [81 x i8]], [3 x [81 x i8]]* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata i16* %i, metadata !51, metadata !DIExpression()), !dbg !52 - store i16 0, i16* %i, align 2 - call void @__init_struct_(%struct_* %st), !dbg !53 - call void @__user_init_struct_(%struct_* %st), !dbg !53 - %s1 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 2, !dbg !54 - %3 = bitcast [81 x i8]* %s to i8*, !dbg !54 - %4 = bitcast [81 x i8]* %s1 to i8*, !dbg !54 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %4, i32 80, i1 false), !dbg !54 - %inner = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 0, !dbg !55 - %s2 = getelementptr inbounds %inner, %inner* %inner, i32 0, i32 0, !dbg !55 - %5 = bitcast [81 x i8]* %s to i8*, !dbg !55 - %6 = bitcast [81 x i8]* %s2 to i8*, !dbg !55 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %5, i8* align 1 %6, i32 80, i1 false), !dbg !55 - %b3 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 3, !dbg !56 - %load_b = load i8, i8* %b3, align 1, !dbg !56 - store i8 %load_b, i8* %b, align 1, !dbg !56 - %inner4 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 0, !dbg !57 - %b5 = getelementptr inbounds %inner, %inner* %inner4, i32 0, i32 1, !dbg !57 - %load_b6 = load i8, i8* %b5, align 1, !dbg !57 - store i8 %load_b6, i8* %b, align 1, !dbg !57 - %arr7 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 5, !dbg !58 - %7 = bitcast [3 x [81 x i8]]* %arr to i8*, !dbg !58 - %8 = bitcast [3 x [81 x i8]]* %arr7 to i8*, !dbg !58 - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %7, i8* align 1 %8, i64 ptrtoint ([3 x [81 x i8]]* getelementptr ([3 x [81 x i8]], [3 x [81 x i8]]* null, i32 1) to i64), i1 false), !dbg !58 - %inner8 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 0, !dbg !59 - %arr9 = getelementptr inbounds %inner, %inner* %inner8, i32 0, i32 3, !dbg !59 - %9 = bitcast [3 x [81 x i8]]* %arr to i8*, !dbg !59 - %10 = bitcast [3 x [81 x i8]]* %arr9 to i8*, !dbg !59 - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %9, i8* align 1 %10, i64 ptrtoint ([3 x [81 x i8]]* getelementptr ([3 x [81 x i8]], [3 x [81 x i8]]* null, i32 1) to i64), i1 false), !dbg !59 - %i10 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 6, !dbg !60 - %load_i = load i16, i16* %i10, align 2, !dbg !60 - store i16 %load_i, i16* %i, align 2, !dbg !60 - %inner11 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 0, !dbg !61 - %i12 = getelementptr inbounds %inner, %inner* %inner11, i32 0, i32 4, !dbg !61 - %load_i13 = load i16, i16* %i12, align 2, !dbg !61 - store i16 %load_i13, i16* %i, align 2, !dbg !61 - %tmpVar = getelementptr inbounds [3 x [81 x i8]], [3 x [81 x i8]]* %arr, i32 0, i32 0, !dbg !62 - %arr14 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 5, !dbg !62 - %tmpVar15 = getelementptr inbounds [3 x [81 x i8]], [3 x [81 x i8]]* %arr14, i32 0, i32 0, !dbg !62 - %11 = bitcast [81 x i8]* %tmpVar to i8*, !dbg !62 - %12 = bitcast [81 x i8]* %tmpVar15 to i8*, !dbg !62 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %11, i8* align 1 %12, i32 80, i1 false), !dbg !62 - %tmpVar16 = getelementptr inbounds [3 x [81 x i8]], [3 x [81 x i8]]* %arr, i32 0, i32 1, !dbg !63 - %inner17 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 0, !dbg !63 - %arr18 = getelementptr inbounds %inner, %inner* %inner17, i32 0, i32 3, !dbg !63 - %tmpVar19 = getelementptr inbounds [3 x [81 x i8]], [3 x [81 x i8]]* %arr18, i32 0, i32 1, !dbg !63 - %13 = bitcast [81 x i8]* %tmpVar16 to i8*, !dbg !63 - %14 = bitcast [81 x i8]* %tmpVar19 to i8*, !dbg !63 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %13, i8* align 1 %14, i32 80, i1 false), !dbg !63 - %tmpVar20 = getelementptr inbounds [3 x [81 x i8]], [3 x [81 x i8]]* %arr, i32 0, i32 2, !dbg !64 - %inner21 = getelementptr inbounds %struct_, %struct_* %st, i32 0, i32 0, !dbg !64 - %arr22 = getelementptr inbounds %inner, %inner* %inner21, i32 0, i32 3, !dbg !64 - %tmpVar23 = getelementptr inbounds [3 x [81 x i8]], [3 x [81 x i8]]* %arr22, i32 0, i32 2, !dbg !64 - %15 = bitcast [81 x i8]* %tmpVar20 to i8*, !dbg !64 - %16 = bitcast [81 x i8]* %tmpVar23 to i8*, !dbg !64 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %15, i8* align 1 %16, i32 80, i1 false), !dbg !64 + call void @llvm.dbg.declare(metadata ptr %st, metadata !43, metadata !DIExpression()), !dbg !44 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %st, ptr align 1 @__struct___init, i64 ptrtoint (ptr getelementptr (%struct_, ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %s, metadata !45, metadata !DIExpression()), !dbg !46 + call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %b, metadata !47, metadata !DIExpression()), !dbg !48 + store i8 0, ptr %b, align 1 + call void @llvm.dbg.declare(metadata ptr %arr, metadata !49, metadata !DIExpression()), !dbg !50 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([3 x [81 x i8]], ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %i, metadata !51, metadata !DIExpression()), !dbg !52 + store i16 0, ptr %i, align 2 + call void @__init_struct_(ptr %st), !dbg !53 + call void @__user_init_struct_(ptr %st), !dbg !53 + %s1 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 2, !dbg !54 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 %s1, i32 80, i1 false), !dbg !54 + %inner = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !55 + %s2 = getelementptr inbounds %inner, ptr %inner, i32 0, i32 0, !dbg !55 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 %s2, i32 80, i1 false), !dbg !55 + %b3 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 3, !dbg !56 + %load_b = load i8, ptr %b3, align 1, !dbg !56 + store i8 %load_b, ptr %b, align 1, !dbg !56 + %inner4 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !57 + %b5 = getelementptr inbounds %inner, ptr %inner4, i32 0, i32 1, !dbg !57 + %load_b6 = load i8, ptr %b5, align 1, !dbg !57 + store i8 %load_b6, ptr %b, align 1, !dbg !57 + %arr7 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 5, !dbg !58 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr, ptr align 1 %arr7, i64 ptrtoint (ptr getelementptr ([3 x [81 x i8]], ptr null, i32 1) to i64), i1 false), !dbg !58 + %inner8 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !59 + %arr9 = getelementptr inbounds %inner, ptr %inner8, i32 0, i32 3, !dbg !59 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr, ptr align 1 %arr9, i64 ptrtoint (ptr getelementptr ([3 x [81 x i8]], ptr null, i32 1) to i64), i1 false), !dbg !59 + %i10 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 6, !dbg !60 + %load_i = load i16, ptr %i10, align 2, !dbg !60 + store i16 %load_i, ptr %i, align 2, !dbg !60 + %inner11 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !61 + %i12 = getelementptr inbounds %inner, ptr %inner11, i32 0, i32 4, !dbg !61 + %load_i13 = load i16, ptr %i12, align 2, !dbg !61 + store i16 %load_i13, ptr %i, align 2, !dbg !61 + %tmpVar = getelementptr inbounds [3 x [81 x i8]], ptr %arr, i32 0, i32 0, !dbg !62 + %arr14 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 5, !dbg !62 + %tmpVar15 = getelementptr inbounds [3 x [81 x i8]], ptr %arr14, i32 0, i32 0, !dbg !62 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 %tmpVar15, i32 80, i1 false), !dbg !62 + %tmpVar16 = getelementptr inbounds [3 x [81 x i8]], ptr %arr, i32 0, i32 1, !dbg !63 + %inner17 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !63 + %arr18 = getelementptr inbounds %inner, ptr %inner17, i32 0, i32 3, !dbg !63 + %tmpVar19 = getelementptr inbounds [3 x [81 x i8]], ptr %arr18, i32 0, i32 1, !dbg !63 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar16, ptr align 1 %tmpVar19, i32 80, i1 false), !dbg !63 + %tmpVar20 = getelementptr inbounds [3 x [81 x i8]], ptr %arr, i32 0, i32 2, !dbg !64 + %inner21 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !64 + %arr22 = getelementptr inbounds %inner, ptr %inner21, i32 0, i32 3, !dbg !64 + %tmpVar23 = getelementptr inbounds [3 x [81 x i8]], ptr %arr22, i32 0, i32 2, !dbg !64 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar20, ptr align 1 %tmpVar23, i32 80, i1 false), !dbg !64 ret void, !dbg !65 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #2 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 - define void @__init_struct_(%struct_* %0) { + define void @__init_struct_(ptr %0) { entry: - %self = alloca %struct_*, align 8 - store %struct_* %0, %struct_** %self, align 8 - %deref = load %struct_*, %struct_** %self, align 8 - %inner = getelementptr inbounds %struct_, %struct_* %deref, i32 0, i32 0 - call void @__init_inner(%inner* %inner) - %deref1 = load %struct_*, %struct_** %self, align 8 - %s = getelementptr inbounds %struct_, %struct_* %deref1, i32 0, i32 2 - %1 = bitcast [81 x i8]* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %deref2 = load %struct_*, %struct_** %self, align 8 - %b = getelementptr inbounds %struct_, %struct_* %deref2, i32 0, i32 3 - store i8 1, i8* %b, align 1 - %deref3 = load %struct_*, %struct_** %self, align 8 - %r = getelementptr inbounds %struct_, %struct_* %deref3, i32 0, i32 4 - store float 0x400921CAC0000000, float* %r, align 4 - %deref4 = load %struct_*, %struct_** %self, align 8 - %i = getelementptr inbounds %struct_, %struct_* %deref4, i32 0, i32 6 - store i16 42, i16* %i, align 2 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %inner = getelementptr inbounds %struct_, ptr %deref, i32 0, i32 0 + call void @__init_inner(ptr %inner) + %deref1 = load ptr, ptr %self, align 8 + %s = getelementptr inbounds %struct_, ptr %deref1, i32 0, i32 2 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false) + %deref2 = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %struct_, ptr %deref2, i32 0, i32 3 + store i8 1, ptr %b, align 1 + %deref3 = load ptr, ptr %self, align 8 + %r = getelementptr inbounds %struct_, ptr %deref3, i32 0, i32 4 + store float 0x400921CAC0000000, ptr %r, align 4 + %deref4 = load ptr, ptr %self, align 8 + %i = getelementptr inbounds %struct_, ptr %deref4, i32 0, i32 6 + store i16 42, ptr %i, align 2 ret void } - define void @__init_inner(%inner* %0) { + define void @__init_inner(ptr %0) { entry: - %self = alloca %inner*, align 8 - store %inner* %0, %inner** %self, align 8 - %deref = load %inner*, %inner** %self, align 8 - %s = getelementptr inbounds %inner, %inner* %deref, i32 0, i32 0 - %1 = bitcast [81 x i8]* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %deref1 = load %inner*, %inner** %self, align 8 - %b = getelementptr inbounds %inner, %inner* %deref1, i32 0, i32 1 - store i8 1, i8* %b, align 1 - %deref2 = load %inner*, %inner** %self, align 8 - %r = getelementptr inbounds %inner, %inner* %deref2, i32 0, i32 2 - store float 0x400921CAC0000000, float* %r, align 4 - %deref3 = load %inner*, %inner** %self, align 8 - %i = getelementptr inbounds %inner, %inner* %deref3, i32 0, i32 4 - store i16 42, i16* %i, align 2 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %s = getelementptr inbounds %inner, ptr %deref, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false) + %deref1 = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %inner, ptr %deref1, i32 0, i32 1 + store i8 1, ptr %b, align 1 + %deref2 = load ptr, ptr %self, align 8 + %r = getelementptr inbounds %inner, ptr %deref2, i32 0, i32 2 + store float 0x400921CAC0000000, ptr %r, align 4 + %deref3 = load ptr, ptr %self, align 8 + %i = getelementptr inbounds %inner, ptr %deref3, i32 0, i32 4 + store i16 42, ptr %i, align 2 ret void } - define void @__user_init_inner(%inner* %0) { + define void @__user_init_inner(ptr %0) { entry: - %self = alloca %inner*, align 8 - store %inner* %0, %inner** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_struct_(%struct_* %0) { + define void @__user_init_struct_(ptr %0) { entry: - %self = alloca %struct_*, align 8 - store %struct_* %0, %struct_** %self, align 8 - %deref = load %struct_*, %struct_** %self, align 8 - %inner = getelementptr inbounds %struct_, %struct_* %deref, i32 0, i32 0 - call void @__user_init_inner(%inner* %inner) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %inner = getelementptr inbounds %struct_, ptr %deref, i32 0, i32 0 + call void @__user_init_inner(ptr %inner) ret void } @@ -813,9 +794,9 @@ END_FUNCTION ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn } - attributes #2 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #2 = { argmemonly nocallback nofree nounwind willreturn writeonly } !llvm.module.flags = !{!35, !36} !llvm.dbg.cu = !{!37} @@ -886,7 +867,7 @@ END_FUNCTION !63 = !DILocation(line: 42, column: 4, scope: !39) !64 = !DILocation(line: 43, column: 4, scope: !39) !65 = !DILocation(line: 45, scope: !39) - "###); + "#); } #[test] @@ -918,7 +899,7 @@ fn constants_are_tagged_as_such() { ", ); - filtered_assert_snapshot!(result, @r###" + filtered_assert_snapshot!(result, @r#" ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" @@ -929,17 +910,17 @@ fn constants_are_tagged_as_such() { @x = unnamed_addr constant i32 0, !dbg !0 @s = unnamed_addr constant [81 x i8] zeroinitializer, !dbg !5 - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer, !dbg !13 @__foo__init = unnamed_addr constant %foo zeroinitializer, !dbg !20 @f = unnamed_addr constant %foo zeroinitializer, !dbg !26 - define void @prog(%prog* %0) !dbg !32 { + define void @prog(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata %prog* %0, metadata !36, metadata !DIExpression()), !dbg !37 - %a = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %b = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %c = getelementptr inbounds %prog, %prog* %0, i32 0, i32 2 + call void @llvm.dbg.declare(metadata ptr %0, metadata !36, metadata !DIExpression()), !dbg !37 + %a = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 ret void, !dbg !37 } @@ -947,55 +928,55 @@ fn constants_are_tagged_as_such() { entry: %bar = alloca i32, align 4 %d = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %d, metadata !41, metadata !DIExpression()), !dbg !42 - store i32 42, i32* %d, align 4 - call void @llvm.dbg.declare(metadata i32* %bar, metadata !43, metadata !DIExpression()), !dbg !44 - store i32 0, i32* %bar, align 4 - %bar_ret = load i32, i32* %bar, align 4, !dbg !45 + call void @llvm.dbg.declare(metadata ptr %d, metadata !41, metadata !DIExpression()), !dbg !42 + store i32 42, ptr %d, align 4 + call void @llvm.dbg.declare(metadata ptr %bar, metadata !43, metadata !DIExpression()), !dbg !44 + store i32 0, ptr %bar, align 4 + %bar_ret = load i32, ptr %bar, align 4, !dbg !45 ret i32 %bar_ret, !dbg !45 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init_foo(%foo* @f) - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init_foo(%foo* @f) + call void @__init_prog(ptr @prog_instance) + call void @__init_foo(ptr @f) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init_foo(ptr @f) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -1046,7 +1027,7 @@ fn constants_are_tagged_as_such() { !43 = !DILocalVariable(name: "bar", scope: !38, file: !2, line: 19, type: !4, align: 32) !44 = !DILocation(line: 19, column: 17, scope: !38) !45 = !DILocation(line: 23, column: 8, scope: !38) - "###); + "#); } #[test] @@ -1074,24 +1055,24 @@ fn test_debug_info_regular_pointer_types() { %myStruct = type { i32, i8 } - @basic_ptr = global i32* null, !dbg !0 - @array_ptr = global [11 x i32]* null, !dbg !6 - @struct_ptr = global %myStruct* null, !dbg !13 - @string_ptr = global [81 x i8]* null, !dbg !22 + @basic_ptr = global ptr null, !dbg !0 + @array_ptr = global ptr null, !dbg !6 + @struct_ptr = global ptr null, !dbg !13 + @string_ptr = global ptr null, !dbg !22 @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !31 - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } @@ -1174,63 +1155,63 @@ fn test_debug_info_auto_deref_parameters() { target datalayout = "[filtered]" target triple = "[filtered]" - %test_with_ref_params = type { [81 x i8]*, [6 x i32]*, i32*, %myStruct*, i32* } + %test_with_ref_params = type { ptr, ptr, ptr, ptr, ptr } %myStruct = type { i32, i8 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @test_with_ref_params_instance = global %test_with_ref_params zeroinitializer, !dbg !0 @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !34 - define void @test_with_ref_params(%test_with_ref_params* %0) !dbg !41 { + define void @test_with_ref_params(ptr %0) !dbg !41 { entry: - call void @llvm.dbg.declare(metadata %test_with_ref_params* %0, metadata !45, metadata !DIExpression()), !dbg !46 - %input_ref = getelementptr inbounds %test_with_ref_params, %test_with_ref_params* %0, i32 0, i32 0 - %array_ref = getelementptr inbounds %test_with_ref_params, %test_with_ref_params* %0, i32 0, i32 1 - %inout_value = getelementptr inbounds %test_with_ref_params, %test_with_ref_params* %0, i32 0, i32 2 - %inout_struct = getelementptr inbounds %test_with_ref_params, %test_with_ref_params* %0, i32 0, i32 3 - %local_ref = getelementptr inbounds %test_with_ref_params, %test_with_ref_params* %0, i32 0, i32 4 + call void @llvm.dbg.declare(metadata ptr %0, metadata !45, metadata !DIExpression()), !dbg !46 + %input_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 0 + %array_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 1 + %inout_value = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 2 + %inout_struct = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 3 + %local_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 4 ret void, !dbg !46 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_test_with_ref_params(%test_with_ref_params* %0) { + define void @__init_test_with_ref_params(ptr %0) { entry: - %self = alloca %test_with_ref_params*, align 8 - store %test_with_ref_params* %0, %test_with_ref_params** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_test_with_ref_params(%test_with_ref_params* %0) { + define void @__user_init_test_with_ref_params(ptr %0) { entry: - %self = alloca %test_with_ref_params*, align 8 - store %test_with_ref_params* %0, %test_with_ref_params** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_test_with_ref_params(%test_with_ref_params* @test_with_ref_params_instance) - call void @__user_init_test_with_ref_params(%test_with_ref_params* @test_with_ref_params_instance) + call void @__init_test_with_ref_params(ptr @test_with_ref_params_instance) + call void @__user_init_test_with_ref_params(ptr @test_with_ref_params_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!37, !38} !llvm.dbg.cu = !{!39} @@ -1303,7 +1284,7 @@ fn test_debug_info_auto_deref_alias_pointers() { END_STRUCT END_TYPE "#, ); - filtered_assert_snapshot!(codegen, @r###" + filtered_assert_snapshot!(codegen, @r#" ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" @@ -1311,33 +1292,33 @@ fn test_debug_info_auto_deref_alias_pointers() { %myStruct = type { i32, i8 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !0 @global_struct = global %myStruct zeroinitializer, !dbg !10 @global_var = global i32 42, !dbg !12 - @alias_int = global i32* null, !dbg !14 - @alias_struct = global %myStruct* null, !dbg !18 + @alias_int = global ptr null, !dbg !14 + @alias_struct = global ptr null, !dbg !18 - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_mystruct(%myStruct* @global_struct) - store i32* @global_var, i32** @alias_int, align 8 - store %myStruct* @global_struct, %myStruct** @alias_struct, align 8 - call void @__user_init_myStruct(%myStruct* @global_struct) + call void @__init_mystruct(ptr @global_struct) + store ptr @global_var, ptr @alias_int, align 8 + store ptr @global_struct, ptr @alias_struct, align 8 + call void @__user_init_myStruct(ptr @global_struct) ret void } @@ -1370,7 +1351,7 @@ fn test_debug_info_auto_deref_alias_pointers() { !23 = !{i32 2, !"Debug Info Version", i32 3} !24 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !25, splitDebugInlining: false) !25 = !{!12, !14, !10, !0, !18} - "###) + "#) } #[test] @@ -1402,49 +1383,49 @@ fn test_debug_info_mixed_pointer_types() { target datalayout = "[filtered]" target triple = "[filtered]" - %mixed_ptr = type { [81 x i8]*, i32*, i8*, i8* } + %mixed_ptr = type { ptr, ptr, ptr, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @mixed_ptr_instance = global %mixed_ptr zeroinitializer, !dbg !0 - @regular_ptr = global i32* null, !dbg !24 - @alias_var = global i32** null, !dbg !28 + @regular_ptr = global ptr null, !dbg !24 + @alias_var = global ptr null, !dbg !28 - define void @mixed_ptr(%mixed_ptr* %0) !dbg !38 { + define void @mixed_ptr(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata %mixed_ptr* %0, metadata !42, metadata !DIExpression()), !dbg !43 - %ref_param = getelementptr inbounds %mixed_ptr, %mixed_ptr* %0, i32 0, i32 0 - %inout_param = getelementptr inbounds %mixed_ptr, %mixed_ptr* %0, i32 0, i32 1 - %local_ptr = getelementptr inbounds %mixed_ptr, %mixed_ptr* %0, i32 0, i32 2 - %local_ref = getelementptr inbounds %mixed_ptr, %mixed_ptr* %0, i32 0, i32 3 + call void @llvm.dbg.declare(metadata ptr %0, metadata !42, metadata !DIExpression()), !dbg !43 + %ref_param = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 0 + %inout_param = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 1 + %local_ptr = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 2 + %local_ref = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 3 ret void, !dbg !43 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_mixed_ptr(%mixed_ptr* %0) { + define void @__init_mixed_ptr(ptr %0) { entry: - %self = alloca %mixed_ptr*, align 8 - store %mixed_ptr* %0, %mixed_ptr** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_mixed_ptr(%mixed_ptr* %0) { + define void @__user_init_mixed_ptr(ptr %0) { entry: - %self = alloca %mixed_ptr*, align 8 - store %mixed_ptr* %0, %mixed_ptr** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_mixed_ptr(%mixed_ptr* @mixed_ptr_instance) - store i32** @regular_ptr, i32*** @alias_var, align 8 - call void @__user_init_mixed_ptr(%mixed_ptr* @mixed_ptr_instance) + call void @__init_mixed_ptr(ptr @mixed_ptr_instance) + store ptr @regular_ptr, ptr @alias_var, align 8 + call void @__user_init_mixed_ptr(ptr @mixed_ptr_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1529,65 +1510,65 @@ fn test_debug_info_auto_deref_reference_to_pointers() { target datalayout = "[filtered]" target triple = "[filtered]" + %test_with_reference_params = type { ptr, ptr, ptr } %myStruct = type { i32, i8 } - %test_with_reference_params = type { i32*, [6 x i8]*, %myStruct* } - @basic_reference = global i32* null, !dbg !0 - @array_reference = global [11 x i32]* null, !dbg !6 - @struct_reference = global %myStruct* null, !dbg !13 - @string_reference = global [81 x i8]* null, !dbg !22 - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @basic_reference = global ptr null, !dbg !0 + @array_reference = global ptr null, !dbg !6 + @struct_reference = global ptr null, !dbg !13 + @string_reference = global ptr null, !dbg !22 + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @test_with_reference_params_instance = global %test_with_reference_params zeroinitializer, !dbg !31 @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !47 - define void @test_with_reference_params(%test_with_reference_params* %0) !dbg !54 { + define void @test_with_reference_params(ptr %0) !dbg !54 { entry: - call void @llvm.dbg.declare(metadata %test_with_reference_params* %0, metadata !58, metadata !DIExpression()), !dbg !59 - %ref_param = getelementptr inbounds %test_with_reference_params, %test_with_reference_params* %0, i32 0, i32 0 - %array_ref_param = getelementptr inbounds %test_with_reference_params, %test_with_reference_params* %0, i32 0, i32 1 - %local_reference = getelementptr inbounds %test_with_reference_params, %test_with_reference_params* %0, i32 0, i32 2 + call void @llvm.dbg.declare(metadata ptr %0, metadata !58, metadata !DIExpression()), !dbg !59 + %ref_param = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 0 + %array_ref_param = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 1 + %local_reference = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 2 ret void, !dbg !59 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_test_with_reference_params(%test_with_reference_params* %0) { + define void @__init_test_with_reference_params(ptr %0) { entry: - %self = alloca %test_with_reference_params*, align 8 - store %test_with_reference_params* %0, %test_with_reference_params** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_test_with_reference_params(%test_with_reference_params* %0) { + define void @__user_init_test_with_reference_params(ptr %0) { entry: - %self = alloca %test_with_reference_params*, align 8 - store %test_with_reference_params* %0, %test_with_reference_params** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_test_with_reference_params(%test_with_reference_params* @test_with_reference_params_instance) - call void @__user_init_test_with_reference_params(%test_with_reference_params* @test_with_reference_params_instance) + call void @__init_test_with_reference_params(ptr @test_with_reference_params_instance) + call void @__user_init_test_with_reference_params(ptr @test_with_reference_params_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!50, !51} !llvm.dbg.cu = !{!52} @@ -1678,24 +1659,24 @@ fn range_datatype_debug() { target datalayout = "[filtered]" target triple = "[filtered]" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] define i32 @main() !dbg !4 { entry: %main = alloca i32, align 4 %r = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %r, metadata !8, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %r, align 4 - call void @llvm.dbg.declare(metadata i32* %main, metadata !12, metadata !DIExpression()), !dbg !13 - store i32 0, i32* %main, align 4 - store i32 50, i32* %r, align 4, !dbg !14 - %load_r = load i32, i32* %r, align 4, !dbg !15 - store i32 %load_r, i32* %main, align 4, !dbg !15 - %main_ret = load i32, i32* %main, align 4, !dbg !16 + call void @llvm.dbg.declare(metadata ptr %r, metadata !8, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %r, align 4 + call void @llvm.dbg.declare(metadata ptr %main, metadata !12, metadata !DIExpression()), !dbg !13 + store i32 0, ptr %main, align 4 + store i32 50, ptr %r, align 4, !dbg !14 + %load_r = load i32, ptr %r, align 4, !dbg !15 + store i32 %load_r, ptr %main, align 4, !dbg !15 + %main_ret = load i32, ptr %main, align 4, !dbg !16 ret i32 %main_ret, !dbg !16 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___Test() { @@ -1703,7 +1684,7 @@ fn range_datatype_debug() { ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -1756,24 +1737,24 @@ fn range_datatype_reference_expr_bounds_debug() { target triple = "[filtered]" @ZERO = unnamed_addr constant i32 0, !dbg !0 - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] define i32 @main() !dbg !9 { entry: %main = alloca i32, align 4 %r = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %r, metadata !13, metadata !DIExpression()), !dbg !15 - store i32 0, i32* %r, align 4 - call void @llvm.dbg.declare(metadata i32* %main, metadata !16, metadata !DIExpression()), !dbg !17 - store i32 0, i32* %main, align 4 - store i32 50, i32* %r, align 4, !dbg !18 - %load_r = load i32, i32* %r, align 4, !dbg !19 - store i32 %load_r, i32* %main, align 4, !dbg !19 - %main_ret = load i32, i32* %main, align 4, !dbg !20 + call void @llvm.dbg.declare(metadata ptr %r, metadata !13, metadata !DIExpression()), !dbg !15 + store i32 0, ptr %r, align 4 + call void @llvm.dbg.declare(metadata ptr %main, metadata !16, metadata !DIExpression()), !dbg !17 + store i32 0, ptr %main, align 4 + store i32 50, ptr %r, align 4, !dbg !18 + %load_r = load i32, ptr %r, align 4, !dbg !19 + store i32 %load_r, ptr %main, align 4, !dbg !19 + %main_ret = load i32, ptr %main, align 4, !dbg !20 ret i32 %main_ret, !dbg !20 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___Test() { @@ -1781,7 +1762,7 @@ fn range_datatype_reference_expr_bounds_debug() { ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -1836,42 +1817,42 @@ fn range_datatype_fqn_reference_bounds_debug() { %prog = type { i32, i32 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog { i32 10, i32 0 }, !dbg !0 - define void @prog(%prog* %0) !dbg !14 { + define void @prog(ptr %0) !dbg !14 { entry: - call void @llvm.dbg.declare(metadata %prog* %0, metadata !18, metadata !DIExpression()), !dbg !19 - %TEN = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %r = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 + call void @llvm.dbg.declare(metadata ptr %0, metadata !18, metadata !DIExpression()), !dbg !19 + %TEN = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %r = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 ret void, !dbg !19 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__user_init_prog(%prog* @prog_instance) + call void @__init_prog(ptr @prog_instance) + call void @__user_init_prog(ptr @prog_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!10, !11} !llvm.dbg.cu = !{!12} @@ -1927,44 +1908,44 @@ fn range_datatype_debug_alias_reused() { %prog = type { i32, i32, i32, i32 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog { i32 10, i32 0, i32 0, i32 0 }, !dbg !0 - define void @prog(%prog* %0) !dbg !16 { + define void @prog(ptr %0) !dbg !16 { entry: - call void @llvm.dbg.declare(metadata %prog* %0, metadata !20, metadata !DIExpression()), !dbg !21 - %ZERO = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %u = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %v = getelementptr inbounds %prog, %prog* %0, i32 0, i32 2 - %w = getelementptr inbounds %prog, %prog* %0, i32 0, i32 3 + call void @llvm.dbg.declare(metadata ptr %0, metadata !20, metadata !DIExpression()), !dbg !21 + %ZERO = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %u = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %v = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 + %w = getelementptr inbounds %prog, ptr %0, i32 0, i32 3 ret void, !dbg !21 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__user_init_prog(%prog* @prog_instance) + call void @__init_prog(ptr @prog_instance) + call void @__user_init_prog(ptr @prog_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!12, !13} !llvm.dbg.cu = !{!14} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap index 84a4db90766..7b746b4c470 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap @@ -9,24 +9,24 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @myFunc(i8* %0) !dbg !4 { +define void @myFunc(ptr %0) !dbg !4 { entry: - %myFunc = alloca i8*, align 8 - call void @llvm.dbg.declare(metadata i8** %myFunc, metadata !16, metadata !DIExpression()), !dbg !17 - store i8* %0, i8** %myFunc, align 8 - %deref = load i8*, i8** %myFunc, align 8, !dbg !18 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false), !dbg !18 + %myFunc = alloca ptr, align 8 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !16, metadata !DIExpression()), !dbg !17 + store ptr %0, ptr %myFunc, align 8 + %deref = load ptr, ptr %myFunc, align 8, !dbg !18 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 6, i1 false), !dbg !18 ret void, !dbg !19 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap index 6e404bbe9f4..35a9d2c4e81 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,23 +11,22 @@ define i32 @foo() !dbg !4 { entry: %foo = alloca i32, align 4 %a = alloca [64 x i32], align 4 - call void @llvm.dbg.declare(metadata [64 x i32]* %a, metadata !9, metadata !DIExpression()), !dbg !14 - %0 = bitcast [64 x i32]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([64 x i32]* getelementptr ([64 x i32], [64 x i32]* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata i32* %foo, metadata !15, metadata !DIExpression()), !dbg !16 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4, !dbg !17 + call void @llvm.dbg.declare(metadata ptr %a, metadata !9, metadata !DIExpression()), !dbg !14 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([64 x i32], ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %foo, metadata !15, metadata !DIExpression()), !dbg !16 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4, !dbg !17 ret i32 %foo_ret, !dbg !17 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap index a502b7fa104..544a15d4dad 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,17 +10,17 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 - store i32 3, i32* %myFunc, align 4, !dbg !12 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !13 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 + store i32 3, ptr %myFunc, align 4, !dbg !12 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap index 2f49ccc588f..07025be71f8 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,36 +10,36 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 - %load_myFunc = load i32, i32* %myFunc, align 4, !dbg !12 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 + %load_myFunc = load i32, ptr %myFunc, align 4, !dbg !12 switch i32 %load_myFunc, label %else [ i32 1, label %case i32 2, label %case1 ], !dbg !13 case: ; preds = %entry - store i32 1, i32* %myFunc, align 4, !dbg !14 + store i32 1, ptr %myFunc, align 4, !dbg !14 br label %continue, !dbg !15 case1: ; preds = %entry - store i32 1, i32* %myFunc, align 4, !dbg !16 + store i32 1, ptr %myFunc, align 4, !dbg !16 br label %continue, !dbg !15 else: ; preds = %entry - store i32 1, i32* %myFunc, align 4, !dbg !17 + store i32 1, ptr %myFunc, align 4, !dbg !17 br label %continue, !dbg !15 continue: ; preds = %else, %case1, %case - store i32 1, i32* %myFunc, align 4, !dbg !18 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !19 + store i32 1, ptr %myFunc, align 4, !dbg !18 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !19 ret i32 %myFunc_ret, !dbg !19 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap index 7264034f190..5395e3b368f 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,8 +10,8 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 br label %condition_check, !dbg !12 condition_check: ; preds = %entry, %continue1 @@ -22,8 +21,8 @@ while_body: ; preds = %condition_check br i1 false, label %condition_body, label %continue1, !dbg !13 continue: ; preds = %condition_body, %condition_check - store i32 1, i32* %myFunc, align 4, !dbg !14 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !15 + store i32 1, ptr %myFunc, align 4, !dbg !14 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !15 ret i32 %myFunc_ret, !dbg !15 condition_body: ; preds = %while_body @@ -36,10 +35,10 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap index b1c4d01bd6e..e0f6ac7a096 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__external_impl_is_not_added_as_external_subroutine.snap @@ -15,9 +15,9 @@ target triple = "[filtered]" declare i32 @myFunc() -declare void @myPrg(%myPrg*) +declare void @myPrg(ptr) -declare void @myFb(%myFb*) +declare void @myFb(ptr) !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap index b7700cffec2..869d1ae4858 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,40 +10,40 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 - store i32 1, i32* %myFunc, align 4, !dbg !12 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 + store i32 1, ptr %myFunc, align 4, !dbg !12 br i1 true, label %predicate_sle, label %predicate_sge, !dbg !12 predicate_sle: ; preds = %increment, %entry - %0 = load i32, i32* %myFunc, align 4, !dbg !12 + %0 = load i32, ptr %myFunc, align 4, !dbg !12 %condition = icmp sle i32 %0, 20, !dbg !12 br i1 %condition, label %loop, label %continue, !dbg !12 predicate_sge: ; preds = %increment, %entry - %1 = load i32, i32* %myFunc, align 4, !dbg !12 + %1 = load i32, ptr %myFunc, align 4, !dbg !12 %condition1 = icmp sge i32 %1, 20, !dbg !12 br i1 %condition1, label %loop, label %continue, !dbg !12 loop: ; preds = %predicate_sge, %predicate_sle - store i32 1, i32* %myFunc, align 4, !dbg !13 + store i32 1, ptr %myFunc, align 4, !dbg !13 br label %increment, !dbg !14 increment: ; preds = %loop - %2 = load i32, i32* %myFunc, align 4, !dbg !14 + %2 = load i32, ptr %myFunc, align 4, !dbg !14 %next = add i32 2, %2, !dbg !14 - store i32 %next, i32* %myFunc, align 4, !dbg !14 + store i32 %next, ptr %myFunc, align 4, !dbg !14 br i1 true, label %predicate_sle, label %predicate_sge, !dbg !14 continue: ; preds = %predicate_sge, %predicate_sle - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !15 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !15 ret i32 %myFunc_ret, !dbg !15 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap index d2a6bed650b..2a2f4e585e0 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,17 +10,17 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 %call = call i32 @myFunc(), !dbg !12 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !13 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap index 5d089028175..a64348845ca 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,18 +10,18 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 %call = call i32 @myFunc(), !dbg !12 %tmpVar = add i32 1, %call, !dbg !12 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !13 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap index 8f820044442..c9e3cc07651 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,35 +10,35 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 br i1 true, label %condition_body, label %branch, !dbg !12 condition_body: ; preds = %entry - store i32 1, i32* %myFunc, align 4, !dbg !13 + store i32 1, ptr %myFunc, align 4, !dbg !13 br label %continue, !dbg !14 branch: ; preds = %entry br i1 false, label %condition_body1, label %else, !dbg !15 condition_body1: ; preds = %branch - store i32 1, i32* %myFunc, align 4, !dbg !16 + store i32 1, ptr %myFunc, align 4, !dbg !16 br label %continue, !dbg !14 else: ; preds = %branch - store i32 1, i32* %myFunc, align 4, !dbg !17 + store i32 1, ptr %myFunc, align 4, !dbg !17 br label %continue, !dbg !14 continue: ; preds = %else, %condition_body1, %condition_body - store i32 1, i32* %myFunc, align 4, !dbg !18 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !19 + store i32 1, ptr %myFunc, align 4, !dbg !18 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !19 ret i32 %myFunc_ret, !dbg !19 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap index da48c3a0d1e..8747b01598e 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap @@ -16,30 +16,30 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !14 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !17, metadata !DIExpression()), !dbg !19 - store i32 0, i32* %myFunc, align 4 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !20 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !17, metadata !DIExpression()), !dbg !19 + store i32 0, ptr %myFunc, align 4 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !20 ret i32 %myFunc_ret, !dbg !20 } -define void @myPrg(%myPrg* %0) !dbg !21 { +define void @myPrg(ptr %0) !dbg !21 { entry: - call void @llvm.dbg.declare(metadata %myPrg* %0, metadata !24, metadata !DIExpression()), !dbg !25 + call void @llvm.dbg.declare(metadata ptr %0, metadata !24, metadata !DIExpression()), !dbg !25 ret void, !dbg !25 } -define void @myFb(%myFb* %0) !dbg !26 { +define void @myFb(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata %myFb* %0, metadata !29, metadata !DIExpression()), !dbg !30 - %this = alloca %myFb*, align 8 - store %myFb* %0, %myFb** %this, align 8 + call void @llvm.dbg.declare(metadata ptr %0, metadata !29, metadata !DIExpression()), !dbg !30 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void, !dbg !30 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!9, !10} !llvm.dbg.cu = !{!11} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap index d9ee6c7b9df..d6e5a35af88 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,20 +11,20 @@ define i32 @myFunc(i32 %0) !dbg !4 { entry: %myFunc = alloca i32, align 4 %x = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %x, metadata !10, metadata !DIExpression()), !dbg !11 - store i32 %0, i32* %x, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !12, metadata !DIExpression()), !dbg !13 - store i32 0, i32* %myFunc, align 4 + call void @llvm.dbg.declare(metadata ptr %x, metadata !10, metadata !DIExpression()), !dbg !11 + store i32 %0, ptr %x, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !12, metadata !DIExpression()), !dbg !13 + store i32 0, ptr %myFunc, align 4 %call = call i32 @myFunc(i32 1), !dbg !14 %call1 = call i32 @myFunc(i32 %call), !dbg !15 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !16 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !16 ret i32 %myFunc_ret, !dbg !16 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap index 842f6b68a2c..f724d10003a 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,17 +10,17 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 - %load_myFunc = load i32, i32* %myFunc, align 4, !dbg !12 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !13 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 + %load_myFunc = load i32, ptr %myFunc, align 4, !dbg !12 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap index 8fcde6169a8..43b7e967264 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap @@ -13,32 +13,32 @@ target triple = "[filtered]" @myProg_instance = global %myProg zeroinitializer, !dbg !0 @__fb__init = unnamed_addr constant %fb zeroinitializer, !dbg !7 -define void @myProg(%myProg* %0) !dbg !18 { +define void @myProg(ptr %0) !dbg !18 { entry: - call void @llvm.dbg.declare(metadata %myProg* %0, metadata !22, metadata !DIExpression()), !dbg !23 - %x = getelementptr inbounds %myProg, %myProg* %0, i32 0, i32 0 - %load_x = load i32, i32* %x, align 4, !dbg !23 + call void @llvm.dbg.declare(metadata ptr %0, metadata !22, metadata !DIExpression()), !dbg !23 + %x = getelementptr inbounds %myProg, ptr %0, i32 0, i32 0 + %load_x = load i32, ptr %x, align 4, !dbg !23 %tmpVar = add i32 %load_x, 2, !dbg !23 - store i32 %tmpVar, i32* %x, align 4, !dbg !23 + store i32 %tmpVar, ptr %x, align 4, !dbg !23 ret void, !dbg !24 } -define void @fb(%fb* %0) !dbg !25 { +define void @fb(ptr %0) !dbg !25 { entry: - call void @llvm.dbg.declare(metadata %fb* %0, metadata !28, metadata !DIExpression()), !dbg !29 - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 - %load_x = load i32, i32* %x, align 4, !dbg !29 + call void @llvm.dbg.declare(metadata ptr %0, metadata !28, metadata !DIExpression()), !dbg !29 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %load_x = load i32, ptr %x, align 4, !dbg !29 %tmpVar = add i32 %load_x, 2, !dbg !29 - store i32 %tmpVar, i32* %x, align 4, !dbg !29 + store i32 %tmpVar, ptr %x, align 4, !dbg !29 ret void, !dbg !30 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!13, !14} !llvm.dbg.cu = !{!15} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap index 6e17e4d99be..027b8f979f1 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,24 +10,24 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 br label %condition_check, !dbg !12 condition_check: ; preds = %entry, %continue1 br i1 true, label %while_body, label %continue, !dbg !13 while_body: ; preds = %condition_check - store i32 1, i32* %myFunc, align 4, !dbg !14 - %load_myFunc = load i32, i32* %myFunc, align 4, !dbg !13 + store i32 1, ptr %myFunc, align 4, !dbg !14 + %load_myFunc = load i32, ptr %myFunc, align 4, !dbg !13 %tmpVar = icmp sgt i32 %load_myFunc, 10, !dbg !13 %0 = zext i1 %tmpVar to i8, !dbg !13 %1 = icmp ne i8 %0, 0, !dbg !13 br i1 %1, label %condition_body, label %continue1, !dbg !13 continue: ; preds = %condition_body, %condition_check - store i32 1, i32* %myFunc, align 4, !dbg !15 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !16 + store i32 1, ptr %myFunc, align 4, !dbg !15 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !16 ret i32 %myFunc_ret, !dbg !16 condition_body: ; preds = %while_body @@ -41,10 +40,10 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap index 4d8bf4fccf3..dcb5d17777a 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,20 +10,20 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !12 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !12 ret i32 %myFunc_ret, !dbg !12 buffer_block: ; No predecessors! - %myFunc_ret1 = load i32, i32* %myFunc, align 4, !dbg !13 + %myFunc_ret1 = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret1, !dbg !13 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap index c948ce2acbd..07a3241524f 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap @@ -19,54 +19,54 @@ entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %a, metadata !17, metadata !DIExpression()), !dbg !19 - store i32 0, i32* %a, align 4 - call void @llvm.dbg.declare(metadata i32* %b, metadata !20, metadata !DIExpression()), !dbg !21 - store i32 0, i32* %b, align 4 - call void @llvm.dbg.declare(metadata i32* %c, metadata !22, metadata !DIExpression()), !dbg !23 - store i32 0, i32* %c, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !24, metadata !DIExpression()), !dbg !25 - store i32 0, i32* %myFunc, align 4 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !26 + call void @llvm.dbg.declare(metadata ptr %a, metadata !17, metadata !DIExpression()), !dbg !19 + store i32 0, ptr %a, align 4 + call void @llvm.dbg.declare(metadata ptr %b, metadata !20, metadata !DIExpression()), !dbg !21 + store i32 0, ptr %b, align 4 + call void @llvm.dbg.declare(metadata ptr %c, metadata !22, metadata !DIExpression()), !dbg !23 + store i32 0, ptr %c, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !24, metadata !DIExpression()), !dbg !25 + store i32 0, ptr %myFunc, align 4 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !26 ret i32 %myFunc_ret, !dbg !26 } -define void @myPrg(%myPrg* %0) !dbg !27 { +define void @myPrg(ptr %0) !dbg !27 { entry: - call void @llvm.dbg.declare(metadata %myPrg* %0, metadata !30, metadata !DIExpression()), !dbg !31 + call void @llvm.dbg.declare(metadata ptr %0, metadata !30, metadata !DIExpression()), !dbg !31 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %a, metadata !32, metadata !DIExpression()), !dbg !33 - store i32 0, i32* %a, align 4 - call void @llvm.dbg.declare(metadata i32* %b, metadata !34, metadata !DIExpression()), !dbg !35 - store i32 0, i32* %b, align 4 - call void @llvm.dbg.declare(metadata i32* %c, metadata !36, metadata !DIExpression()), !dbg !37 - store i32 0, i32* %c, align 4 + call void @llvm.dbg.declare(metadata ptr %a, metadata !32, metadata !DIExpression()), !dbg !33 + store i32 0, ptr %a, align 4 + call void @llvm.dbg.declare(metadata ptr %b, metadata !34, metadata !DIExpression()), !dbg !35 + store i32 0, ptr %b, align 4 + call void @llvm.dbg.declare(metadata ptr %c, metadata !36, metadata !DIExpression()), !dbg !37 + store i32 0, ptr %c, align 4 ret void, !dbg !31 } -define void @myFb(%myFb* %0) !dbg !38 { +define void @myFb(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata %myFb* %0, metadata !41, metadata !DIExpression()), !dbg !42 - %this = alloca %myFb*, align 8 - store %myFb* %0, %myFb** %this, align 8 + call void @llvm.dbg.declare(metadata ptr %0, metadata !41, metadata !DIExpression()), !dbg !42 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %a, metadata !43, metadata !DIExpression()), !dbg !44 - store i32 0, i32* %a, align 4 - call void @llvm.dbg.declare(metadata i32* %b, metadata !45, metadata !DIExpression()), !dbg !46 - store i32 0, i32* %b, align 4 - call void @llvm.dbg.declare(metadata i32* %c, metadata !47, metadata !DIExpression()), !dbg !48 - store i32 0, i32* %c, align 4 + call void @llvm.dbg.declare(metadata ptr %a, metadata !43, metadata !DIExpression()), !dbg !44 + store i32 0, ptr %a, align 4 + call void @llvm.dbg.declare(metadata ptr %b, metadata !45, metadata !DIExpression()), !dbg !46 + store i32 0, ptr %b, align 4 + call void @llvm.dbg.declare(metadata ptr %c, metadata !47, metadata !DIExpression()), !dbg !48 + store i32 0, ptr %c, align 4 ret void, !dbg !42 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!9, !10} !llvm.dbg.cu = !{!11} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap index 96c08fc85af..1ec837ab299 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap @@ -7,27 +7,27 @@ source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -define i32 @myFunc(i16* %0) !dbg !4 { +define i32 @myFunc(ptr %0) !dbg !4 { entry: %myFunc = alloca i32, align 4 - %x = alloca i16*, align 8 - call void @llvm.dbg.declare(metadata i16** %x, metadata !12, metadata !DIExpression()), !dbg !13 - store i16* %0, i16** %x, align 8 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !14, metadata !DIExpression()), !dbg !16 - store i32 0, i32* %myFunc, align 4 - %deref = load i16*, i16** %x, align 8, !dbg !17 - %load_x = load i16, i16* %deref, align 2, !dbg !17 + %x = alloca ptr, align 8 + call void @llvm.dbg.declare(metadata ptr %x, metadata !12, metadata !DIExpression()), !dbg !13 + store ptr %0, ptr %x, align 8 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !14, metadata !DIExpression()), !dbg !16 + store i32 0, ptr %myFunc, align 4 + %deref = load ptr, ptr %x, align 8, !dbg !17 + %load_x = load i16, ptr %deref, align 2, !dbg !17 %1 = sext i16 %load_x to i32, !dbg !17 %tmpVar = add i32 %1, 2, !dbg !17 - store i32 %tmpVar, i32* %myFunc, align 4, !dbg !17 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !18 + store i32 %tmpVar, ptr %myFunc, align 4, !dbg !17 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !18 ret i32 %myFunc_ret, !dbg !18 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap index 770af9dec12..891f290dc2b 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/debug_tests/expression_debugging.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,15 +10,15 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 - store i32 0, i32* %myFunc, align 4 + call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + store i32 0, ptr %myFunc, align 4 br label %condition_check, !dbg !12 condition_check: ; preds = %entry, %continue1 br i1 true, label %while_body, label %continue, !dbg !13 while_body: ; preds = %condition_check - %load_myFunc = load i32, i32* %myFunc, align 4, !dbg !13 + %load_myFunc = load i32, ptr %myFunc, align 4, !dbg !13 %tmpVar = icmp sgt i32 %load_myFunc, 1, !dbg !13 %0 = zext i1 %tmpVar to i8, !dbg !13 %1 = icmp ne i8 %0, 0, !dbg !13 @@ -27,8 +26,8 @@ while_body: ; preds = %condition_check br i1 %tmpVar2, label %condition_body, label %continue1, !dbg !13 continue: ; preds = %condition_body, %condition_check - store i32 1, i32* %myFunc, align 4, !dbg !14 - %myFunc_ret = load i32, i32* %myFunc, align 4, !dbg !15 + store i32 1, ptr %myFunc, align 4, !dbg !14 + %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !15 ret i32 %myFunc_ret, !dbg !15 condition_body: ; preds = %while_body @@ -38,14 +37,14 @@ buffer_block: ; No predecessors! br label %continue1, !dbg !16 continue1: ; preds = %buffer_block, %while_body - store i32 1, i32* %myFunc, align 4, !dbg !17 + store i32 1, ptr %myFunc, align 4, !dbg !17 br label %condition_check, !dbg !12 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/directaccess_test.rs b/src/codegen/tests/directaccess_test.rs index b7d3c99c767..2378647b054 100644 --- a/src/codegen/tests/directaccess_test.rs +++ b/src/codegen/tests/directaccess_test.rs @@ -151,12 +151,12 @@ fn direct_acess_in_output_assignment_implicit_explicit_and_mixed() { @__FOO__init = unnamed_addr constant %FOO zeroinitializer - define void @FOO(%FOO* %0) { + define void @FOO(ptr %0) { entry: - %this = alloca %FOO*, align 8 - store %FOO* %0, %FOO** %this, align 8 - %X = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 - %Y = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %X = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 + %Y = getelementptr inbounds %FOO, ptr %0, i32 0, i32 1 ret void } @@ -165,63 +165,62 @@ fn direct_acess_in_output_assignment_implicit_explicit_and_mixed() { %main = alloca i32, align 4 %error_bits = alloca i8, align 1 %f = alloca %FOO, align 8 - store i8 0, i8* %error_bits, align 1 - %0 = bitcast %FOO* %f to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%FOO, %FOO* @__FOO__init, i32 0, i32 0), i64 ptrtoint (%FOO* getelementptr (%FOO, %FOO* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %1 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 - %load_error_bits = load i8, i8* %error_bits, align 1 + store i8 0, ptr %error_bits, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %0 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %load_error_bits = load i8, ptr %error_bits, align 1 %shift = lshr i8 %load_error_bits, 0 - %2 = and i8 %shift, 1 - store i8 %2, i8* %1, align 1 - call void @FOO(%FOO* %f) - %3 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 1 - %4 = load i8, i8* %error_bits, align 1 - %5 = load i8, i8* %3, align 1 - %erase = and i8 %4, -2 - %value = shl i8 %5, 0 + %1 = and i8 %shift, 1 + store i8 %1, ptr %0, align 1 + call void @FOO(ptr %f) + %2 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 1 + %3 = load i8, ptr %error_bits, align 1 + %4 = load i8, ptr %2, align 1 + %erase = and i8 %3, -2 + %value = shl i8 %4, 0 %or = or i8 %erase, %value - store i8 %or, i8* %error_bits, align 1 - %6 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 - %load_error_bits1 = load i8, i8* %error_bits, align 1 + store i8 %or, ptr %error_bits, align 1 + %5 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %load_error_bits1 = load i8, ptr %error_bits, align 1 %shift2 = lshr i8 %load_error_bits1, 0 - %7 = and i8 %shift2, 1 - store i8 %7, i8* %6, align 1 - call void @FOO(%FOO* %f) - %8 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 1 - %9 = load i8, i8* %error_bits, align 1 - %10 = load i8, i8* %8, align 1 - %erase3 = and i8 %9, -2 - %value4 = shl i8 %10, 0 + %6 = and i8 %shift2, 1 + store i8 %6, ptr %5, align 1 + call void @FOO(ptr %f) + %7 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 1 + %8 = load i8, ptr %error_bits, align 1 + %9 = load i8, ptr %7, align 1 + %erase3 = and i8 %8, -2 + %value4 = shl i8 %9, 0 %or5 = or i8 %erase3, %value4 - store i8 %or5, i8* %error_bits, align 1 - %11 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 - %load_error_bits6 = load i8, i8* %error_bits, align 1 + store i8 %or5, ptr %error_bits, align 1 + %10 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %load_error_bits6 = load i8, ptr %error_bits, align 1 %shift7 = lshr i8 %load_error_bits6, 0 - %12 = and i8 %shift7, 1 - store i8 %12, i8* %11, align 1 - call void @FOO(%FOO* %f) - %13 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 1 - %14 = load i8, i8* %error_bits, align 1 - %15 = load i8, i8* %13, align 1 - %erase8 = and i8 %14, -2 - %value9 = shl i8 %15, 0 + %11 = and i8 %shift7, 1 + store i8 %11, ptr %10, align 1 + call void @FOO(ptr %f) + %12 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 1 + %13 = load i8, ptr %error_bits, align 1 + %14 = load i8, ptr %12, align 1 + %erase8 = and i8 %13, -2 + %value9 = shl i8 %14, 0 %or10 = or i8 %erase8, %value9 - store i8 %or10, i8* %error_bits, align 1 - %16 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 - %load_error_bits11 = load i8, i8* %error_bits, align 1 + store i8 %or10, ptr %error_bits, align 1 + %15 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %load_error_bits11 = load i8, ptr %error_bits, align 1 %shift12 = lshr i8 %load_error_bits11, 0 - %17 = and i8 %shift12, 1 - store i8 %17, i8* %16, align 1 - call void @FOO(%FOO* %f) - %main_ret = load i32, i32* %main, align 4 + %16 = and i8 %shift12, 1 + store i8 %16, ptr %15, align 1 + call void @FOO(ptr %f) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -256,11 +255,11 @@ fn direct_acess_in_output_assignment_with_simple_expression() { @__FOO__init = unnamed_addr constant %FOO { i8 1 } - define void @FOO(%FOO* %0) { + define void @FOO(ptr %0) { entry: - %this = alloca %FOO*, align 8 - store %FOO* %0, %FOO** %this, align 8 - %Q = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %Q = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 ret void } @@ -269,26 +268,25 @@ fn direct_acess_in_output_assignment_with_simple_expression() { %main = alloca i32, align 4 %error_bits = alloca i8, align 1 %f = alloca %FOO, align 8 - store i8 -17, i8* %error_bits, align 1 - %0 = bitcast %FOO* %f to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%FOO, %FOO* @__FOO__init, i32 0, i32 0), i64 ptrtoint (%FOO* getelementptr (%FOO, %FOO* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - call void @FOO(%FOO* %f) - %1 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 - %2 = load i8, i8* %error_bits, align 1 - %3 = load i8, i8* %1, align 1 - %erase = and i8 %2, -17 - %value = shl i8 %3, 4 + store i8 -17, ptr %error_bits, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + call void @FOO(ptr %f) + %0 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %1 = load i8, ptr %error_bits, align 1 + %2 = load i8, ptr %0, align 1 + %erase = and i8 %1, -17 + %value = shl i8 %2, 4 %or = or i8 %erase, %value - store i8 %or, i8* %error_bits, align 1 - %main_ret = load i32, i32* %main, align 4 + store i8 %or, ptr %error_bits, align 1 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -323,11 +321,11 @@ fn direct_acess_in_output_assignment_with_simple_expression_implicit() { @__FOO__init = unnamed_addr constant %FOO { i8 1 } - define void @FOO(%FOO* %0) { + define void @FOO(ptr %0) { entry: - %this = alloca %FOO*, align 8 - store %FOO* %0, %FOO** %this, align 8 - %Q = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %Q = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 ret void } @@ -336,26 +334,25 @@ fn direct_acess_in_output_assignment_with_simple_expression_implicit() { %main = alloca i32, align 4 %error_bits = alloca i8, align 1 %f = alloca %FOO, align 8 - store i8 -17, i8* %error_bits, align 1 - %0 = bitcast %FOO* %f to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%FOO, %FOO* @__FOO__init, i32 0, i32 0), i64 ptrtoint (%FOO* getelementptr (%FOO, %FOO* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - call void @FOO(%FOO* %f) - %1 = getelementptr inbounds %FOO, %FOO* %f, i32 0, i32 0 - %2 = load i8, i8* %error_bits, align 1 - %3 = load i8, i8* %1, align 1 - %erase = and i8 %2, -17 - %value = shl i8 %3, 4 + store i8 -17, ptr %error_bits, align 1 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + call void @FOO(ptr %f) + %0 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %1 = load i8, ptr %error_bits, align 1 + %2 = load i8, ptr %0, align 1 + %erase = and i8 %1, -17 + %value = shl i8 %2, 4 %or = or i8 %erase, %value - store i8 %or, i8* %error_bits, align 1 - %main_ret = load i32, i32* %main, align 4 + store i8 %or, ptr %error_bits, align 1 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -403,11 +400,11 @@ fn direct_acess_in_output_assignment_with_complexe_expression() { @__foo_struct__init = unnamed_addr constant %foo_struct zeroinitializer @__bar_struct__init = unnamed_addr constant %bar_struct zeroinitializer - define void @QUUX(%QUUX* %0) { + define void @QUUX(ptr %0) { entry: - %this = alloca %QUUX*, align 8 - store %QUUX* %0, %QUUX** %this, align 8 - %Q = getelementptr inbounds %QUUX, %QUUX* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %Q = getelementptr inbounds %QUUX, ptr %0, i32 0, i32 0 ret void } @@ -416,40 +413,38 @@ fn direct_acess_in_output_assignment_with_complexe_expression() { %main = alloca i32, align 4 %foo = alloca %foo_struct, align 8 %f = alloca %QUUX, align 8 - %0 = bitcast %foo_struct* %foo to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo_struct* @__foo_struct__init to i8*), i64 ptrtoint (%foo_struct* getelementptr (%foo_struct, %foo_struct* null, i32 1) to i64), i1 false) - %1 = bitcast %QUUX* %f to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds (%QUUX, %QUUX* @__QUUX__init, i32 0, i32 0), i64 ptrtoint (%QUUX* getelementptr (%QUUX, %QUUX* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - call void @QUUX(%QUUX* %f) - %bar = getelementptr inbounds %foo_struct, %foo_struct* %foo, i32 0, i32 0 - %baz = getelementptr inbounds %bar_struct, %bar_struct* %bar, i32 0, i32 0 - %2 = getelementptr inbounds %QUUX, %QUUX* %f, i32 0, i32 0 - %3 = load i64, i64* %baz, align 8 - %4 = load i8, i8* %2, align 1 - %erase = and i64 %3, -281474976710657 - %5 = zext i8 %4 to i64 - %value = shl i64 %5, 48 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %foo, ptr align 1 @__foo_struct__init, i64 ptrtoint (ptr getelementptr (%foo_struct, ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__QUUX__init, i64 ptrtoint (ptr getelementptr (%QUUX, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + call void @QUUX(ptr %f) + %bar = getelementptr inbounds %foo_struct, ptr %foo, i32 0, i32 0 + %baz = getelementptr inbounds %bar_struct, ptr %bar, i32 0, i32 0 + %0 = getelementptr inbounds %QUUX, ptr %f, i32 0, i32 0 + %1 = load i64, ptr %baz, align 8 + %2 = load i8, ptr %0, align 1 + %erase = and i64 %1, -281474976710657 + %3 = zext i8 %2 to i64 + %value = shl i64 %3, 48 %or = or i64 %erase, %value - store i64 %or, i64* %baz, align 8 - call void @QUUX(%QUUX* %f) - %bar1 = getelementptr inbounds %foo_struct, %foo_struct* %foo, i32 0, i32 0 - %baz2 = getelementptr inbounds %bar_struct, %bar_struct* %bar1, i32 0, i32 0 - %6 = getelementptr inbounds %QUUX, %QUUX* %f, i32 0, i32 0 - %7 = load i64, i64* %baz2, align 8 - %8 = load i8, i8* %6, align 1 - %erase3 = and i64 %7, -1125899906842625 - %9 = zext i8 %8 to i64 - %value4 = shl i64 %9, 50 + store i64 %or, ptr %baz, align 8 + call void @QUUX(ptr %f) + %bar1 = getelementptr inbounds %foo_struct, ptr %foo, i32 0, i32 0 + %baz2 = getelementptr inbounds %bar_struct, ptr %bar1, i32 0, i32 0 + %4 = getelementptr inbounds %QUUX, ptr %f, i32 0, i32 0 + %5 = load i64, ptr %baz2, align 8 + %6 = load i8, ptr %4, align 1 + %erase3 = and i64 %5, -1125899906842625 + %7 = zext i8 %6 to i64 + %value4 = shl i64 %7, 50 %or5 = or i64 %erase3, %value4 - store i64 %or5, i64* %baz2, align 8 - %main_ret = load i32, i32* %main, align 4 + store i64 %or5, ptr %baz2, align 8 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } diff --git a/src/codegen/tests/expression_tests.rs b/src/codegen/tests/expression_tests.rs index 44bd3159764..ec335ea6c68 100644 --- a/src/codegen/tests/expression_tests.rs +++ b/src/codegen/tests/expression_tests.rs @@ -298,16 +298,16 @@ fn builtin_function_call_adr() { target datalayout = "[filtered]" target triple = "[filtered]" - %main = type { i32*, i32 } + %main = type { ptr, i32 } @main_instance = global %main zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - store i32* %b, i32** %a, align 8 - store i32* %b, i32** %a, align 8 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + store ptr %b, ptr %a, align 8 + store ptr %b, ptr %a, align 8 ret void } "#); @@ -336,16 +336,16 @@ fn builtin_function_call_ref() { target datalayout = "[filtered]" target triple = "[filtered]" - %main = type { i32*, i32 } + %main = type { ptr, i32 } @main_instance = global %main zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - store i32* %b, i32** %a, align 8 - store i32* %b, i32** %a, align 8 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + store ptr %b, ptr %a, align 8 + store ptr %b, ptr %a, align 8 ret void } "#); @@ -401,19 +401,19 @@ fn builtin_function_call_sel() { @main_instance = global %main zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %c = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_b = load i32, i32* %b, align 4 - %load_c = load i32, i32* %c, align 4 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_b = load i32, ptr %b, align 4 + %load_c = load i32, ptr %c, align 4 %1 = select i1 true, i32 %load_c, i32 %load_b - store i32 %1, i32* %a, align 4 - %load_b1 = load i32, i32* %b, align 4 - %load_c2 = load i32, i32* %c, align 4 + store i32 %1, ptr %a, align 4 + %load_b1 = load i32, ptr %b, align 4 + %load_c2 = load i32, ptr %c, align 4 %2 = select i1 true, i32 %load_c2, i32 %load_b1 - store i32 %2, i32* %a, align 4 + store i32 %2, ptr %a, align 4 ret void } "#); @@ -455,14 +455,14 @@ fn builtin_function_call_move() { @main_instance = global %main zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %load_b = load i32, i32* %b, align 4 - store i32 %load_b, i32* %a, align 4 - %load_b1 = load i32, i32* %b, align 4 - store i32 %load_b1, i32* %a, align 4 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %load_b = load i32, ptr %b, align 4 + store i32 %load_b, ptr %a, align 4 + %load_b1 = load i32, ptr %b, align 4 + store i32 %load_b1, ptr %a, align 4 ret void } "#); @@ -491,12 +491,12 @@ fn builtin_function_call_sizeof() { @main_instance = global %main zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - store i32 ptrtoint (i64* getelementptr (i64, i64* null, i32 1) to i32), i32* %a, align 4 - store i32 ptrtoint (i64* getelementptr (i64, i64* null, i32 1) to i32), i32* %a, align 4 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + store i32 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i32), ptr %a, align 4 + store i32 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i32), ptr %a, align 4 ret void } "#); @@ -531,47 +531,47 @@ fn builtin_function_call_lower_bound() { target triple = "[filtered]" %main = type { [2 x i32], i32 } - %__foo_vla = type { i32*, [2 x i32] } + %__foo_vla = type { ptr, [2 x i32] } @main_instance = global %main zeroinitializer @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %auto_deref = load [2 x i32], [2 x i32]* %a, align 4 - %outer_arr_gep = getelementptr inbounds [2 x i32], [2 x i32]* %a, i32 0, i32 0 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %auto_deref = load [2 x i32], ptr %a, align 4 + %outer_arr_gep = getelementptr inbounds [2 x i32], ptr %a, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i32* %outer_arr_gep, i32** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %1 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i32 @foo(%__foo_vla* %vla_struct_ptr) - store i32 %call, i32* %b, align 4 + store %__foo_vla %1, ptr %vla_struct_ptr, align 8 + %call = call i32 @foo(ptr %vla_struct_ptr) + store i32 %call, ptr %b, align 4 ret void } - define i32 @foo(%__foo_vla* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 - %vla = alloca %__foo_vla*, align 8 - store %__foo_vla* %0, %__foo_vla** %vla, align 8 - store i32 0, i32* %foo, align 4 - %deref = load %__foo_vla*, %__foo_vla** %vla, align 8 - %dim = getelementptr inbounds %__foo_vla, %__foo_vla* %deref, i32 0, i32 1 - %1 = getelementptr inbounds [2 x i32], [2 x i32]* %dim, i32 0, i32 0 - %2 = load i32, i32* %1, align 4 - store i32 %2, i32* %foo, align 4 - %deref1 = load %__foo_vla*, %__foo_vla** %vla, align 8 - %dim2 = getelementptr inbounds %__foo_vla, %__foo_vla* %deref1, i32 0, i32 1 - %3 = getelementptr inbounds [2 x i32], [2 x i32]* %dim2, i32 0, i32 0 - %4 = load i32, i32* %3, align 4 - store i32 %4, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + %vla = alloca ptr, align 8 + store ptr %0, ptr %vla, align 8 + store i32 0, ptr %foo, align 4 + %deref = load ptr, ptr %vla, align 8 + %dim = getelementptr inbounds %__foo_vla, ptr %deref, i32 0, i32 1 + %1 = getelementptr inbounds [2 x i32], ptr %dim, i32 0, i32 0 + %2 = load i32, ptr %1, align 4 + store i32 %2, ptr %foo, align 4 + %deref1 = load ptr, ptr %vla, align 8 + %dim2 = getelementptr inbounds %__foo_vla, ptr %deref1, i32 0, i32 1 + %3 = getelementptr inbounds [2 x i32], ptr %dim2, i32 0, i32 0 + %4 = load i32, ptr %3, align 4 + store i32 %4, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } "#); @@ -606,47 +606,47 @@ fn builtin_function_call_upper_bound() { target triple = "[filtered]" %main = type { [2 x i32], i32 } - %__foo_vla = type { i32*, [2 x i32] } + %__foo_vla = type { ptr, [2 x i32] } @main_instance = global %main zeroinitializer @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %auto_deref = load [2 x i32], [2 x i32]* %a, align 4 - %outer_arr_gep = getelementptr inbounds [2 x i32], [2 x i32]* %a, i32 0, i32 0 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %auto_deref = load [2 x i32], ptr %a, align 4 + %outer_arr_gep = getelementptr inbounds [2 x i32], ptr %a, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i32* %outer_arr_gep, i32** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %1 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i32 @foo(%__foo_vla* %vla_struct_ptr) - store i32 %call, i32* %b, align 4 + store %__foo_vla %1, ptr %vla_struct_ptr, align 8 + %call = call i32 @foo(ptr %vla_struct_ptr) + store i32 %call, ptr %b, align 4 ret void } - define i32 @foo(%__foo_vla* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 - %vla = alloca %__foo_vla*, align 8 - store %__foo_vla* %0, %__foo_vla** %vla, align 8 - store i32 0, i32* %foo, align 4 - %deref = load %__foo_vla*, %__foo_vla** %vla, align 8 - %dim = getelementptr inbounds %__foo_vla, %__foo_vla* %deref, i32 0, i32 1 - %1 = getelementptr inbounds [2 x i32], [2 x i32]* %dim, i32 0, i32 1 - %2 = load i32, i32* %1, align 4 - store i32 %2, i32* %foo, align 4 - %deref1 = load %__foo_vla*, %__foo_vla** %vla, align 8 - %dim2 = getelementptr inbounds %__foo_vla, %__foo_vla* %deref1, i32 0, i32 1 - %3 = getelementptr inbounds [2 x i32], [2 x i32]* %dim2, i32 0, i32 1 - %4 = load i32, i32* %3, align 4 - store i32 %4, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + %vla = alloca ptr, align 8 + store ptr %0, ptr %vla, align 8 + store i32 0, ptr %foo, align 4 + %deref = load ptr, ptr %vla, align 8 + %dim = getelementptr inbounds %__foo_vla, ptr %deref, i32 0, i32 1 + %1 = getelementptr inbounds [2 x i32], ptr %dim, i32 0, i32 1 + %2 = load i32, ptr %1, align 4 + store i32 %2, ptr %foo, align 4 + %deref1 = load ptr, ptr %vla, align 8 + %dim2 = getelementptr inbounds %__foo_vla, ptr %deref1, i32 0, i32 1 + %3 = getelementptr inbounds [2 x i32], ptr %dim2, i32 0, i32 1 + %4 = load i32, ptr %3, align 4 + store i32 %4, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } "#); @@ -980,13 +980,13 @@ fn builtin_div_with_named_arguments() { %main = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 - store i32 20, i32* %x, align 4 - store i32 4, i32* %y, align 4 - store i32 0, i32* %main, align 4 - %load_x = load i32, i32* %x, align 4 - %load_y = load i32, i32* %y, align 4 + store i32 20, ptr %x, align 4 + store i32 4, ptr %y, align 4 + store i32 0, ptr %main, align 4 + %load_x = load i32, ptr %x, align 4 + %load_y = load i32, ptr %y, align 4 %tmpVar = sdiv i32 %load_x, %load_y - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } "#); @@ -1017,13 +1017,13 @@ fn builtin_sub_with_named_arguments() { %main = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 - store i32 20, i32* %x, align 4 - store i32 4, i32* %y, align 4 - store i32 0, i32* %main, align 4 - %load_x = load i32, i32* %x, align 4 - %load_y = load i32, i32* %y, align 4 + store i32 20, ptr %x, align 4 + store i32 4, ptr %y, align 4 + store i32 0, ptr %main, align 4 + %load_x = load i32, ptr %x, align 4 + %load_y = load i32, ptr %y, align 4 %tmpVar = sub i32 %load_x, %load_y - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } "#); @@ -1061,23 +1061,23 @@ fn global_namespace_operator() { @foo = global i32 0 @main_instance = global %main zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %foo = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %load_foo = load i32, i32* @foo, align 4 - store i32 %load_foo, i32* %foo, align 4 - %load_foo1 = load i32, i32* @foo, align 4 + %foo = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %load_foo = load i32, ptr @foo, align 4 + store i32 %load_foo, ptr %foo, align 4 + %load_foo1 = load i32, ptr @foo, align 4 %tmpVar = add i32 %load_foo1, 1 - store i32 %tmpVar, i32* %foo, align 4 - %load_foo2 = load i32, i32* @foo, align 4 - %load_foo3 = load i32, i32* @foo, align 4 + store i32 %tmpVar, ptr %foo, align 4 + %load_foo2 = load i32, ptr @foo, align 4 + %load_foo3 = load i32, ptr @foo, align 4 %tmpVar4 = add i32 %load_foo2, %load_foo3 - store i32 %tmpVar4, i32* %foo, align 4 - %load_foo5 = load i32, i32* %foo, align 4 - store i32 %load_foo5, i32* @foo, align 4 - %load_foo6 = load i32, i32* @foo, align 4 + store i32 %tmpVar4, ptr %foo, align 4 + %load_foo5 = load i32, ptr %foo, align 4 + store i32 %load_foo5, ptr @foo, align 4 + %load_foo6 = load i32, ptr @foo, align 4 %tmpVar7 = add i32 %load_foo6, 1 - store i32 %tmpVar7, i32* @foo, align 4 + store i32 %tmpVar7, ptr @foo, align 4 ret void } "#); @@ -1117,19 +1117,19 @@ fn unary_plus_expression_test() { @exp_instance = global %exp zeroinitializer - define void @exp(%exp* %0) { + define void @exp(ptr %0) { entry: - %x = getelementptr inbounds %exp, %exp* %0, i32 0, i32 0 - %load_x = load i32, i32* %x, align 4 - %load_x1 = load i32, i32* %x, align 4 + %x = getelementptr inbounds %exp, ptr %0, i32 0, i32 0 + %load_x = load i32, ptr %x, align 4 + %load_x1 = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x1, 4 - store i32 %tmpVar, i32* %x, align 4 - store i32 1, i32* %x, align 4 - %load_x2 = load i32, i32* %x, align 4 + store i32 %tmpVar, ptr %x, align 4 + store i32 1, ptr %x, align 4 + %load_x2 = load i32, ptr %x, align 4 %tmpVar3 = sub i32 0, %load_x2 - %load_x4 = load i32, i32* %x, align 4 + %load_x4 = load i32, ptr %x, align 4 %call = call i32 @foo(i32 %load_x4) - store i32 %call, i32* %x, align 4 + store i32 %call, ptr %x, align 4 ret void } @@ -1137,11 +1137,11 @@ fn unary_plus_expression_test() { entry: %foo = alloca i32, align 4 %x = alloca i32, align 4 - store i32 %0, i32* %x, align 4 - store i32 0, i32* %foo, align 4 - %load_x = load i32, i32* %x, align 4 - store i32 %load_x, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %x, align 4 + store i32 0, ptr %foo, align 4 + %load_x = load i32, ptr %x, align 4 + store i32 %load_x, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } "#) diff --git a/src/codegen/tests/fnptr.rs b/src/codegen/tests/fnptr.rs index fd962c8d07e..c5d126fa842 100644 --- a/src/codegen/tests/fnptr.rs +++ b/src/codegen/tests/fnptr.rs @@ -31,36 +31,35 @@ fn function_pointer_method_no_parameters() { @__A__init = unnamed_addr constant %A zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } - define void @A__foo(%A* %0) { + define void @A__foo(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } define void @main() { entry: %instanceA = alloca %A, align 8 - %fooPtr = alloca void (%A*)*, align 8 - %0 = bitcast %A* %instanceA to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%A* @__A__init to i8*), i64 ptrtoint (%A* getelementptr (%A, %A* null, i32 1) to i64), i1 false) - store void (%A*)* @A__foo, void (%A*)** %fooPtr, align 8 - %1 = load void (%A*)*, void (%A*)** %fooPtr, align 8 - call void %1(%A* %instanceA) + %fooPtr = alloca ptr, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %instanceA, ptr align 1 @__A__init, i64 ptrtoint (ptr getelementptr (%A, ptr null, i32 1) to i64), i1 false) + store ptr @A__foo, ptr %fooPtr, align 8 + %0 = load ptr, ptr %fooPtr, align 8 + call void %0(ptr %instanceA) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -94,39 +93,38 @@ fn function_pointer_method_with_return_type() { @__A__init = unnamed_addr constant %A zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } - define i32 @A__foo(%A* %0) { + define i32 @A__foo(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 %A.foo = alloca i32, align 4 - store i32 0, i32* %A.foo, align 4 - %A__foo_ret = load i32, i32* %A.foo, align 4 + store i32 0, ptr %A.foo, align 4 + %A__foo_ret = load i32, ptr %A.foo, align 4 ret i32 %A__foo_ret } define void @main() { entry: %instanceA = alloca %A, align 8 - %fooPtr = alloca i32 (%A*)*, align 8 - %0 = bitcast %A* %instanceA to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%A* @__A__init to i8*), i64 ptrtoint (%A* getelementptr (%A, %A* null, i32 1) to i64), i1 false) - store i32 (%A*)* @A__foo, i32 (%A*)** %fooPtr, align 8 - %1 = load i32 (%A*)*, i32 (%A*)** %fooPtr, align 8 - %fnptr_call = call i32 %1(%A* %instanceA) + %fooPtr = alloca ptr, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %instanceA, ptr align 1 @__A__init, i64 ptrtoint (ptr getelementptr (%A, ptr null, i32 1) to i64), i1 false) + store ptr @A__foo, ptr %fooPtr, align 8 + %0 = load ptr, ptr %fooPtr, align 8 + %fnptr_call = call i32 %0(ptr %instanceA) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -168,72 +166,67 @@ fn function_pointer_method_with_return_type_aggregate() { @__A__init = unnamed_addr constant %A zeroinitializer @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"aaaaa\00" - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } - define void @A__foo(%A* %0, i8* %1) { + define void @A__foo(ptr %0, ptr %1) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %foo = alloca i8*, align 8 - store i8* %1, i8** %foo, align 8 - %deref = load i8*, i8** %foo, align 8 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %foo = alloca ptr, align 8 + store ptr %1, ptr %foo, align 8 + %deref = load ptr, ptr %foo, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 6, i1 false) ret void } - define void @A__bar(%A* %0, i32* %1) { + define void @A__bar(ptr %0, ptr %1) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %bar = alloca i32*, align 8 - store i32* %1, i32** %bar, align 8 - %deref = load i32*, i32** %bar, align 8 - store [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], i32* %deref, align 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %bar = alloca ptr, align 8 + store ptr %1, ptr %bar, align 8 + %deref = load ptr, ptr %bar, align 8 + store [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], ptr %deref, align 4 ret void } define void @main() { entry: %instanceA = alloca %A, align 8 - %fooPtr = alloca void (%A*, [81 x i8]*)*, align 8 - %barPtr = alloca void (%A*, [5 x i32]*)*, align 8 - %0 = bitcast %A* %instanceA to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%A* @__A__init to i8*), i64 ptrtoint (%A* getelementptr (%A, %A* null, i32 1) to i64), i1 false) - store void (%A*, [81 x i8]*)* bitcast (void (%A*, i8*)* @A__foo to void (%A*, [81 x i8]*)*), void (%A*, [81 x i8]*)** %fooPtr, align 8 - store void (%A*, [5 x i32]*)* bitcast (void (%A*, i32*)* @A__bar to void (%A*, [5 x i32]*)*), void (%A*, [5 x i32]*)** %barPtr, align 8 + %fooPtr = alloca ptr, align 8 + %barPtr = alloca ptr, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %instanceA, ptr align 1 @__A__init, i64 ptrtoint (ptr getelementptr (%A, ptr null, i32 1) to i64), i1 false) + store ptr @A__foo, ptr %fooPtr, align 8 + store ptr @A__bar, ptr %barPtr, align 8 %__0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = load void (%A*, [81 x i8]*)*, void (%A*, [81 x i8]*)** %fooPtr, align 8 - %3 = bitcast [81 x i8]* %__0 to i8* - call void %2(%A* %instanceA, i8* %3) - %load___0 = load [81 x i8], [81 x i8]* %__0, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %__0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + %0 = load ptr, ptr %fooPtr, align 8 + call void %0(ptr %instanceA, ptr %__0) + %load___0 = load [81 x i8], ptr %__0, align 1 %__1 = alloca [5 x i32], align 4 - %4 = bitcast [5 x i32]* %__1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %4, i8 0, i64 ptrtoint ([5 x i32]* getelementptr ([5 x i32], [5 x i32]* null, i32 1) to i64), i1 false) - %5 = load void (%A*, [5 x i32]*)*, void (%A*, [5 x i32]*)** %barPtr, align 8 - %6 = bitcast [5 x i32]* %__1 to i32* - call void %5(%A* %instanceA, i32* %6) - %load___1 = load [5 x i32], [5 x i32]* %__1, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %__1, i8 0, i64 ptrtoint (ptr getelementptr ([5 x i32], ptr null, i32 1) to i64), i1 false) + %1 = load ptr, ptr %barPtr, align 8 + call void %1(ptr %instanceA, ptr %__1) + %load___1 = load [5 x i32], ptr %__1, align 4 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#); } @@ -283,60 +276,55 @@ fn function_pointer_method_with_all_variable_parameter_types() { @__A__init = unnamed_addr constant %A zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } - define i32 @A__foo(%A* %0, i32 %1, [81 x i8]* %2, i32* %3) { + define i32 @A__foo(ptr %0, i32 %1, ptr %2, ptr %3) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 %A.foo = alloca i32, align 4 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - %out = alloca [81 x i8]*, align 8 - store [81 x i8]* %2, [81 x i8]** %out, align 8 - %inout = alloca i32*, align 8 - store i32* %3, i32** %inout, align 8 - store i32 0, i32* %A.foo, align 4 - %A__foo_ret = load i32, i32* %A.foo, align 4 + store i32 %1, ptr %in, align 4 + %out = alloca ptr, align 8 + store ptr %2, ptr %out, align 8 + %inout = alloca ptr, align 8 + store ptr %3, ptr %inout, align 8 + store i32 0, ptr %A.foo, align 4 + %A__foo_ret = load i32, ptr %A.foo, align 4 ret i32 %A__foo_ret } define void @main() { entry: %instanceA = alloca %A, align 8 - %fooPtr = alloca i32 (%A*, i32, [81 x i8]*, [5 x i32]*)*, align 8 + %fooPtr = alloca ptr, align 8 %localIn = alloca i32, align 4 %localOut = alloca [81 x i8], align 1 %localInOut = alloca [5 x i32], align 4 - %0 = bitcast %A* %instanceA to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%A* @__A__init to i8*), i64 ptrtoint (%A* getelementptr (%A, %A* null, i32 1) to i64), i1 false) - store i32 (%A*, i32, [81 x i8]*, [5 x i32]*)* bitcast (i32 (%A*, i32, [81 x i8]*, i32*)* @A__foo to i32 (%A*, i32, [81 x i8]*, [5 x i32]*)*), i32 (%A*, i32, [81 x i8]*, [5 x i32]*)** %fooPtr, align 8 - store i32 0, i32* %localIn, align 4 - %1 = bitcast [81 x i8]* %localOut to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [5 x i32]* %localInOut to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([5 x i32]* getelementptr ([5 x i32], [5 x i32]* null, i32 1) to i64), i1 false) - %3 = load i32 (%A*, i32, [81 x i8]*, [5 x i32]*)*, i32 (%A*, i32, [81 x i8]*, [5 x i32]*)** %fooPtr, align 8 - %4 = bitcast [81 x i8]* %localOut to i8* - %5 = bitcast [5 x i32]* %localInOut to i32* - %load_localIn = load i32, i32* %localIn, align 4 - %fnptr_call = call i32 %3(%A* %instanceA, i32 %load_localIn, i8* %4, i32* %5) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %instanceA, ptr align 1 @__A__init, i64 ptrtoint (ptr getelementptr (%A, ptr null, i32 1) to i64), i1 false) + store ptr @A__foo, ptr %fooPtr, align 8 + store i32 0, ptr %localIn, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %localOut, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %localInOut, i8 0, i64 ptrtoint (ptr getelementptr ([5 x i32], ptr null, i32 1) to i64), i1 false) + %0 = load ptr, ptr %fooPtr, align 8 + %load_localIn = load i32, ptr %localIn, align 4 + %fnptr_call = call i32 %0(ptr %instanceA, i32 %load_localIn, ptr %localOut, ptr %localInOut) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#); } @@ -383,51 +371,50 @@ fn function_block_body() { target datalayout = "[filtered]" target triple = "[filtered]" - %A = type { i32, i16, i32, i64* } + %A = type { i32, i16, i32, ptr } @__A__init = unnamed_addr constant %A zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %local = getelementptr inbounds %A, %A* %0, i32 0, i32 0 - %in = getelementptr inbounds %A, %A* %0, i32 0, i32 1 - %out = getelementptr inbounds %A, %A* %0, i32 0, i32 2 - %inout = getelementptr inbounds %A, %A* %0, i32 0, i32 3 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %local = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %in = getelementptr inbounds %A, ptr %0, i32 0, i32 1 + %out = getelementptr inbounds %A, ptr %0, i32 0, i32 2 + %inout = getelementptr inbounds %A, ptr %0, i32 0, i32 3 ret void } define void @main() { entry: %instanceA = alloca %A, align 8 - %bodyPtr = alloca void (%A*)*, align 8 + %bodyPtr = alloca ptr, align 8 %localIn = alloca i16, align 2 %localOut = alloca i32, align 4 %localInout = alloca i64, align 8 - %0 = bitcast %A* %instanceA to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%A* @__A__init to i8*), i64 ptrtoint (%A* getelementptr (%A, %A* null, i32 1) to i64), i1 false) - store void (%A*)* @A, void (%A*)** %bodyPtr, align 8 - store i16 0, i16* %localIn, align 2 - store i32 0, i32* %localOut, align 4 - store i64 0, i64* %localInout, align 8 - %1 = load void (%A*)*, void (%A*)** %bodyPtr, align 8 - %2 = getelementptr inbounds %A, %A* %instanceA, i32 0, i32 1 - %load_localIn = load i16, i16* %localIn, align 2 - store i16 %load_localIn, i16* %2, align 2 - %3 = getelementptr inbounds %A, %A* %instanceA, i32 0, i32 3 - store i64* %localInout, i64** %3, align 8 - call void %1(%A* %instanceA) - %4 = getelementptr inbounds %A, %A* %instanceA, i32 0, i32 2 - %5 = load i32, i32* %4, align 4 - store i32 %5, i32* %localOut, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %instanceA, ptr align 1 @__A__init, i64 ptrtoint (ptr getelementptr (%A, ptr null, i32 1) to i64), i1 false) + store ptr @A, ptr %bodyPtr, align 8 + store i16 0, ptr %localIn, align 2 + store i32 0, ptr %localOut, align 4 + store i64 0, ptr %localInout, align 8 + %0 = load ptr, ptr %bodyPtr, align 8 + %1 = getelementptr inbounds %A, ptr %instanceA, i32 0, i32 1 + %load_localIn = load i16, ptr %localIn, align 2 + store i16 %load_localIn, ptr %1, align 2 + %2 = getelementptr inbounds %A, ptr %instanceA, i32 0, i32 3 + store ptr %localInout, ptr %2, align 8 + call void %0(ptr %instanceA) + %3 = getelementptr inbounds %A, ptr %instanceA, i32 0, i32 2 + %4 = load i32, ptr %3, align 4 + store i32 %4, ptr %localOut, align 4 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -458,19 +445,19 @@ fn regular_pointers_to_function_blocks_are_called_directly() { @__A__init = unnamed_addr constant %A zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } define void @main() { entry: - %fooPtr = alloca %A*, align 8 - store %A* null, %A** %fooPtr, align 8 - %deref = load %A*, %A** %fooPtr, align 8 - call void @A(%A* %deref) + %fooPtr = alloca ptr, align 8 + store ptr null, ptr %fooPtr, align 8 + %deref = load ptr, ptr %fooPtr, align 8 + call void @A(ptr %deref) ret void } "#); diff --git a/src/codegen/tests/initialization_test/complex_initializers.rs b/src/codegen/tests/initialization_test/complex_initializers.rs index e77d1a97077..52ed1cc1926 100644 --- a/src/codegen/tests/initialization_test/complex_initializers.rs +++ b/src/codegen/tests/initialization_test/complex_initializers.rs @@ -23,13 +23,13 @@ fn simple_global() { target datalayout = "[filtered]" target triple = "[filtered]" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @s = global [81 x i8] c"hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" - @ps = global [81 x i8]* null + @ps = global ptr null define void @__init___Test() { entry: - store [81 x i8]* @s, [81 x i8]** @ps, align 8 + store ptr @s, ptr @ps, align 8 ret void } "#); @@ -56,13 +56,13 @@ fn global_alias() { target datalayout = "[filtered]" target triple = "[filtered]" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @s = global [81 x i8] c"hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" - @ps = global [81 x i8]* null + @ps = global ptr null define void @__init___Test() { entry: - store [81 x i8]* @s, [81 x i8]** @ps, align 8 + store ptr @s, ptr @ps, align 8 ret void } "#); @@ -89,13 +89,13 @@ fn global_reference_to() { target datalayout = "[filtered]" target triple = "[filtered]" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @s = global [81 x i8] c"hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" - @ps = global [81 x i8]* null + @ps = global ptr null define void @__init___Test() { entry: - store [81 x i8]* @s, [81 x i8]** @ps, align 8 + store ptr @s, ptr @ps, align 8 ret void } "#); @@ -127,39 +127,39 @@ fn init_functions_generated_for_programs() { target datalayout = "[filtered]" target triple = "[filtered]" - %PLC_PRG = type { [81 x i8]* } + %PLC_PRG = type { ptr } @s = global [81 x i8] zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @PLC_PRG_instance = global %PLC_PRG zeroinitializer - define void @PLC_PRG(%PLC_PRG* %0) { + define void @PLC_PRG(ptr %0) { entry: - %to_init = getelementptr inbounds %PLC_PRG, %PLC_PRG* %0, i32 0, i32 0 + %to_init = getelementptr inbounds %PLC_PRG, ptr %0, i32 0, i32 0 ret void } - define void @__init_plc_prg(%PLC_PRG* %0) { + define void @__init_plc_prg(ptr %0) { entry: - %self = alloca %PLC_PRG*, align 8 - store %PLC_PRG* %0, %PLC_PRG** %self, align 8 - %deref = load %PLC_PRG*, %PLC_PRG** %self, align 8 - %to_init = getelementptr inbounds %PLC_PRG, %PLC_PRG* %deref, i32 0, i32 0 - store [81 x i8]* @s, [81 x i8]** %to_init, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %to_init = getelementptr inbounds %PLC_PRG, ptr %deref, i32 0, i32 0 + store ptr @s, ptr %to_init, align 8 ret void } - define void @__user_init_PLC_PRG(%PLC_PRG* %0) { + define void @__user_init_PLC_PRG(ptr %0) { entry: - %self = alloca %PLC_PRG*, align 8 - store %PLC_PRG* %0, %PLC_PRG** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_plc_prg(%PLC_PRG* @PLC_PRG_instance) - call void @__user_init_PLC_PRG(%PLC_PRG* @PLC_PRG_instance) + call void @__init_plc_prg(ptr @PLC_PRG_instance) + call void @__user_init_PLC_PRG(ptr @PLC_PRG_instance) ret void } "#); @@ -275,65 +275,65 @@ fn init_functions_generated_for_function_blocks() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, [81 x i8]* } + %__vtable_foo = type { ptr } + %foo = type { ptr, ptr } @s = global [81 x i8] zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %to_init = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %to_init = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %to_init = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 1 - store [81 x i8]* @s, [81 x i8]** %to_init, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %to_init = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + store ptr @s, ptr %to_init, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -410,17 +410,17 @@ fn nested_initializer_pous() { target datalayout = "[filtered]" target triple = "[filtered]" - %mainProg = type { [81 x i8]*, %foo } - %foo = type { i32*, [81 x i8]*, %bar } - %bar = type { i32*, %baz } - %baz = type { i32*, [81 x i8]* } - %__vtable_baz = type { void (%baz*)* } - %__vtable_bar = type { void (%bar*)* } - %__vtable_foo = type { void (%foo*)* } - %sideProg = type { [81 x i8]*, %foo } + %mainProg = type { ptr, %foo } + %foo = type { ptr, ptr, %bar } + %bar = type { ptr, %baz } + %baz = type { ptr, ptr } + %__vtable_baz = type { ptr } + %__vtable_bar = type { ptr } + %__vtable_foo = type { ptr } + %sideProg = type { ptr, %foo } @str = global [81 x i8] c"hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @mainProg_instance = global %mainProg zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__bar__init = unnamed_addr constant %bar zeroinitializer @@ -433,259 +433,259 @@ fn nested_initializer_pous() { @__vtable_bar_instance = global %__vtable_bar zeroinitializer @__vtable_baz_instance = global %__vtable_baz zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - call void @bar__print(%bar* %b) - call void @bar(%bar* %b) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + call void @bar__print(ptr %b) + call void @bar(ptr %b) ret void } - define void @bar(%bar* %0) { + define void @bar(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 - %b = getelementptr inbounds %bar, %bar* %0, i32 0, i32 1 - call void @baz__print(%baz* %b) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %bar, ptr %0, i32 0, i32 1 + call void @baz__print(ptr %b) ret void } - define void @baz(%baz* %0) { + define void @baz(ptr %0) { entry: - %this = alloca %baz*, align 8 - store %baz* %0, %baz** %this, align 8 - %__vtable = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 ret void } - define void @mainProg(%mainProg* %0) { + define void @mainProg(ptr %0) { entry: - %other_ref_to_global = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 - %f = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 1 + %other_ref_to_global = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 1 ret void } - define void @sideProg(%sideProg* %0) { + define void @sideProg(ptr %0) { entry: - %other_ref_to_global = getelementptr inbounds %sideProg, %sideProg* %0, i32 0, i32 0 - %f = getelementptr inbounds %sideProg, %sideProg* %0, i32 0, i32 1 - call void @foo(%foo* %f) - call void @foo__print(%foo* %f) + %other_ref_to_global = getelementptr inbounds %sideProg, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds %sideProg, ptr %0, i32 0, i32 1 + call void @foo(ptr %f) + call void @foo__print(ptr %f) ret void } - define void @bar__print(%bar* %0) { + define void @bar__print(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 - %b = getelementptr inbounds %bar, %bar* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %bar, ptr %0, i32 0, i32 1 ret void } - define void @foo__print(%foo* %0) { + define void @foo__print(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 ret void } - define void @baz__print(%baz* %0) { + define void @baz__print(ptr %0) { entry: - %this = alloca %baz*, align 8 - store %baz* %0, %baz** %this, align 8 - %__vtable = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 ret void } - define void @__init___vtable_baz(%__vtable_baz* %0) { + define void @__init___vtable_baz(ptr %0) { entry: - %self = alloca %__vtable_baz*, align 8 - store %__vtable_baz* %0, %__vtable_baz** %self, align 8 - %deref = load %__vtable_baz*, %__vtable_baz** %self, align 8 - %__body = getelementptr inbounds %__vtable_baz, %__vtable_baz* %deref, i32 0, i32 0 - store void (%baz*)* @baz, void (%baz*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @baz, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %b = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 2 - call void @__init_bar(%bar* %b) - %deref1 = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref2 = load %foo*, %foo** %self, align 8 - %str_ref = getelementptr inbounds %foo, %foo* %deref2, i32 0, i32 1 - store [81 x i8]* @str, [81 x i8]** %str_ref, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %foo, ptr %deref, i32 0, i32 2 + call void @__init_bar(ptr %b) + %deref1 = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref2 = load ptr, ptr %self, align 8 + %str_ref = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + store ptr @str, ptr %str_ref, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %b = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 1 - call void @__init_baz(%baz* %b) - %deref1 = load %bar*, %bar** %self, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %deref1, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + call void @__init_baz(ptr %b) + %deref1 = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__init_baz(%baz* %0) { + define void @__init_baz(ptr %0) { entry: - %self = alloca %baz*, align 8 - store %baz* %0, %baz** %self, align 8 - %deref = load %baz*, %baz** %self, align 8 - %__vtable = getelementptr inbounds %baz, %baz* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_baz* @__vtable_baz_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %baz*, %baz** %self, align 8 - %str_ref = getelementptr inbounds %baz, %baz* %deref1, i32 0, i32 1 - store [81 x i8]* @str, [81 x i8]** %str_ref, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %baz, ptr %deref, i32 0, i32 0 + store ptr @__vtable_baz_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %str_ref = getelementptr inbounds %baz, ptr %deref1, i32 0, i32 1 + store ptr @str, ptr %str_ref, align 8 ret void } - define void @__init_mainprog(%mainProg* %0) { + define void @__init_mainprog(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 - %deref = load %mainProg*, %mainProg** %self, align 8 - %f = getelementptr inbounds %mainProg, %mainProg* %deref, i32 0, i32 1 - call void @__init_foo(%foo* %f) - %deref1 = load %mainProg*, %mainProg** %self, align 8 - %other_ref_to_global = getelementptr inbounds %mainProg, %mainProg* %deref1, i32 0, i32 0 - store [81 x i8]* @str, [81 x i8]** %other_ref_to_global, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + call void @__init_foo(ptr %f) + %deref1 = load ptr, ptr %self, align 8 + %other_ref_to_global = getelementptr inbounds %mainProg, ptr %deref1, i32 0, i32 0 + store ptr @str, ptr %other_ref_to_global, align 8 ret void } - define void @__init_sideprog(%sideProg* %0) { + define void @__init_sideprog(ptr %0) { entry: - %self = alloca %sideProg*, align 8 - store %sideProg* %0, %sideProg** %self, align 8 - %deref = load %sideProg*, %sideProg** %self, align 8 - %f = getelementptr inbounds %sideProg, %sideProg* %deref, i32 0, i32 1 - call void @__init_foo(%foo* %f) - %deref1 = load %sideProg*, %sideProg** %self, align 8 - %other_ref_to_global = getelementptr inbounds %sideProg, %sideProg* %deref1, i32 0, i32 0 - store [81 x i8]* @str, [81 x i8]** %other_ref_to_global, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + call void @__init_foo(ptr %f) + %deref1 = load ptr, ptr %self, align 8 + %other_ref_to_global = getelementptr inbounds %mainProg, ptr %deref1, i32 0, i32 0 + store ptr @str, ptr %other_ref_to_global, align 8 ret void } - define void @__user_init___vtable_baz(%__vtable_baz* %0) { + define void @__user_init___vtable_baz(ptr %0) { entry: - %self = alloca %__vtable_baz*, align 8 - store %__vtable_baz* %0, %__vtable_baz** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %b = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 1 - call void @__user_init_baz(%baz* %b) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + call void @__user_init_baz(ptr %b) ret void } - define void @__user_init_baz(%baz* %0) { + define void @__user_init_baz(ptr %0) { entry: - %self = alloca %baz*, align 8 - store %baz* %0, %baz** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_sideProg(%sideProg* %0) { + define void @__user_init_sideProg(ptr %0) { entry: - %self = alloca %sideProg*, align 8 - store %sideProg* %0, %sideProg** %self, align 8 - %deref = load %sideProg*, %sideProg** %self, align 8 - %f = getelementptr inbounds %sideProg, %sideProg* %deref, i32 0, i32 1 - call void @__user_init_foo(%foo* %f) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + call void @__user_init_foo(ptr %f) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %b = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 2 - call void @__user_init_bar(%bar* %b) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %foo, ptr %deref, i32 0, i32 2 + call void @__user_init_bar(ptr %b) ret void } - define void @__user_init_mainProg(%mainProg* %0) { + define void @__user_init_mainProg(ptr %0) { entry: - %self = alloca %mainProg*, align 8 - store %mainProg* %0, %mainProg** %self, align 8 - %deref = load %mainProg*, %mainProg** %self, align 8 - %f = getelementptr inbounds %mainProg, %mainProg* %deref, i32 0, i32 1 - call void @__user_init_foo(%foo* %f) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + call void @__user_init_foo(ptr %f) ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_mainprog(%mainProg* @mainProg_instance) - call void @__init_sideprog(%sideProg* @sideProg_instance) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__init___vtable_baz(%__vtable_baz* @__vtable_baz_instance) - call void @__user_init_mainProg(%mainProg* @mainProg_instance) - call void @__user_init_sideProg(%sideProg* @sideProg_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init___vtable_baz(%__vtable_baz* @__vtable_baz_instance) + call void @__init_mainprog(ptr @mainProg_instance) + call void @__init_sideprog(ptr @sideProg_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__init___vtable_baz(ptr @__vtable_baz_instance) + call void @__user_init_mainProg(ptr @mainProg_instance) + call void @__user_init_sideProg(ptr @sideProg_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init___vtable_baz(ptr @__vtable_baz_instance) ret void } "#); @@ -714,67 +714,67 @@ fn local_address() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, i16, i16* } + %__vtable_foo = type { ptr } + %foo = type { ptr, i16, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %i = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %pi = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %i = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %pi = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %pi = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 2 - %deref2 = load %foo*, %foo** %self, align 8 - %i = getelementptr inbounds %foo, %foo* %deref2, i32 0, i32 1 - store i16* %i, i16** %pi, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %pi = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %deref2 = load ptr, ptr %self, align 8 + %i = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + store ptr %i, ptr %pi, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -813,96 +813,95 @@ fn user_init_called_for_variables_on_stack() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32*, i16, i16* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr, i16, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %i = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %pi = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %i = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %pi = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 ret void } - define void @foo__FB_INIT(%foo* %0) { + define void @foo__FB_INIT(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %i = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %pi = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - store i16* %i, i16** %pi, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %i = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %pi = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + store ptr %i, ptr %pi, align 8 ret void } define void @main() { entry: %fb = alloca %foo, align 8 - %0 = bitcast %foo* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false) - call void @__init_foo(%foo* %fb) - call void @__user_init_foo(%foo* %fb) - call void @foo(%foo* %fb) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) + call void @__init_foo(ptr %fb) + call void @__user_init_foo(ptr %fb) + call void @foo(ptr %fb) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__FB_INIT, void (%foo*)** %FB_INIT, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - call void @foo__FB_INIT(%foo* %deref) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + call void @foo__FB_INIT(ptr %deref) ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -1009,74 +1008,74 @@ fn struct_types() { ) .unwrap(); - filtered_assert_snapshot!(res, @r###" + filtered_assert_snapshot!(res, @r#" ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" %prog = type { %myStruct } - %myStruct = type { [81 x i8]*, [2 x [81 x i8]]* } + %myStruct = type { ptr, ptr } @s = global [81 x i8] c"Hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" @s2 = global [2 x [81 x i8]] [[81 x i8] c"hello\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [81 x i8] c"world\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"] - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: - %str = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 + %str = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 ret void } - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 - %deref = load %myStruct*, %myStruct** %self, align 8 - %member = getelementptr inbounds %myStruct, %myStruct* %deref, i32 0, i32 0 - store [81 x i8]* @s, [81 x i8]** %member, align 8 - %deref1 = load %myStruct*, %myStruct** %self, align 8 - %member2 = getelementptr inbounds %myStruct, %myStruct* %deref1, i32 0, i32 1 - store [2 x [81 x i8]]* @s2, [2 x [81 x i8]]** %member2, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %member = getelementptr inbounds %myStruct, ptr %deref, i32 0, i32 0 + store ptr @s, ptr %member, align 8 + %deref1 = load ptr, ptr %self, align 8 + %member2 = getelementptr inbounds %myStruct, ptr %deref1, i32 0, i32 1 + store ptr @s2, ptr %member2, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %str = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__init_mystruct(%myStruct* %str) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__init_mystruct(ptr %str) ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %str = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__user_init_myStruct(%myStruct* %str) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__user_init_myStruct(ptr %str) ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__user_init_prog(%prog* @prog_instance) + call void @__init_prog(ptr @prog_instance) + call void @__user_init_prog(ptr @prog_instance) ret void } - "###); + "#); } #[test] @@ -1121,13 +1120,13 @@ fn stateful_pous_methods_and_structs_get_init_functions() { %myStruct = type { i32 } %prog = type {} - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } - %__vtable_cl = type { void (%cl*)* } - %cl = type { i32* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } + %__vtable_cl = type { ptr } + %cl = type { ptr } @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @@ -1136,147 +1135,147 @@ fn stateful_pous_methods_and_structs_get_init_functions() { @__cl__init = unnamed_addr constant %cl zeroinitializer @__vtable_cl_instance = global %__vtable_cl zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @foo__m(%foo* %0) { + define void @foo__m(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @cl__m(%cl* %0) { + define void @cl__m(ptr %0) { entry: - %__vtable = getelementptr inbounds %cl, %cl* %0, i32 0, i32 0 + %__vtable = getelementptr inbounds %cl, ptr %0, i32 0, i32 0 ret void } - define void @cl(%cl* %0) { + define void @cl(ptr %0) { entry: - %__vtable = getelementptr inbounds %cl, %cl* %0, i32 0, i32 0 + %__vtable = getelementptr inbounds %cl, ptr %0, i32 0, i32 0 ret void } - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: ret void } - define void @foo__act(%foo* %0) { + define void @foo__act(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %m = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__m, void (%foo*)** %m, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %m = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__m, ptr %m, align 8 ret void } - define void @__init___vtable_cl(%__vtable_cl* %0) { + define void @__init___vtable_cl(ptr %0) { entry: - %self = alloca %__vtable_cl*, align 8 - store %__vtable_cl* %0, %__vtable_cl** %self, align 8 - %deref = load %__vtable_cl*, %__vtable_cl** %self, align 8 - %m = getelementptr inbounds %__vtable_cl, %__vtable_cl* %deref, i32 0, i32 0 - store void (%cl*)* @cl__m, void (%cl*)** %m, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %m = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @cl__m, ptr %m, align 8 ret void } - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_cl(%cl* %0) { + define void @__init_cl(ptr %0) { entry: - %self = alloca %cl*, align 8 - store %cl* %0, %cl** %self, align 8 - %deref = load %cl*, %cl** %self, align 8 - %__vtable = getelementptr inbounds %cl, %cl* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_cl* @__vtable_cl_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_cl_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_cl(%__vtable_cl* %0) { + define void @__user_init___vtable_cl(ptr %0) { entry: - %self = alloca %__vtable_cl*, align 8 - store %__vtable_cl* %0, %__vtable_cl** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_cl(%__vtable_cl* @__vtable_cl_instance) - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_cl(%__vtable_cl* @__vtable_cl_instance) + call void @__init_prog(ptr @prog_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_cl(ptr @__vtable_cl_instance) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_cl(ptr @__vtable_cl_instance) ret void } "#); @@ -1314,91 +1313,91 @@ fn global_instance() { target triple = "[filtered]" %prog = type {} - %foo = type { i32*, [81 x i8]* } - %__vtable_foo = type { void (%foo*)* } + %foo = type { ptr, ptr } + %__vtable_foo = type { ptr } @ps = global [81 x i8] zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @fb = global %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: - call void @foo(%foo* @fb) + call void @foo(ptr @fb) ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %s = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 1 - store [81 x i8]* @ps, [81 x i8]** %s, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %s = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + store ptr @ps, ptr %s, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init_foo(%foo* @fb) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init_foo(%foo* @fb) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init_prog(ptr @prog_instance) + call void @__init_foo(ptr @fb) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init_foo(ptr @fb) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -1441,98 +1440,98 @@ fn aliased_types() { target triple = "[filtered]" %prog = type { %foo } - %foo = type { i32*, [81 x i8]* } - %__vtable_foo = type { void (%foo*)* } + %foo = type { ptr, ptr } + %__vtable_foo = type { ptr } @ps = global [81 x i8] zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @global_alias = global %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: - %fb = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - call void @foo(%foo* %fb) + %fb = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + call void @foo(ptr %fb) ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %s = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 1 - store [81 x i8]* @ps, [81 x i8]** %s, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %s = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + store ptr @ps, ptr %s, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %fb = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %fb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %fb = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %fb) ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %fb = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %fb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %fb = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %fb) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init_foo(%foo* @global_alias) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init_foo(%foo* @global_alias) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init_prog(ptr @prog_instance) + call void @__init_foo(ptr @global_alias) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init_foo(ptr @global_alias) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -1640,10 +1639,10 @@ fn var_config_aliased_variables_initialized() { target triple = "[filtered]" %prog = type { %FB, %FB } - %FB = type { i32*, i32* } - %__vtable_FB = type { void (%FB*)* } + %FB = type { ptr, ptr } + %__vtable_FB = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @__FB__init = unnamed_addr constant %FB zeroinitializer @____vtable_FB__init = unnamed_addr constant %__vtable_FB zeroinitializer @@ -1651,96 +1650,96 @@ fn var_config_aliased_variables_initialized() { @__PI_1_2_1 = global i32 0 @__PI_1_2_2 = global i32 0 - define void @FB(%FB* %0) { + define void @FB(ptr %0) { entry: - %this = alloca %FB*, align 8 - store %FB* %0, %FB** %this, align 8 - %__vtable = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 - %foo = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 + %foo = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 ret void } - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: - %instance1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %instance2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 + %instance1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %instance2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 ret void } - define void @__init___vtable_fb(%__vtable_FB* %0) { + define void @__init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_FB*, align 8 - store %__vtable_FB* %0, %__vtable_FB** %self, align 8 - %deref = load %__vtable_FB*, %__vtable_FB** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB, %__vtable_FB* %deref, i32 0, i32 0 - store void (%FB*)* @FB, void (%FB*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB, ptr %deref, i32 0, i32 0 + store ptr @FB, ptr %__body, align 8 ret void } - define void @__init_fb(%FB* %0) { + define void @__init_fb(ptr %0) { entry: - %self = alloca %FB*, align 8 - store %FB* %0, %FB** %self, align 8 - %deref = load %FB*, %FB** %self, align 8 - %__vtable = getelementptr inbounds %FB, %FB* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB* @__vtable_FB_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_instance, ptr %__vtable, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %instance1 = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__init_fb(%FB* %instance1) - %deref1 = load %prog*, %prog** %self, align 8 - %instance2 = getelementptr inbounds %prog, %prog* %deref1, i32 0, i32 1 - call void @__init_fb(%FB* %instance2) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %instance1 = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__init_fb(ptr %instance1) + %deref1 = load ptr, ptr %self, align 8 + %instance2 = getelementptr inbounds %prog, ptr %deref1, i32 0, i32 1 + call void @__init_fb(ptr %instance2) ret void } - define void @__user_init_FB(%FB* %0) { + define void @__user_init_FB(ptr %0) { entry: - %self = alloca %FB*, align 8 - store %FB* %0, %FB** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB(%__vtable_FB* %0) { + define void @__user_init___vtable_FB(ptr %0) { entry: - %self = alloca %__vtable_FB*, align 8 - store %__vtable_FB* %0, %__vtable_FB** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %instance1 = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__user_init_FB(%FB* %instance1) - %deref1 = load %prog*, %prog** %self, align 8 - %instance2 = getelementptr inbounds %prog, %prog* %deref1, i32 0, i32 1 - call void @__user_init_FB(%FB* %instance2) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %instance1 = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__user_init_FB(ptr %instance1) + %deref1 = load ptr, ptr %self, align 8 + %instance2 = getelementptr inbounds %prog, ptr %deref1, i32 0, i32 1 + call void @__user_init_FB(ptr %instance2) ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init___vtable_fb(%__vtable_FB* @__vtable_FB_instance) + call void @__init_prog(ptr @prog_instance) + call void @__init___vtable_fb(ptr @__vtable_FB_instance) call void @__init___var_config() - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init___vtable_FB(%__vtable_FB* @__vtable_FB_instance) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init___vtable_FB(ptr @__vtable_FB_instance) ret void } define void @__init___var_config() { entry: - store i32* @__PI_1_2_1, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0, i32 1), align 8 - store i32* @__PI_1_2_2, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1, i32 1), align 8 + store ptr @__PI_1_2_1, ptr getelementptr inbounds (%FB, ptr @prog_instance, i32 0, i32 1), align 8 + store ptr @__PI_1_2_2, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1, i32 1), align 8 ret void } "#); @@ -1778,21 +1777,21 @@ fn var_external_blocks_are_ignored_in_init_functions() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32* } + %__vtable_foo = type { ptr } + %foo = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer @s = global [81 x i8] zeroinitializer - @refString = global [81 x i8]* null + @refString = global ptr null - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } @@ -1801,45 +1800,45 @@ fn var_external_blocks_are_ignored_in_init_functions() { ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - store [81 x i8]* @s, [81 x i8]** @refString, align 8 - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + store ptr @s, ptr @refString, align 8 + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#) @@ -1869,79 +1868,79 @@ fn ref_to_local_member() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, [81 x i8], [81 x i8]*, [81 x i8]*, [81 x i8]* } + %__vtable_foo = type { ptr } + %foo = type { ptr, [81 x i8], ptr, ptr, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %ptr = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - %alias = getelementptr inbounds %foo, %foo* %0, i32 0, i32 3 - %reference_to = getelementptr inbounds %foo, %foo* %0, i32 0, i32 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %ptr = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %alias = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 + %reference_to = getelementptr inbounds %foo, ptr %0, i32 0, i32 4 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %ptr = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 2 - %deref2 = load %foo*, %foo** %self, align 8 - %s = getelementptr inbounds %foo, %foo* %deref2, i32 0, i32 1 - store [81 x i8]* %s, [81 x i8]** %ptr, align 8 - %deref3 = load %foo*, %foo** %self, align 8 - %alias = getelementptr inbounds %foo, %foo* %deref3, i32 0, i32 3 - %deref4 = load %foo*, %foo** %self, align 8 - %s5 = getelementptr inbounds %foo, %foo* %deref4, i32 0, i32 1 - store [81 x i8]* %s5, [81 x i8]** %alias, align 8 - %deref6 = load %foo*, %foo** %self, align 8 - %reference_to = getelementptr inbounds %foo, %foo* %deref6, i32 0, i32 4 - %deref7 = load %foo*, %foo** %self, align 8 - %s8 = getelementptr inbounds %foo, %foo* %deref7, i32 0, i32 1 - store [81 x i8]* %s8, [81 x i8]** %reference_to, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %ptr = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %deref2 = load ptr, ptr %self, align 8 + %s = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + store ptr %s, ptr %ptr, align 8 + %deref3 = load ptr, ptr %self, align 8 + %alias = getelementptr inbounds %foo, ptr %deref3, i32 0, i32 3 + %deref4 = load ptr, ptr %self, align 8 + %s5 = getelementptr inbounds %foo, ptr %deref4, i32 0, i32 1 + store ptr %s5, ptr %alias, align 8 + %deref6 = load ptr, ptr %self, align 8 + %reference_to = getelementptr inbounds %foo, ptr %deref6, i32 0, i32 4 + %deref7 = load ptr, ptr %self, align 8 + %s8 = getelementptr inbounds %foo, ptr %deref7, i32 0, i32 1 + store ptr %s8, ptr %reference_to, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#) @@ -1975,80 +1974,80 @@ fn ref_to_local_member_shadows_global() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, [81 x i8], [81 x i8]*, [81 x i8]*, [81 x i8]* } + %__vtable_foo = type { ptr } + %foo = type { ptr, [81 x i8], ptr, ptr, ptr } @s = global [81 x i8] zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %ptr = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - %alias = getelementptr inbounds %foo, %foo* %0, i32 0, i32 3 - %reference_to = getelementptr inbounds %foo, %foo* %0, i32 0, i32 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %ptr = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %alias = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 + %reference_to = getelementptr inbounds %foo, ptr %0, i32 0, i32 4 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %ptr = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 2 - %deref2 = load %foo*, %foo** %self, align 8 - %s = getelementptr inbounds %foo, %foo* %deref2, i32 0, i32 1 - store [81 x i8]* %s, [81 x i8]** %ptr, align 8 - %deref3 = load %foo*, %foo** %self, align 8 - %alias = getelementptr inbounds %foo, %foo* %deref3, i32 0, i32 3 - %deref4 = load %foo*, %foo** %self, align 8 - %s5 = getelementptr inbounds %foo, %foo* %deref4, i32 0, i32 1 - store [81 x i8]* %s5, [81 x i8]** %alias, align 8 - %deref6 = load %foo*, %foo** %self, align 8 - %reference_to = getelementptr inbounds %foo, %foo* %deref6, i32 0, i32 4 - %deref7 = load %foo*, %foo** %self, align 8 - %s8 = getelementptr inbounds %foo, %foo* %deref7, i32 0, i32 1 - store [81 x i8]* %s8, [81 x i8]** %reference_to, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %ptr = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %deref2 = load ptr, ptr %self, align 8 + %s = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + store ptr %s, ptr %ptr, align 8 + %deref3 = load ptr, ptr %self, align 8 + %alias = getelementptr inbounds %foo, ptr %deref3, i32 0, i32 3 + %deref4 = load ptr, ptr %self, align 8 + %s5 = getelementptr inbounds %foo, ptr %deref4, i32 0, i32 1 + store ptr %s5, ptr %alias, align 8 + %deref6 = load ptr, ptr %self, align 8 + %reference_to = getelementptr inbounds %foo, ptr %deref6, i32 0, i32 4 + %deref7 = load ptr, ptr %self, align 8 + %s8 = getelementptr inbounds %foo, ptr %deref7, i32 0, i32 1 + store ptr %s8, ptr %reference_to, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#) @@ -2080,70 +2079,70 @@ fn temporary_variable_ref_to_local_member() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, [81 x i8] } + %__vtable_foo = type { ptr } + %foo = type { ptr, [81 x i8] } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %ptr = alloca [81 x i8]*, align 8 - %alias = alloca [81 x i8]*, align 8 - %reference_to = alloca [81 x i8]*, align 8 - store [81 x i8]* %s, [81 x i8]** %ptr, align 8 - store [81 x i8]* null, [81 x i8]** %alias, align 8 - store [81 x i8]* null, [81 x i8]** %reference_to, align 8 - store [81 x i8]* %s, [81 x i8]** %ptr, align 8 - store [81 x i8]* %s, [81 x i8]** %alias, align 8 - store [81 x i8]* %s, [81 x i8]** %reference_to, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %ptr = alloca ptr, align 8 + %alias = alloca ptr, align 8 + %reference_to = alloca ptr, align 8 + store ptr %s, ptr %ptr, align 8 + store ptr null, ptr %alias, align 8 + store ptr null, ptr %reference_to, align 8 + store ptr %s, ptr %ptr, align 8 + store ptr %s, ptr %alias, align 8 + store ptr %s, ptr %reference_to, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#) @@ -2175,35 +2174,34 @@ fn temporary_variable_ref_to_temporary_variable() { target datalayout = "[filtered]" target triple = "[filtered]" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] define void @foo() { entry: - %ptr = alloca [81 x i8]*, align 8 - %alias = alloca [81 x i8]*, align 8 + %ptr = alloca ptr, align 8 + %alias = alloca ptr, align 8 %s = alloca [81 x i8], align 1 - %reference_to = alloca [81 x i8]*, align 8 - store [81 x i8]* %s, [81 x i8]** %ptr, align 8 - store [81 x i8]* null, [81 x i8]** %alias, align 8 - %0 = bitcast [81 x i8]* %s to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store [81 x i8]* null, [81 x i8]** %reference_to, align 8 - store [81 x i8]* %s, [81 x i8]** %ptr, align 8 - store [81 x i8]* %s, [81 x i8]** %alias, align 8 - %deref = load [81 x i8]*, [81 x i8]** %alias, align 8 - store [81 x i8]* %deref, [81 x i8]** %reference_to, align 8 + %reference_to = alloca ptr, align 8 + store ptr %s, ptr %ptr, align 8 + store ptr null, ptr %alias, align 8 + call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store ptr null, ptr %reference_to, align 8 + store ptr %s, ptr %ptr, align 8 + store ptr %s, ptr %alias, align 8 + %deref = load ptr, ptr %alias, align 8 + store ptr %deref, ptr %reference_to, align 8 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 define void @__init___Test() { entry: ret void } - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#) } @@ -2231,76 +2229,76 @@ fn initializing_method_variables_with_refs() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 - %px = alloca i32*, align 8 - store i32 10, i32* %x, align 4 - store i32* %x, i32** %px, align 8 - store i32* %x, i32** %px, align 8 + %px = alloca ptr, align 8 + store i32 10, ptr %x, align 4 + store ptr %x, ptr %px, align 8 + store ptr %x, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -2333,76 +2331,76 @@ fn initializing_method_variables_with_refs_referencing_parent_pou_variable() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32*, i32 } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr, i32 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer - @__foo__init = unnamed_addr constant %foo { i32* null, i32 5 } + @__foo__init = unnamed_addr constant %foo { ptr null, i32 5 } @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %px = alloca i32*, align 8 - store i32* %x, i32** %px, align 8 - store i32* %x, i32** %px, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %px = alloca ptr, align 8 + store ptr %x, ptr %px, align 8 + store ptr %x, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -2435,75 +2433,75 @@ fn initializing_method_variables_with_refs_referencing_global_variable() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } @x = global i32 0 - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %px = alloca i32*, align 8 - store i32* @x, i32** %px, align 8 - store i32* @x, i32** %px, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %px = alloca ptr, align 8 + store ptr @x, ptr %px, align 8 + store ptr @x, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -2537,77 +2535,77 @@ fn initializing_method_variables_with_refs_shadowing() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } @x = global i32 0 - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 - %px = alloca i32*, align 8 - store i32 0, i32* %x, align 4 - store i32* %x, i32** %px, align 8 - store i32* %x, i32** %px, align 8 + %px = alloca ptr, align 8 + store i32 0, ptr %x, align 4 + store ptr %x, ptr %px, align 8 + store ptr %x, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -2637,76 +2635,76 @@ fn initializing_method_variables_with_alias() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 - %px = alloca i32*, align 8 - store i32 0, i32* %x, align 4 - store i32* null, i32** %px, align 8 - store i32* %x, i32** %px, align 8 + %px = alloca ptr, align 8 + store i32 0, ptr %x, align 4 + store ptr null, ptr %px, align 8 + store ptr %x, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -2736,76 +2734,76 @@ fn initializing_method_variables_with_reference_to() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 - %px = alloca i32*, align 8 - store i32 0, i32* %x, align 4 - store i32* null, i32** %px, align 8 - store i32* %x, i32** %px, align 8 + %px = alloca ptr, align 8 + store i32 0, ptr %x, align 4 + store ptr null, ptr %px, align 8 + store ptr %x, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -2842,12 +2840,12 @@ fn methods_call_init_functions_for_their_members() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, i32, i32* } - %__vtable_bar = type { void (%bar*)*, void (%bar*)* } - %bar = type { i32* } + %__vtable_foo = type { ptr } + %foo = type { ptr, i32, ptr } + %__vtable_bar = type { ptr, ptr } + %bar = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -2855,126 +2853,125 @@ fn methods_call_init_functions_for_their_members() { @__bar__init = unnamed_addr constant %bar zeroinitializer @__vtable_bar_instance = global %__vtable_bar zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 ret void } - define void @bar(%bar* %0) { + define void @bar(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 ret void } - define void @bar__baz(%bar* %0) { + define void @bar__baz(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 %fb = alloca %foo, align 8 - %1 = bitcast %foo* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false) - call void @__init_foo(%foo* %fb) - call void @__user_init_foo(%foo* %fb) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) + call void @__init_foo(ptr %fb) + call void @__user_init_foo(ptr %fb) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 - %deref1 = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %baz = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref1, i32 0, i32 1 - store void (%bar*)* @bar__baz, void (%bar*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_bar, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_bar, ptr %deref1, i32 0, i32 1 + store ptr @bar__baz, ptr %baz, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %y = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 2 - %deref2 = load %foo*, %foo** %self, align 8 - %x = getelementptr inbounds %foo, %foo* %deref2, i32 0, i32 1 - store i32* %x, i32** %y, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %y = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %deref2 = load ptr, ptr %self, align 8 + %x = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + store ptr %x, ptr %y, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -3013,109 +3010,109 @@ fn user_fb_init_is_added_and_called_if_it_exists() { target triple = "[filtered]" %prog = type { %foo } - %foo = type { i32*, i16, i16 } - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } + %foo = type { ptr, i16, i16 } + %__vtable_foo = type { ptr, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 ret void } - define void @foo__FB_INIT(%foo* %0) { + define void @foo__FB_INIT(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - store i16 1, i16* %x, align 2 - store i16 2, i16* %y, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + store i16 1, ptr %x, align 2 + store i16 2, ptr %y, align 2 ret void } - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: - %f = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - call void @foo(%foo* %f) + %f = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + call void @foo(ptr %f) ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__FB_INIT, void (%foo*)** %FB_INIT, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %f = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %f) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %f) ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %f = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %f) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %f) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - call void @foo__FB_INIT(%foo* %deref) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + call void @foo__FB_INIT(ptr %deref) ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init_prog(ptr @prog_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -3167,10 +3164,10 @@ fn user_fb_init_in_global_struct() { %prog = type { %bar } %bar = type { %foo } - %foo = type { i32*, i16, i16 } - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } + %foo = type { ptr, i16, i16 } + %__vtable_foo = type { ptr, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @__bar__init = unnamed_addr constant %bar zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @@ -3178,123 +3175,123 @@ fn user_fb_init_in_global_struct() { @str = global %bar zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 ret void } - define void @foo__FB_INIT(%foo* %0) { + define void @foo__FB_INIT(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - store i16 1, i16* %x, align 2 - store i16 2, i16* %y, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + store i16 1, ptr %x, align 2 + store i16 2, ptr %y, align 2 ret void } - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: - %str = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %f = getelementptr inbounds %bar, %bar* %str, i32 0, i32 0 - call void @foo(%foo* %f) + %str = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds %bar, ptr %str, i32 0, i32 0 + call void @foo(ptr %f) ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__FB_INIT, void (%foo*)** %FB_INIT, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %f = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %f) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %f) ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %str = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__init_bar(%bar* %str) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__init_bar(ptr %str) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - call void @foo__FB_INIT(%foo* %deref) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + call void @foo__FB_INIT(ptr %deref) ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %f = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %f) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %f) ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %str = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__user_init_bar(%bar* %str) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__user_init_bar(ptr %str) ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init_bar(%bar* @str) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init_bar(%bar* @str) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init_prog(ptr @prog_instance) + call void @__init_bar(ptr @str) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init_bar(ptr @str) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -3334,78 +3331,78 @@ fn user_init_called_when_declared_as_external() { target triple = "[filtered]" %prog = type { %foo } - %foo = type { i32*, i16, i16 } - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } + %foo = type { ptr, i16, i16 } + %__vtable_foo = type { ptr, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @prog_instance = global %prog zeroinitializer @__foo__init = external unnamed_addr constant %foo @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - declare void @foo(%foo*) + declare void @foo(ptr) - declare void @foo__FB_INIT(%foo*) + declare void @foo__FB_INIT(ptr) - define void @prog(%prog* %0) { + define void @prog(ptr %0) { entry: - %f = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - call void @foo(%foo* %f) + %f = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + call void @foo(ptr %f) ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__FB_INIT, void (%foo*)** %FB_INIT, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } - define void @__init_prog(%prog* %0) { + define void @__init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_prog(%prog* %0) { + define void @__user_init_prog(ptr %0) { entry: - %self = alloca %prog*, align 8 - store %prog* %0, %prog** %self, align 8 - %deref = load %prog*, %prog** %self, align 8 - %f = getelementptr inbounds %prog, %prog* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %f) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %f = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %f) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - call void @foo__FB_INIT(%foo* %deref) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + call void @foo__FB_INIT(ptr %deref) ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_prog(%prog* @prog_instance) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init_prog(%prog* @prog_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init_prog(ptr @prog_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init_prog(ptr @prog_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); diff --git a/src/codegen/tests/initialization_test/global_initializers.rs b/src/codegen/tests/initialization_test/global_initializers.rs index 7d938acf756..5c309648496 100644 --- a/src/codegen/tests/initialization_test/global_initializers.rs +++ b/src/codegen/tests/initialization_test/global_initializers.rs @@ -176,9 +176,9 @@ fn external_pous_get_external_initializers() { @__ext_fb__init = external unnamed_addr constant %ext_fb @ext_prog_instance = external global %ext_prog - declare void @ext_fb(%ext_fb*) + declare void @ext_fb(ptr) - declare void @ext_prog(%ext_prog*) + declare void @ext_prog(ptr) "#); } diff --git a/src/codegen/tests/initialization_test/pou_initializers.rs b/src/codegen/tests/initialization_test/pou_initializers.rs index f96d777cfab..8e5caf52b20 100644 --- a/src/codegen/tests/initialization_test/pou_initializers.rs +++ b/src/codegen/tests/initialization_test/pou_initializers.rs @@ -433,10 +433,10 @@ fn unary_plus_in_initializer() { @g1 = unnamed_addr constant i16 5 @exp_instance = global %exp { i16 5, float 0x40091EB860000000 } - define void @exp(%exp* %0) { + define void @exp(ptr %0) { entry: - %x = getelementptr inbounds %exp, %exp* %0, i32 0, i32 0 - %y = getelementptr inbounds %exp, %exp* %0, i32 0, i32 1 + %x = getelementptr inbounds %exp, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %exp, ptr %0, i32 0, i32 1 ret void } "#); diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap index c04e311a11a..1833b5faab2 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/global_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -19,18 +18,16 @@ entry: %var1 = alloca i16, align 2 %cmd2 = alloca %commands, align 8 %var2 = alloca i16, align 2 - %0 = bitcast %commands* %cmd1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%commands, %commands* @__commands__init, i32 0, i32 0), i64 ptrtoint (%commands* getelementptr (%commands, %commands* null, i32 1) to i64), i1 false) - store i16 0, i16* %var1, align 2 - %1 = bitcast %commands* %cmd2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds (%commands, %commands* @__commands__init, i32 0, i32 0), i64 ptrtoint (%commands* getelementptr (%commands, %commands* null, i32 1) to i64), i1 false) - store i16 0, i16* %var2, align 2 - store i32 0, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %cmd1, ptr align 1 @__commands__init, i64 ptrtoint (ptr getelementptr (%commands, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %var1, align 2 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %cmd2, ptr align 1 @__commands__init, i64 ptrtoint (ptr getelementptr (%commands, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %var2, align 2 + store i32 0, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap index ce8d92f5d28..18b1eb22864 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/global_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -21,26 +20,21 @@ entry: %myArr1 = alloca [4 x i16], align 2 %cmd2 = alloca %commands, align 8 %myArr2 = alloca [4 x i16], align 2 - %0 = bitcast %commands* %cmd1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%commands, %commands* @__commands__init, i32 0, i32 0), i64 ptrtoint (%commands* getelementptr (%commands, %commands* null, i32 1) to i64), i1 false) - %1 = bitcast [81 x i8]* %myStr1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds ([81 x i8], [81 x i8]* @__main.myStr1__init, i32 0, i32 0), i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [4 x i16]* %myArr1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([4 x i16]* getelementptr ([4 x i16], [4 x i16]* null, i32 1) to i64), i1 false) - %3 = bitcast %commands* %cmd2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 getelementptr inbounds (%commands, %commands* @__commands__init, i32 0, i32 0), i64 ptrtoint (%commands* getelementptr (%commands, %commands* null, i32 1) to i64), i1 false) - %4 = bitcast [4 x i16]* %myArr2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %4, i8 0, i64 ptrtoint ([4 x i16]* getelementptr ([4 x i16], [4 x i16]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %cmd1, ptr align 1 @__commands__init, i64 ptrtoint (ptr getelementptr (%commands, ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %myStr1, ptr align 1 @__main.myStr1__init, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %myArr1, i8 0, i64 ptrtoint (ptr getelementptr ([4 x i16], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %cmd2, ptr align 1 @__commands__init, i64 ptrtoint (ptr getelementptr (%commands, ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %myArr2, i8 0, i64 ptrtoint (ptr getelementptr ([4 x i16], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap index 1acd99e16c7..bc007d1d400 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap @@ -14,16 +14,16 @@ target triple = "[filtered]" @__MyFB__init = unnamed_addr constant %MyFB { i16 77 } @prg_instance = global %prg { %MyFB { i16 77 } } -define void @MyFB(%MyFB* %0) { +define void @MyFB(ptr %0) { entry: - %this = alloca %MyFB*, align 8 - store %MyFB* %0, %MyFB** %this, align 8 - %x = getelementptr inbounds %MyFB, %MyFB* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyFB, ptr %0, i32 0, i32 0 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap index d26abd951ed..723d02d09b7 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap @@ -13,35 +13,32 @@ target triple = "[filtered]" @__fb__init = unnamed_addr constant %fb { i16 9 } @main_instance = global %main { %fb { i16 9 } } -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %a = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + %a = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void } -define i32 @func(%fb* %0) { +define i32 @func(ptr %0) { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 - %1 = bitcast %fb* %in to i8* - %2 = bitcast %fb* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%fb* getelementptr (%fb, %fb* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %in, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%fb, ptr null, i32 1) to i64), i1 false) %x = alloca %fb, align 8 - %3 = bitcast %fb* %x to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 bitcast (%fb* @__fb__init to i8*), i64 ptrtoint (%fb* getelementptr (%fb, %fb* null, i32 1) to i64), i1 false) - store i32 0, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %x, ptr align 1 @__fb__init, i64 ptrtoint (ptr getelementptr (%fb, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %fb0 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %call = call i32 @func(%fb* %fb0) + %fb0 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %call = call i32 @func(ptr %fb0) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap index 82110984c8a..f9f3de75beb 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,19 +12,18 @@ entry: %func = alloca i16, align 2 %int_var = alloca i16, align 2 %arr_var = alloca [4 x i32], align 4 - %ptr_var = alloca i32*, align 8 + %ptr_var = alloca ptr, align 8 %float_var = alloca float, align 4 - store i16 0, i16* %int_var, align 2 - %0 = bitcast [4 x i32]* %arr_var to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([4 x i32]* getelementptr ([4 x i32], [4 x i32]* null, i32 1) to i64), i1 false) - store i32* null, i32** %ptr_var, align 8 - store float 0.000000e+00, float* %float_var, align 4 - store i16 0, i16* %func, align 2 - %func_ret = load i16, i16* %func, align 2 + store i16 0, ptr %int_var, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %arr_var, i8 0, i64 ptrtoint (ptr getelementptr ([4 x i32], ptr null, i32 1) to i64), i1 false) + store ptr null, ptr %ptr_var, align 8 + store float 0.000000e+00, ptr %float_var, align 4 + store i16 0, ptr %func, align 2 + %func_ret = load i16, ptr %func, align 2 ret i16 %func_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap index 3295e130530..0eb4980d8f4 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__enum_variants_have_precedence_over_global_variables_in_inline_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -18,9 +17,9 @@ define i32 @foo() { entry: %foo = alloca i32, align 4 %position = alloca i32, align 4 - store i32 1, i32* %position, align 4 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 1, ptr %position, align 4 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } @@ -28,8 +27,8 @@ define i32 @bar() { entry: %bar = alloca i32, align 4 %position = alloca i32, align 4 - store i32 3, i32* %position, align 4 - store i32 0, i32* %bar, align 4 - %bar_ret = load i32, i32* %bar, align 4 + store i32 3, ptr %position, align 4 + store i32 0, ptr %bar, align 4 + %bar_ret = load i32, ptr %bar, align 4 ret i32 %bar_ret } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap index 800ab0b5993..9823693b393 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap @@ -13,36 +13,33 @@ target triple = "[filtered]" @__fb__init = unnamed_addr constant %fb zeroinitializer @main_instance = global %main zeroinitializer -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } -define i32 @func(%fb* %0) { +define i32 @func(ptr %0) { entry: %func = alloca i32, align 4 %in = alloca %fb, align 8 - %1 = bitcast %fb* %in to i8* - %2 = bitcast %fb* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%fb* getelementptr (%fb, %fb* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %in, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%fb, ptr null, i32 1) to i64), i1 false) %x = alloca %fb, align 8 - %3 = bitcast %fb* %x to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 bitcast (%fb* @__fb__init to i8*), i64 ptrtoint (%fb* getelementptr (%fb, %fb* null, i32 1) to i64), i1 false) - store i32 0, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %x, ptr align 1 @__fb__init, i64 ptrtoint (ptr getelementptr (%fb, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %fb0 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %call = call i32 @func(%fb* %fb0) + %fb0 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %call = call i32 @func(ptr %fb0) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap index 8c76c815776..f06d3556b08 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,28 +14,28 @@ target triple = "[filtered]" define i16 @foo_int() { entry: %foo_int = alloca i16, align 2 - store i16 0, i16* %foo_int, align 2 - %foo_int_ret = load i16, i16* %foo_int, align 2 + store i16 0, ptr %foo_int, align 2 + %foo_int_ret = load i16, ptr %foo_int, align 2 ret i16 %foo_int_ret } -define void @foo_str(i8* %0) { +define void @foo_str(ptr %0) { entry: - %foo_str = alloca i8*, align 8 - store i8* %0, i8** %foo_str, align 8 + %foo_str = alloca ptr, align 8 + store ptr %0, ptr %foo_str, align 8 ret void } -define void @foo_arr(float* %0) { +define void @foo_arr(ptr %0) { entry: - %foo_arr = alloca float*, align 8 - store float* %0, float** %foo_arr, align 8 + %foo_arr = alloca ptr, align 8 + store ptr %0, ptr %foo_arr, align 8 ret void } -define void @foo_struct(%MyStruct* %0) { +define void @foo_struct(ptr %0) { entry: - %foo_struct = alloca %MyStruct*, align 8 - store %MyStruct* %0, %MyStruct** %foo_struct, align 8 + %foo_struct = alloca ptr, align 8 + store ptr %0, ptr %foo_struct, align 8 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap index 5db2a0fb45a..2688a2cf9cd 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,35 +12,29 @@ target triple = "[filtered]" @__myArray__init = unnamed_addr constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] @main_instance = global %main zeroinitializer -define void @target(i32* %0) { +define void @target(ptr %0) { entry: - %target = alloca i32*, align 8 - store i32* %0, i32** %target, align 8 - %deref = load i32*, i32** %target, align 8 - %tmpVar = getelementptr inbounds i32, i32* %deref, i32 2 - store i32 7, i32* %tmpVar, align 4 + %target = alloca ptr, align 8 + store ptr %0, ptr %target, align 8 + %deref = load ptr, ptr %target, align 8 + %tmpVar = getelementptr inbounds [4 x i32], ptr %deref, i32 0, i32 2 + store i32 7, ptr %tmpVar, align 4 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 %__target0 = alloca [4 x i32], align 4 - %1 = bitcast [4 x i32]* %__target0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast ([4 x i32]* @__myArray__init to i8*), i64 ptrtoint ([4 x i32]* getelementptr ([4 x i32], [4 x i32]* null, i32 1) to i64), i1 false) - %2 = bitcast [4 x i32]* %__target0 to i32* - call void @target(i32* %2) - %3 = bitcast [4 x i32]* %x to i8* - %4 = bitcast [4 x i32]* %__target0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %4, i64 ptrtoint ([4 x i32]* getelementptr ([4 x i32], [4 x i32]* null, i32 1) to i64), i1 false) - %5 = bitcast [4 x i32]* %y to i8* - %6 = bitcast [4 x i32]* %x to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %6, i64 ptrtoint ([4 x i32]* getelementptr ([4 x i32], [4 x i32]* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %__target0, ptr align 1 @__myArray__init, i64 ptrtoint (ptr getelementptr ([4 x i32], ptr null, i32 1) to i64), i1 false) + call void @target(ptr %__target0) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %x, ptr align 1 %__target0, i64 ptrtoint (ptr getelementptr ([4 x i32], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %y, ptr align 1 %x, i64 ptrtoint (ptr getelementptr ([4 x i32], ptr null, i32 1) to i64), i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap index 20e141eb873..01344c17707 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_with_initializers_is_initialized.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,28 +16,28 @@ target triple = "[filtered]" define i16 @foo_int() { entry: %foo_int = alloca i16, align 2 - store i16 7, i16* %foo_int, align 2 - %foo_int_ret = load i16, i16* %foo_int, align 2 + store i16 7, ptr %foo_int, align 2 + %foo_int_ret = load i16, ptr %foo_int, align 2 ret i16 %foo_int_ret } -define void @foo_str(i8* %0) { +define void @foo_str(ptr %0) { entry: - %foo_str = alloca i8*, align 8 - store i8* %0, i8** %foo_str, align 8 + %foo_str = alloca ptr, align 8 + store ptr %0, ptr %foo_str, align 8 ret void } -define void @foo_arr(float* %0) { +define void @foo_arr(ptr %0) { entry: - %foo_arr = alloca float*, align 8 - store float* %0, float** %foo_arr, align 8 + %foo_arr = alloca ptr, align 8 + store ptr %0, ptr %foo_arr, align 8 ret void } -define void @foo_strct(%MyStrct* %0) { +define void @foo_strct(ptr %0) { entry: - %foo_strct = alloca %MyStrct*, align 8 - store %MyStrct* %0, %MyStrct** %foo_strct, align 8 + %foo_strct = alloca ptr, align 8 + store ptr %0, ptr %foo_strct, align 8 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap index 40e78b4b550..f84a888974d 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_without_initializers_is_initialized.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,28 +14,28 @@ target triple = "[filtered]" define i16 @foo_int() { entry: %foo_int = alloca i16, align 2 - store i16 0, i16* %foo_int, align 2 - %foo_int_ret = load i16, i16* %foo_int, align 2 + store i16 0, ptr %foo_int, align 2 + %foo_int_ret = load i16, ptr %foo_int, align 2 ret i16 %foo_int_ret } -define void @foo_str(i8* %0) { +define void @foo_str(ptr %0) { entry: - %foo_str = alloca i8*, align 8 - store i8* %0, i8** %foo_str, align 8 + %foo_str = alloca ptr, align 8 + store ptr %0, ptr %foo_str, align 8 ret void } -define void @foo_arr(float* %0) { +define void @foo_arr(ptr %0) { entry: - %foo_arr = alloca float*, align 8 - store float* %0, float** %foo_arr, align 8 + %foo_arr = alloca ptr, align 8 + store ptr %0, ptr %foo_arr, align 8 ret void } -define void @foo_strct(%MyStrct* %0) { +define void @foo_strct(ptr %0) { entry: - %foo_strct = alloca %MyStrct*, align 8 - store %MyStrct* %0, %MyStrct** %foo_strct, align 8 + %foo_strct = alloca ptr, align 8 + store ptr %0, ptr %foo_strct, align 8 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap index d2b524743d1..5139ac5dc0c 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,9 +14,9 @@ target triple = "[filtered]" @LEN = unnamed_addr constant i16 20 @prg_instance = global %prg { i16 24, i16 89 } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %my_len = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %my_size = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 + %my_len = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %my_size = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap index c78e541faea..8e4b6e8b0cc 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap @@ -13,21 +13,21 @@ target triple = "[filtered]" @__FB__init = unnamed_addr constant %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } @main_instance = global %main { %FB { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } } -define void @FB(%FB* %0) { +define void @FB(ptr %0) { entry: - %this = alloca %FB*, align 8 - store %FB* %0, %FB** %this, align 8 - %x = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 - %xx = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 - %y = getelementptr inbounds %FB, %FB* %0, i32 0, i32 2 - %yy = getelementptr inbounds %FB, %FB* %0, i32 0, i32 3 - %z = getelementptr inbounds %FB, %FB* %0, i32 0, i32 4 - %zz = getelementptr inbounds %FB, %FB* %0, i32 0, i32 5 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 + %xx = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %FB, ptr %0, i32 0, i32 2 + %yy = getelementptr inbounds %FB, ptr %0, i32 0, i32 3 + %z = getelementptr inbounds %FB, ptr %0, i32 0, i32 4 + %zz = getelementptr inbounds %FB, ptr %0, i32 0, i32 5 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %fb = getelementptr inbounds %main, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap index 047dee80860..1dff99f3bdd 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,13 +11,13 @@ target triple = "[filtered]" @Main_instance = global %Main { i16 7, i16 0, i8 1, i8 0, float 0x400921CAC0000000, float 0.000000e+00 } -define void @Main(%Main* %0) { +define void @Main(ptr %0) { entry: - %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 - %xx = getelementptr inbounds %Main, %Main* %0, i32 0, i32 1 - %y = getelementptr inbounds %Main, %Main* %0, i32 0, i32 2 - %yy = getelementptr inbounds %Main, %Main* %0, i32 0, i32 3 - %z = getelementptr inbounds %Main, %Main* %0, i32 0, i32 4 - %zz = getelementptr inbounds %Main, %Main* %0, i32 0, i32 5 + %x = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 + %xx = getelementptr inbounds %Main, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %Main, ptr %0, i32 0, i32 2 + %yy = getelementptr inbounds %Main, ptr %0, i32 0, i32 3 + %z = getelementptr inbounds %Main, ptr %0, i32 0, i32 4 + %zz = getelementptr inbounds %Main, ptr %0, i32 0, i32 5 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap index 594fa0ff463..8d150aafb54 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,14 +13,13 @@ define i16 @func() { entry: %func = alloca i16, align 2 %arr_var = alloca [4 x i32], align 4 - %0 = bitcast [4 x i32]* %arr_var to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast ([4 x i32]* @__func.arr_var__init to i8*), i64 ptrtoint ([4 x i32]* getelementptr ([4 x i32], [4 x i32]* null, i32 1) to i64), i1 false) - store i16 0, i16* %func, align 2 - %func_ret = load i16, i16* %func, align 2 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr_var, ptr align 1 @__func.arr_var__init, i64 ptrtoint (ptr getelementptr ([4 x i32], ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %func, align 2 + %func_ret = load i16, ptr %func, align 2 ret i16 %func_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap index 306a8877cae..1461a446685 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,14 +13,13 @@ define i16 @func() { entry: %func = alloca i16, align 2 %arr_var = alloca [4 x i32], align 4 - %0 = bitcast [4 x i32]* %arr_var to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast ([4 x i32]* @__arr__init to i8*), i64 ptrtoint ([4 x i32]* getelementptr ([4 x i32], [4 x i32]* null, i32 1) to i64), i1 false) - store i16 0, i16* %func, align 2 - %func_ret = load i16, i16* %func, align 2 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr_var, ptr align 1 @__arr__init, i64 ptrtoint (ptr getelementptr ([4 x i32], ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %func, align 2 + %func_ret = load i16, ptr %func, align 2 ret i16 %func_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap index 9c578cb06d5..ab467ffc588 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,14 +15,13 @@ define i16 @func() { entry: %func = alloca i16, align 2 %a = alloca %__func_a, align 8 - %0 = bitcast %__func_a* %a to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%__func_a* @____func_a__init to i8*), i64 ptrtoint (%__func_a* getelementptr (%__func_a, %__func_a* null, i32 1) to i64), i1 false) - store i16 0, i16* %func, align 2 - %func_ret = load i16, i16* %func, align 2 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a, ptr align 1 @____func_a__init, i64 ptrtoint (ptr getelementptr (%__func_a, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %func, align 2 + %func_ret = load i16, ptr %func, align 2 ret i16 %func_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap index e2593cbb2b0..548a716eb78 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,8 +13,8 @@ target triple = "[filtered]" @prog_instance = global %prog zeroinitializer @____prog_a__init = unnamed_addr constant %__prog_a zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %a = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 + %a = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap index 9fc1942d953..ed9e9a4ab6e 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_are_referenced_correctly.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,9 +16,9 @@ define i32 @foo() { entry: %foo = alloca i32, align 4 %position = alloca i32, align 4 - store i32 1, i32* %position, align 4 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 1, ptr %position, align 4 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } @@ -27,8 +26,8 @@ define i32 @bar() { entry: %bar = alloca i32, align 4 %position = alloca i32, align 4 - store i32 3, i32* %position, align 4 - store i32 0, i32* %bar, align 4 - %bar_ret = load i32, i32* %bar, align 4 + store i32 3, ptr %position, align 4 + store i32 0, ptr %bar, align 4 + %bar_ret = load i32, ptr %bar, align 4 ret i32 %bar_ret } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap index 2f41a64a136..e66aa255816 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__two_identical_enums_in_different_functions_with_similar_names_are_referenced_correctly.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/pou_initializers.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -21,9 +20,9 @@ define i32 @a() { entry: %a = alloca i32, align 4 %position = alloca i32, align 4 - store i32 1, i32* %position, align 4 - store i32 0, i32* %a, align 4 - %a_ret = load i32, i32* %a, align 4 + store i32 1, ptr %position, align 4 + store i32 0, ptr %a, align 4 + %a_ret = load i32, ptr %a, align 4 ret i32 %a_ret } @@ -31,9 +30,9 @@ define i32 @aa() { entry: %aa = alloca i32, align 4 %position = alloca i32, align 4 - store i32 2, i32* %position, align 4 - store i32 0, i32* %aa, align 4 - %aa_ret = load i32, i32* %aa, align 4 + store i32 2, ptr %position, align 4 + store i32 0, ptr %aa, align 4 + %aa_ret = load i32, ptr %aa, align 4 ret i32 %aa_ret } @@ -41,9 +40,9 @@ define i32 @bb() { entry: %bb = alloca i32, align 4 %position = alloca i32, align 4 - store i32 3, i32* %position, align 4 - store i32 0, i32* %bb, align 4 - %bb_ret = load i32, i32* %bb, align 4 + store i32 3, ptr %position, align 4 + store i32 0, ptr %bb, align 4 + %bb_ret = load i32, ptr %bb, align 4 ret i32 %bb_ret } @@ -51,8 +50,8 @@ define i32 @b() { entry: %b = alloca i32, align 4 %position = alloca i32, align 4 - store i32 4, i32* %position, align 4 - store i32 0, i32* %b, align 4 - %b_ret = load i32, i32* %b, align 4 + store i32 4, ptr %position, align 4 + store i32 0, ptr %b, align 4 + %b_ret = load i32, ptr %b, align 4 ret i32 %b_ret } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap index a6d10041c8c..ad173b1a666 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -19,9 +18,9 @@ target triple = "[filtered]" @__main.arr__init = unnamed_addr constant [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }] @__main.alias_arr__init = unnamed_addr constant [2 x %myStruct] [%myStruct { i32 10, i32 20, [2 x i32] [i32 30, i32 40] }, %myStruct { i32 50, i32 60, [2 x i32] [i32 70, i32 80] }] -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %arr = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %alias_arr = getelementptr inbounds %main, %main* %0, i32 0, i32 1 + %arr = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %alias_arr = getelementptr inbounds %main, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap index dc3bc47dfde..57db53c08ce 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__enums_with_inline_initializer_are_initialized.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -31,11 +30,11 @@ entry: %var1 = alloca i32, align 4 %var2 = alloca i32, align 4 %var3 = alloca i32, align 4 - store i32 2, i32* %y, align 4 - store i32 1, i32* %var1, align 4 - store i32 2, i32* %var2, align 4 - store i32 1, i32* %var3, align 4 - store i32 0, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 2, ptr %y, align 4 + store i32 1, ptr %var1, align 4 + store i32 2, ptr %var2, align 4 + store i32 1, ptr %var3, align 4 + store i32 0, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap index c809b92bf77..0a66f807c46 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap @@ -15,19 +15,19 @@ target triple = "[filtered]" @__main.struct1__init = unnamed_addr constant %TON { i16 10, i16 17 } @__main.struct2__init = unnamed_addr constant %TON { i16 17, i16 10 } -define void @TON(%TON* %0) { +define void @TON(ptr %0) { entry: - %this = alloca %TON*, align 8 - store %TON* %0, %TON** %this, align 8 - %a = getelementptr inbounds %TON, %TON* %0, i32 0, i32 0 - %b = getelementptr inbounds %TON, %TON* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %a = getelementptr inbounds %TON, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %TON, ptr %0, i32 0, i32 1 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %TEN = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %struct1 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %struct2 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 + %TEN = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %struct1 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %struct2 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap index 5e0aa84b2f9..396027f087f 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/initialization_test/type_initializers.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,8 +16,8 @@ target triple = "[filtered]" @__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer @__main.var_init1__init = unnamed_addr constant [3 x %STRUCT1] [%STRUCT1 { i32 0, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 2, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 1 }, %STRUCT2 zeroinitializer] }, %STRUCT1 { i32 1, [2 x %STRUCT2] [%STRUCT2 { i32 1, i32 0 }, %STRUCT2 { i32 0, i32 2 }] }] -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var_init1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %var_init1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/online_change_tests.rs b/src/codegen/tests/online_change_tests.rs deleted file mode 100644 index 9c2ee6064c3..00000000000 --- a/src/codegen/tests/online_change_tests.rs +++ /dev/null @@ -1,145 +0,0 @@ -use plc_util::filtered_assert_snapshot; - -use crate::test_utils::tests::codegen_with_online_change as codegen; - -#[test] -#[cfg_attr(target_os = "macos", ignore)] -fn generate_function_with_online_change() { - let src = codegen( - " - FUNCTION foo : DINT - VAR - x : DINT; - END_VAR - END_FUNCTION - ", - ); - filtered_assert_snapshot!(src, @r#" - ; ModuleID = '' - source_filename = "" - target datalayout = "[filtered]" - target triple = "[filtered]" - - @__custom_got = weak_odr global [2 x i8*] zeroinitializer - - define i32 @foo() section "$RUSTY$fn-foo:i32[]" { - entry: - %foo = alloca i32, align 4 - %x = alloca i32, align 4 - store i32 0, i32* %x, align 4 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 - ret i32 %foo_ret - } - "#) -} - -#[test] -#[cfg_attr(target_os = "macos", ignore)] -fn generate_program_with_online_change() { - let src = codegen( - " - PROGRAM prg - VAR - x : DINT; - END_VAR - END_PROGRAM - ", - ); - filtered_assert_snapshot!(src, @r#" - ; ModuleID = '' - source_filename = "" - target datalayout = "[filtered]" - target triple = "[filtered]" - - %prg = type { i32 } - - @prg_instance = global %prg zeroinitializer, section "$RUSTY$var-prg_instance:r1i32" - @__custom_got = weak_odr global [6 x i8*] zeroinitializer - - define void @prg(%prg* %0) section "$RUSTY$fn-prg:v[]" { - entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - ret void - } - "#) -} - -#[test] -#[cfg_attr(target_os = "macos", ignore)] -fn generate_program_and_var_with_online_change() { - let src = codegen( - " - PROGRAM prg - VAR - x : DINT; - END_VAR - gV := x; - END_PROGRAM - VAR_GLOBAL - gV : DINT; - END_VAR - ", - ); - filtered_assert_snapshot!(src, @r#" - ; ModuleID = '' - source_filename = "" - target datalayout = "[filtered]" - target triple = "[filtered]" - - %prg = type { i32 } - - @gV = global i32 0, section "$RUSTY$var-gv:i32" - @prg_instance = global %prg zeroinitializer, section "$RUSTY$var-prg_instance:r1i32" - @__custom_got = weak_odr global [8 x i8*] zeroinitializer - - define void @prg(%prg* %0) section "$RUSTY$fn-prg:v[]" { - entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %1 = load i32*, i32** getelementptr inbounds (i32*, i32** inttoptr (i64 -2401053092612145152 to i32**), i32 1), align 8 - %load_x = load i32, i32* %x, align 4 - store i32 %load_x, i32* %1, align 4 - ret void - } - "#) -} - -#[test] -#[cfg_attr(target_os = "macos", ignore)] -fn generate_function_and_var_with_online_change() { - let src = codegen( - " - FUNCTION foo : DINT - VAR - x : DINT; - END_VAR - gV := x; - END_FUNCTION - VAR_GLOBAL - gV : DINT; - END_VAR - ", - ); - filtered_assert_snapshot!(src, @r#" - ; ModuleID = '' - source_filename = "" - target datalayout = "[filtered]" - target triple = "[filtered]" - - @gV = global i32 0, section "$RUSTY$var-gv:i32" - @__custom_got = weak_odr global [4 x i8*] zeroinitializer - - define i32 @foo() section "$RUSTY$fn-foo:i32[]" { - entry: - %foo = alloca i32, align 4 - %x = alloca i32, align 4 - store i32 0, i32* %x, align 4 - store i32 0, i32* %foo, align 4 - %0 = load i32*, i32** getelementptr inbounds (i32*, i32** inttoptr (i64 -2401053092612145152 to i32**), i32 1), align 8 - %load_x = load i32, i32* %x, align 4 - store i32 %load_x, i32* %0, align 4 - %foo_ret = load i32, i32* %foo, align 4 - ret i32 %foo_ret - } - "#) -} diff --git a/src/codegen/tests/oop_tests.rs b/src/codegen/tests/oop_tests.rs index f8e84dc9a47..e824392448f 100644 --- a/src/codegen/tests/oop_tests.rs +++ b/src/codegen/tests/oop_tests.rs @@ -25,12 +25,12 @@ fn members_from_base_class_are_available_in_subclasses() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, i16, [81 x i8], [11 x [81 x i8]] } - %__vtable_bar = type { void (%bar*)* } + %__vtable_foo = type { ptr } + %foo = type { ptr, i16, [81 x i8], [11 x [81 x i8]] } + %__vtable_bar = type { ptr } %bar = type { %foo } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -38,106 +38,106 @@ fn members_from_base_class_are_available_in_subclasses() { @__bar__init = unnamed_addr constant %bar zeroinitializer @__vtable_bar_instance = global %__vtable_bar zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %a = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - %c = getelementptr inbounds %foo, %foo* %0, i32 0, i32 3 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 ret void } - define void @bar(%bar* %0) { + define void @bar(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__foo = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %__foo) - %deref1 = load %bar*, %bar** %self, align 8 - %__foo2 = getelementptr inbounds %bar, %bar* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo2, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %__foo) + %deref1 = load ptr, ptr %self, align 8 + %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %__foo) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %__foo) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) ret void } "#); @@ -172,14 +172,14 @@ fn write_to_parent_variable_qualified_access() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_fb = type { void (%fb*)* } - %fb = type { i32*, i16, i16 } - %__vtable_fb2 = type { void (%fb2*)* } + %__vtable_fb = type { ptr } + %fb = type { ptr, i16, i16 } + %__vtable_fb2 = type { ptr } %fb2 = type { %fb } - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, %fb2 } + %__vtable_foo = type { ptr } + %foo = type { ptr, %fb2 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_fb__init = unnamed_addr constant %__vtable_fb zeroinitializer @__fb__init = unnamed_addr constant %fb zeroinitializer @__vtable_fb_instance = global %__vtable_fb zeroinitializer @@ -190,159 +190,159 @@ fn write_to_parent_variable_qualified_access() { @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @fb(%fb* %0) { + define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 - %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 1 - %y = getelementptr inbounds %fb, %fb* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %fb, ptr %0, i32 0, i32 2 ret void } - define void @fb2(%fb2* %0) { + define void @fb2(ptr %0) { entry: - %this = alloca %fb2*, align 8 - store %fb2* %0, %fb2** %this, align 8 - %__fb = getelementptr inbounds %fb2, %fb2* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__fb = getelementptr inbounds %fb2, ptr %0, i32 0, i32 0 ret void } - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %myFb = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %__fb = getelementptr inbounds %fb2, %fb2* %myFb, i32 0, i32 0 - %x = getelementptr inbounds %fb, %fb* %__fb, i32 0, i32 1 - store i16 1, i16* %x, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %myFb = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__fb = getelementptr inbounds %fb2, ptr %myFb, i32 0, i32 0 + %x = getelementptr inbounds %fb, ptr %__fb, i32 0, i32 1 + store i16 1, ptr %x, align 2 ret void } - define void @__init___vtable_fb(%__vtable_fb* %0) { + define void @__init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 - %deref = load %__vtable_fb*, %__vtable_fb** %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, %__vtable_fb* %deref, i32 0, i32 0 - store void (%fb*)* @fb, void (%fb*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @fb, ptr %__body, align 8 ret void } - define void @__init___vtable_fb2(%__vtable_fb2* %0) { + define void @__init___vtable_fb2(ptr %0) { entry: - %self = alloca %__vtable_fb2*, align 8 - store %__vtable_fb2* %0, %__vtable_fb2** %self, align 8 - %deref = load %__vtable_fb2*, %__vtable_fb2** %self, align 8 - %__body = getelementptr inbounds %__vtable_fb2, %__vtable_fb2* %deref, i32 0, i32 0 - store void (%fb2*)* @fb2, void (%fb2*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @fb2, ptr %__body, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_fb2(%fb2* %0) { + define void @__init_fb2(ptr %0) { entry: - %self = alloca %fb2*, align 8 - store %fb2* %0, %fb2** %self, align 8 - %deref = load %fb2*, %fb2** %self, align 8 - %__fb = getelementptr inbounds %fb2, %fb2* %deref, i32 0, i32 0 - call void @__init_fb(%fb* %__fb) - %deref1 = load %fb2*, %fb2** %self, align 8 - %__fb2 = getelementptr inbounds %fb2, %fb2* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %fb, %fb* %__fb2, i32 0, i32 0 - store i32* bitcast (%__vtable_fb2* @__vtable_fb2_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + call void @__init_fb(ptr %__fb) + %deref1 = load ptr, ptr %self, align 8 + %__fb2 = getelementptr inbounds %fb2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %fb, ptr %__fb2, i32 0, i32 0 + store ptr @__vtable_fb2_instance, ptr %__vtable, align 8 ret void } - define void @__init_fb(%fb* %0) { + define void @__init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 - %deref = load %fb*, %fb** %self, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_fb* @__vtable_fb_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %myFb = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 1 - call void @__init_fb2(%fb2* %myFb) - %deref1 = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + call void @__init_fb2(ptr %myFb) + %deref1 = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_fb(%fb* %0) { + define void @__user_init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_fb2(%fb2* %0) { + define void @__user_init_fb2(ptr %0) { entry: - %self = alloca %fb2*, align 8 - store %fb2* %0, %fb2** %self, align 8 - %deref = load %fb2*, %fb2** %self, align 8 - %__fb = getelementptr inbounds %fb2, %fb2* %deref, i32 0, i32 0 - call void @__user_init_fb(%fb* %__fb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + call void @__user_init_fb(ptr %__fb) ret void } - define void @__user_init___vtable_fb(%__vtable_fb* %0) { + define void @__user_init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_fb2(%__vtable_fb2* %0) { + define void @__user_init___vtable_fb2(ptr %0) { entry: - %self = alloca %__vtable_fb2*, align 8 - store %__vtable_fb2* %0, %__vtable_fb2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %myFb = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 1 - call void @__user_init_fb2(%fb2* %myFb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + call void @__user_init_fb2(ptr %myFb) ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) - call void @__init___vtable_fb2(%__vtable_fb2* @__vtable_fb2_instance) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) - call void @__user_init___vtable_fb2(%__vtable_fb2* @__vtable_fb2_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_fb(ptr @__vtable_fb_instance) + call void @__init___vtable_fb2(ptr @__vtable_fb2_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_fb(ptr @__vtable_fb_instance) + call void @__user_init___vtable_fb2(ptr @__vtable_fb2_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -381,14 +381,14 @@ fn write_to_parent_variable_in_instance() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32*, [81 x i8] } - %__vtable_bar = type { void (%bar*)*, void (%foo*)* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr, [81 x i8] } + %__vtable_bar = type { ptr, ptr } %bar = type { %foo } @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"world\00" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -396,34 +396,32 @@ fn write_to_parent_variable_in_instance() { @__bar__init = unnamed_addr constant %bar zeroinitializer @__vtable_bar_instance = global %__vtable_bar zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @foo__baz(%foo* %0) { + define void @foo__baz(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false) ret void } - define void @bar(%bar* %0) { + define void @bar(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__foo = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %__foo, i32 0, i32 1 - %1 = bitcast [81 x i8]* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %__foo, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_1, i32 6, i1 false) ret void } @@ -431,119 +429,117 @@ fn write_to_parent_variable_in_instance() { entry: %s = alloca [81 x i8], align 1 %fb = alloca %bar, align 8 - %0 = bitcast [81 x i8]* %s to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast %bar* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%bar* @__bar__init to i8*), i64 ptrtoint (%bar* getelementptr (%bar, %bar* null, i32 1) to i64), i1 false) - call void @__init_bar(%bar* %fb) - call void @__user_init_bar(%bar* %fb) - %__foo = getelementptr inbounds %bar, %bar* %fb, i32 0, i32 0 - call void @foo__baz(%foo* %__foo) - call void @bar(%bar* %fb) + call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__bar__init, i64 ptrtoint (ptr getelementptr (%bar, ptr null, i32 1) to i64), i1 false) + call void @__init_bar(ptr %fb) + call void @__user_init_bar(ptr %fb) + %__foo = getelementptr inbounds %bar, ptr %fb, i32 0, i32 0 + call void @foo__baz(ptr %__foo) + call void @bar(ptr %fb) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__baz, void (%foo*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__baz, ptr %baz, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 - %deref1 = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %baz = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__baz, void (%foo*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__baz, ptr %baz, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %__foo) - %deref1 = load %bar*, %bar** %self, align 8 - %__foo2 = getelementptr inbounds %bar, %bar* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo2, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %__foo) + %deref1 = load ptr, ptr %self, align 8 + %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %__foo) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %__foo) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#); } @@ -589,14 +585,14 @@ fn array_in_parent_generated() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_grandparent = type { void (%grandparent*)* } - %grandparent = type { i32*, [6 x i16], i16 } - %__vtable_parent = type { void (%parent*)* } + %__vtable_grandparent = type { ptr } + %grandparent = type { ptr, [6 x i16], i16 } + %__vtable_parent = type { ptr } %parent = type { %grandparent, [11 x i16], i16 } - %__vtable_child = type { void (%child*)* } + %__vtable_child = type { ptr } %child = type { %parent, [11 x i16] } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_grandparent__init = unnamed_addr constant %__vtable_grandparent zeroinitializer @__grandparent__init = unnamed_addr constant %grandparent zeroinitializer @__vtable_grandparent_instance = global %__vtable_grandparent zeroinitializer @@ -607,199 +603,198 @@ fn array_in_parent_generated() { @__child__init = unnamed_addr constant %child zeroinitializer @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @grandparent(%grandparent* %0) { + define void @grandparent(ptr %0) { entry: - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 ret void } - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %z = getelementptr inbounds %child, %child* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 ret void } define void @main() { entry: %arr = alloca [11 x %child], align 8 - %0 = bitcast [11 x %child]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([11 x %child]* getelementptr ([11 x %child], [11 x %child]* null, i32 1) to i64), i1 false) - %tmpVar = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 0 - %__parent = getelementptr inbounds %child, %child* %tmpVar, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 0 - %a = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 2 - store i16 10, i16* %a, align 2 - %tmpVar1 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 0 - %__parent2 = getelementptr inbounds %child, %child* %tmpVar1, i32 0, i32 0 - %__grandparent3 = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, %grandparent* %__grandparent3, i32 0, i32 1 - %tmpVar4 = getelementptr inbounds [6 x i16], [6 x i16]* %y, i32 0, i32 0 - store i16 20, i16* %tmpVar4, align 2 - %tmpVar5 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 1 - %__parent6 = getelementptr inbounds %child, %child* %tmpVar5, i32 0, i32 0 - %b = getelementptr inbounds %parent, %parent* %__parent6, i32 0, i32 2 - store i16 30, i16* %b, align 2 - %tmpVar7 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 1 - %__parent8 = getelementptr inbounds %child, %child* %tmpVar7, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %__parent8, i32 0, i32 1 - %tmpVar9 = getelementptr inbounds [11 x i16], [11 x i16]* %x, i32 0, i32 1 - store i16 40, i16* %tmpVar9, align 2 - %tmpVar10 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 2 - %z = getelementptr inbounds %child, %child* %tmpVar10, i32 0, i32 1 - %tmpVar11 = getelementptr inbounds [11 x i16], [11 x i16]* %z, i32 0, i32 2 - store i16 50, i16* %tmpVar11, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([11 x %child], ptr null, i32 1) to i64), i1 false) + %tmpVar = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0 + %__parent = getelementptr inbounds %child, ptr %tmpVar, i32 0, i32 0 + %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 + %a = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 2 + store i16 10, ptr %a, align 2 + %tmpVar1 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0 + %__parent2 = getelementptr inbounds %child, ptr %tmpVar1, i32 0, i32 0 + %__grandparent3 = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %y = getelementptr inbounds %grandparent, ptr %__grandparent3, i32 0, i32 1 + %tmpVar4 = getelementptr inbounds [6 x i16], ptr %y, i32 0, i32 0 + store i16 20, ptr %tmpVar4, align 2 + %tmpVar5 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1 + %__parent6 = getelementptr inbounds %child, ptr %tmpVar5, i32 0, i32 0 + %b = getelementptr inbounds %parent, ptr %__parent6, i32 0, i32 2 + store i16 30, ptr %b, align 2 + %tmpVar7 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1 + %__parent8 = getelementptr inbounds %child, ptr %tmpVar7, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %__parent8, i32 0, i32 1 + %tmpVar9 = getelementptr inbounds [11 x i16], ptr %x, i32 0, i32 1 + store i16 40, ptr %tmpVar9, align 2 + %tmpVar10 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 2 + %z = getelementptr inbounds %child, ptr %tmpVar10, i32 0, i32 1 + %tmpVar11 = getelementptr inbounds [11 x i16], ptr %z, i32 0, i32 2 + store i16 50, ptr %tmpVar11, align 2 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - define void @__init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 - %deref = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref, i32 0, i32 0 - store void (%grandparent*)* @grandparent, void (%grandparent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @grandparent, ptr %__body, align 8 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__init_grandparent(%grandparent* %__grandparent) - %deref1 = load %parent*, %parent** %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, %parent* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent2, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__init_grandparent(ptr %__grandparent) + %deref1 = load ptr, ptr %self, align 8 + %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_grandparent(%grandparent* %0) { + define void @__init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 - %deref = load %grandparent*, %grandparent** %self, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_grandparent* @__vtable_grandparent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_grandparent(%grandparent* %0) { + define void @__user_init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__user_init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__user_init_grandparent(%grandparent* %__grandparent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__user_init_grandparent(ptr %__grandparent) ret void } define void @__init___Test() { entry: - call void @__init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#); } @@ -836,14 +831,14 @@ fn complex_array_access_generated() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_grandparent = type { void (%grandparent*)* } - %grandparent = type { i32*, [6 x i16], i16 } - %__vtable_parent = type { void (%parent*)* } + %__vtable_grandparent = type { ptr } + %grandparent = type { ptr, [6 x i16], i16 } + %__vtable_parent = type { ptr } %parent = type { %grandparent, [11 x i16], i16 } - %__vtable_child = type { void (%child*)* } + %__vtable_child = type { ptr } %child = type { %parent, [11 x i16] } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_grandparent__init = unnamed_addr constant %__vtable_grandparent zeroinitializer @__grandparent__init = unnamed_addr constant %grandparent zeroinitializer @__vtable_grandparent_instance = global %__vtable_grandparent zeroinitializer @@ -854,184 +849,184 @@ fn complex_array_access_generated() { @__child__init = unnamed_addr constant %child zeroinitializer @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @grandparent(%grandparent* %0) { + define void @grandparent(ptr %0) { entry: - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 ret void } - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %z = getelementptr inbounds %child, %child* %0, i32 0, i32 1 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 1 - %b = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %load_b = load i16, i16* %b, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 + %y = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 1 + %b = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %load_b = load i16, ptr %b, align 2 %1 = sext i16 %load_b to i32 - %b1 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %load_b2 = load i16, i16* %b1, align 2 + %b1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %load_b2 = load i16, ptr %b1, align 2 %2 = sext i16 %load_b2 to i32 %tmpVar = mul i32 %2, 2 %tmpVar3 = mul i32 1, %tmpVar %tmpVar4 = add i32 %tmpVar3, 0 - %tmpVar5 = getelementptr inbounds [11 x i16], [11 x i16]* %z, i32 0, i32 %tmpVar4 - %load_tmpVar = load i16, i16* %tmpVar5, align 2 + %tmpVar5 = getelementptr inbounds [11 x i16], ptr %z, i32 0, i32 %tmpVar4 + %load_tmpVar = load i16, ptr %tmpVar5, align 2 %3 = sext i16 %load_tmpVar to i32 %tmpVar6 = add i32 %1, %3 - %__grandparent7 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 0 - %a = getelementptr inbounds %grandparent, %grandparent* %__grandparent7, i32 0, i32 2 - %load_a = load i16, i16* %a, align 2 + %__grandparent7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 + %a = getelementptr inbounds %grandparent, ptr %__grandparent7, i32 0, i32 2 + %load_a = load i16, ptr %a, align 2 %4 = sext i16 %load_a to i32 %tmpVar8 = sub i32 %tmpVar6, %4 %tmpVar9 = mul i32 1, %tmpVar8 %tmpVar10 = add i32 %tmpVar9, 0 - %tmpVar11 = getelementptr inbounds [6 x i16], [6 x i16]* %y, i32 0, i32 %tmpVar10 - store i16 20, i16* %tmpVar11, align 2 + %tmpVar11 = getelementptr inbounds [6 x i16], ptr %y, i32 0, i32 %tmpVar10 + store i16 20, ptr %tmpVar11, align 2 ret void } - define void @__init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 - %deref = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref, i32 0, i32 0 - store void (%grandparent*)* @grandparent, void (%grandparent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @grandparent, ptr %__body, align 8 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__init_grandparent(%grandparent* %__grandparent) - %deref1 = load %parent*, %parent** %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, %parent* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent2, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__init_grandparent(ptr %__grandparent) + %deref1 = load ptr, ptr %self, align 8 + %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_grandparent(%grandparent* %0) { + define void @__init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 - %deref = load %grandparent*, %grandparent** %self, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_grandparent* @__vtable_grandparent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_grandparent(%grandparent* %0) { + define void @__user_init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__user_init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__user_init_grandparent(%grandparent* %__grandparent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__user_init_grandparent(ptr %__grandparent) ret void } define void @__init___Test() { entry: - call void @__init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -1108,84 +1103,84 @@ fn this_in_method_call_chain() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB_Test = type { void (%FB_Test*)*, void (%FB_Test*)*, void (%FB_Test*)* } - %FB_Test = type { i32* } + %__vtable_FB_Test = type { ptr, ptr, ptr } + %FB_Test = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB_Test__init = unnamed_addr constant %__vtable_FB_Test zeroinitializer @__FB_Test__init = unnamed_addr constant %FB_Test zeroinitializer @__vtable_FB_Test_instance = global %__vtable_FB_Test zeroinitializer - define void @FB_Test(%FB_Test* %0) { + define void @FB_Test(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 ret void } - define void @FB_Test__Step(%FB_Test* %0) { + define void @FB_Test__Step(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - call void @FB_Test__Increment(%FB_Test* %deref) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %this, align 8 + call void @FB_Test__Increment(ptr %deref) ret void } - define void @FB_Test__Increment(%FB_Test* %0) { + define void @FB_Test__Increment(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 ret void } - define void @__init___vtable_fb_test(%__vtable_FB_Test* %0) { + define void @__init___vtable_fb_test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 - %deref = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref, i32 0, i32 0 - store void (%FB_Test*)* @FB_Test, void (%FB_Test*)** %__body, align 8 - %deref1 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %Step = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref1, i32 0, i32 1 - store void (%FB_Test*)* @FB_Test__Step, void (%FB_Test*)** %Step, align 8 - %deref2 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %Increment = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref2, i32 0, i32 2 - store void (%FB_Test*)* @FB_Test__Increment, void (%FB_Test*)** %Increment, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %Step = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + store ptr @FB_Test__Step, ptr %Step, align 8 + %deref2 = load ptr, ptr %self, align 8 + %Increment = getelementptr inbounds %__vtable_FB_Test, ptr %deref2, i32 0, i32 2 + store ptr @FB_Test__Increment, ptr %Increment, align 8 ret void } - define void @__init_fb_test(%FB_Test* %0) { + define void @__init_fb_test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 - %deref = load %FB_Test*, %FB_Test** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test* @__vtable_FB_Test_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_FB_Test(%FB_Test* %0) { + define void @__user_init_FB_Test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB_Test(%__vtable_FB_Test* %0) { + define void @__user_init___vtable_FB_Test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb_test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__user_init___vtable_FB_Test(%__vtable_FB_Test* @__vtable_FB_Test_instance) + call void @__init___vtable_fb_test(ptr @__vtable_FB_Test_instance) + call void @__user_init___vtable_FB_Test(ptr @__vtable_FB_Test_instance) ret void } "#); @@ -1214,88 +1209,88 @@ fn this_in_method_and_body_in_function_block() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB_Test = type { void (%FB_Test*)*, i16 (%FB_Test*)* } - %FB_Test = type { i32*, i16 } + %__vtable_FB_Test = type { ptr, ptr } + %FB_Test = type { ptr, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB_Test__init = unnamed_addr constant %__vtable_FB_Test zeroinitializer - @__FB_Test__init = unnamed_addr constant %FB_Test { i32* null, i16 5 } + @__FB_Test__init = unnamed_addr constant %FB_Test { ptr null, i16 5 } @__vtable_FB_Test_instance = global %__vtable_FB_Test zeroinitializer - define void @FB_Test(%FB_Test* %0) { + define void @FB_Test(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - %val1 = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 1 - %load_val = load i16, i16* %val1, align 2 - store i16 %load_val, i16* %val, align 2 - %deref2 = load %FB_Test*, %FB_Test** %this, align 8 - %val3 = getelementptr inbounds %FB_Test, %FB_Test* %deref2, i32 0, i32 1 - %load_val4 = load i16, i16* %val, align 2 - store i16 %load_val4, i16* %val3, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %deref = load ptr, ptr %this, align 8 + %val1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %load_val = load i16, ptr %val1, align 2 + store i16 %load_val, ptr %val, align 2 + %deref2 = load ptr, ptr %this, align 8 + %val3 = getelementptr inbounds %FB_Test, ptr %deref2, i32 0, i32 1 + %load_val4 = load i16, ptr %val, align 2 + store i16 %load_val4, ptr %val3, align 2 ret void } - define i16 @FB_Test__GetVal(%FB_Test* %0) { + define i16 @FB_Test__GetVal(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 %FB_Test.GetVal = alloca i16, align 2 - store i16 0, i16* %FB_Test.GetVal, align 2 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - %val1 = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 1 - %load_val = load i16, i16* %val1, align 2 - store i16 %load_val, i16* %FB_Test.GetVal, align 2 - %FB_Test__GetVal_ret = load i16, i16* %FB_Test.GetVal, align 2 + store i16 0, ptr %FB_Test.GetVal, align 2 + %deref = load ptr, ptr %this, align 8 + %val1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %load_val = load i16, ptr %val1, align 2 + store i16 %load_val, ptr %FB_Test.GetVal, align 2 + %FB_Test__GetVal_ret = load i16, ptr %FB_Test.GetVal, align 2 ret i16 %FB_Test__GetVal_ret } - define void @__init___vtable_fb_test(%__vtable_FB_Test* %0) { + define void @__init___vtable_fb_test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 - %deref = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref, i32 0, i32 0 - store void (%FB_Test*)* @FB_Test, void (%FB_Test*)** %__body, align 8 - %deref1 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %GetVal = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref1, i32 0, i32 1 - store i16 (%FB_Test*)* @FB_Test__GetVal, i16 (%FB_Test*)** %GetVal, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %GetVal = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + store ptr @FB_Test__GetVal, ptr %GetVal, align 8 ret void } - define void @__init_fb_test(%FB_Test* %0) { + define void @__init_fb_test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 - %deref = load %FB_Test*, %FB_Test** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test* @__vtable_FB_Test_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_FB_Test(%FB_Test* %0) { + define void @__user_init_FB_Test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB_Test(%__vtable_FB_Test* %0) { + define void @__user_init___vtable_FB_Test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb_test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__user_init___vtable_FB_Test(%__vtable_FB_Test* @__vtable_FB_Test_instance) + call void @__init___vtable_fb_test(ptr @__vtable_FB_Test_instance) + call void @__user_init___vtable_FB_Test(ptr @__vtable_FB_Test_instance) ret void } "#); @@ -1335,158 +1330,157 @@ fn pass_this_to_method() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB_Test = type { void (%FB_Test*)*, void (%FB_Test*)* } - %FB_Test = type { i32*, i16 } - %FB_Test2 = type { i32* } - %__vtable_FB_Test2 = type { void (%FB_Test2*)*, i16 (%FB_Test2*, %FB_Test*)* } + %__vtable_FB_Test = type { ptr, ptr } + %FB_Test = type { ptr, i16 } + %FB_Test2 = type { ptr } + %__vtable_FB_Test2 = type { ptr, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB_Test__init = unnamed_addr constant %__vtable_FB_Test zeroinitializer - @__FB_Test__init = unnamed_addr constant %FB_Test { i32* null, i16 5 } + @__FB_Test__init = unnamed_addr constant %FB_Test { ptr null, i16 5 } @__FB_Test2__init = unnamed_addr constant %FB_Test2 zeroinitializer @____vtable_FB_Test2__init = unnamed_addr constant %__vtable_FB_Test2 zeroinitializer @__vtable_FB_Test_instance = global %__vtable_FB_Test zeroinitializer @__vtable_FB_Test2_instance = global %__vtable_FB_Test2 zeroinitializer - define void @FB_Test(%FB_Test* %0) { + define void @FB_Test(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 ret void } - define void @FB_Test__foo(%FB_Test* %0) { + define void @FB_Test__foo(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 %test = alloca %FB_Test2, align 8 %x1 = alloca i16, align 2 - %1 = bitcast %FB_Test2* %test to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%FB_Test2* @__FB_Test2__init to i8*), i64 ptrtoint (%FB_Test2* getelementptr (%FB_Test2, %FB_Test2* null, i32 1) to i64), i1 false) - store i16 0, i16* %x1, align 2 - call void @__init_fb_test2(%FB_Test2* %test) - call void @__user_init_FB_Test2(%FB_Test2* %test) - %2 = load %FB_Test*, %FB_Test** %this, align 8 - %call = call i16 @FB_Test2__bar(%FB_Test2* %test, %FB_Test* %2) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %test, ptr align 1 @__FB_Test2__init, i64 ptrtoint (ptr getelementptr (%FB_Test2, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %x1, align 2 + call void @__init_fb_test2(ptr %test) + call void @__user_init_FB_Test2(ptr %test) + %1 = load ptr, ptr %this, align 8 + %call = call i16 @FB_Test2__bar(ptr %test, ptr %1) ret void } - define void @FB_Test2(%FB_Test2* %0) { + define void @FB_Test2(ptr %0) { entry: - %this = alloca %FB_Test2*, align 8 - store %FB_Test2* %0, %FB_Test2** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test2, %FB_Test2* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test2, ptr %0, i32 0, i32 0 ret void } - define i16 @FB_Test2__bar(%FB_Test2* %0, %FB_Test* %1) { + define i16 @FB_Test2__bar(ptr %0, ptr %1) { entry: - %this = alloca %FB_Test2*, align 8 - store %FB_Test2* %0, %FB_Test2** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test2, %FB_Test2* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test2, ptr %0, i32 0, i32 0 %FB_Test2.bar = alloca i16, align 2 - %test = alloca %FB_Test*, align 8 - store %FB_Test* %1, %FB_Test** %test, align 8 - store i16 0, i16* %FB_Test2.bar, align 2 - %deref = load %FB_Test*, %FB_Test** %test, align 8 - %x = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 - store i16 %load_x, i16* %FB_Test2.bar, align 2 - %FB_Test2__bar_ret = load i16, i16* %FB_Test2.bar, align 2 + %test = alloca ptr, align 8 + store ptr %1, ptr %test, align 8 + store i16 0, ptr %FB_Test2.bar, align 2 + %deref = load ptr, ptr %test, align 8 + %x = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 + store i16 %load_x, ptr %FB_Test2.bar, align 2 + %FB_Test2__bar_ret = load i16, ptr %FB_Test2.bar, align 2 ret i16 %FB_Test2__bar_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_fb_test(%__vtable_FB_Test* %0) { + define void @__init___vtable_fb_test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 - %deref = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref, i32 0, i32 0 - store void (%FB_Test*)* @FB_Test, void (%FB_Test*)** %__body, align 8 - %deref1 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %foo = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref1, i32 0, i32 1 - store void (%FB_Test*)* @FB_Test__foo, void (%FB_Test*)** %foo, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + store ptr @FB_Test__foo, ptr %foo, align 8 ret void } - define void @__init___vtable_fb_test2(%__vtable_FB_Test2* %0) { + define void @__init___vtable_fb_test2(ptr %0) { entry: - %self = alloca %__vtable_FB_Test2*, align 8 - store %__vtable_FB_Test2* %0, %__vtable_FB_Test2** %self, align 8 - %deref = load %__vtable_FB_Test2*, %__vtable_FB_Test2** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test2, %__vtable_FB_Test2* %deref, i32 0, i32 0 - store void (%FB_Test2*)* @FB_Test2, void (%FB_Test2*)** %__body, align 8 - %deref1 = load %__vtable_FB_Test2*, %__vtable_FB_Test2** %self, align 8 - %bar = getelementptr inbounds %__vtable_FB_Test2, %__vtable_FB_Test2* %deref1, i32 0, i32 1 - store i16 (%FB_Test2*, %FB_Test*)* @FB_Test2__bar, i16 (%FB_Test2*, %FB_Test*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test2, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + store ptr @FB_Test2__bar, ptr %bar, align 8 ret void } - define void @__init_fb_test(%FB_Test* %0) { + define void @__init_fb_test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 - %deref = load %FB_Test*, %FB_Test** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test* @__vtable_FB_Test_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } - define void @__init_fb_test2(%FB_Test2* %0) { + define void @__init_fb_test2(ptr %0) { entry: - %self = alloca %FB_Test2*, align 8 - store %FB_Test2* %0, %FB_Test2** %self, align 8 - %deref = load %FB_Test2*, %FB_Test2** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test2, %FB_Test2* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test2* @__vtable_FB_Test2_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB_Test2, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test2_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_FB_Test2(%__vtable_FB_Test2* %0) { + define void @__user_init___vtable_FB_Test2(ptr %0) { entry: - %self = alloca %__vtable_FB_Test2*, align 8 - store %__vtable_FB_Test2* %0, %__vtable_FB_Test2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_FB_Test(%FB_Test* %0) { + define void @__user_init_FB_Test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_FB_Test2(%FB_Test2* %0) { + define void @__user_init_FB_Test2(ptr %0) { entry: - %self = alloca %FB_Test2*, align 8 - store %FB_Test2* %0, %FB_Test2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB_Test(%__vtable_FB_Test* %0) { + define void @__user_init___vtable_FB_Test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb_test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__init___vtable_fb_test2(%__vtable_FB_Test2* @__vtable_FB_Test2_instance) - call void @__user_init___vtable_FB_Test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__user_init___vtable_FB_Test2(%__vtable_FB_Test2* @__vtable_FB_Test2_instance) + call void @__init___vtable_fb_test(ptr @__vtable_FB_Test_instance) + call void @__init___vtable_fb_test2(ptr @__vtable_FB_Test2_instance) + call void @__user_init___vtable_FB_Test(ptr @__vtable_FB_Test_instance) + call void @__user_init___vtable_FB_Test2(ptr @__vtable_FB_Test2_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -1516,85 +1510,85 @@ fn this_with_shadowed_variable() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB_Test = type { void (%FB_Test*)*, void (%FB_Test*)* } - %FB_Test = type { i32*, i16 } + %__vtable_FB_Test = type { ptr, ptr } + %FB_Test = type { ptr, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB_Test__init = unnamed_addr constant %__vtable_FB_Test zeroinitializer - @__FB_Test__init = unnamed_addr constant %FB_Test { i32* null, i16 5 } + @__FB_Test__init = unnamed_addr constant %FB_Test { ptr null, i16 5 } @__vtable_FB_Test_instance = global %__vtable_FB_Test zeroinitializer - define void @FB_Test(%FB_Test* %0) { + define void @FB_Test(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 ret void } - define void @FB_Test__shadow_val(%FB_Test* %0) { + define void @FB_Test__shadow_val(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 %val1 = alloca i16, align 2 %local_val = alloca i16, align 2 %shadow_val = alloca i16, align 2 - store i16 10, i16* %val1, align 2 - store i16 0, i16* %local_val, align 2 - store i16 0, i16* %shadow_val, align 2 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - %val2 = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 1 - %load_val = load i16, i16* %val2, align 2 - store i16 %load_val, i16* %local_val, align 2 - %load_val3 = load i16, i16* %val1, align 2 - store i16 %load_val3, i16* %shadow_val, align 2 + store i16 10, ptr %val1, align 2 + store i16 0, ptr %local_val, align 2 + store i16 0, ptr %shadow_val, align 2 + %deref = load ptr, ptr %this, align 8 + %val2 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %load_val = load i16, ptr %val2, align 2 + store i16 %load_val, ptr %local_val, align 2 + %load_val3 = load i16, ptr %val1, align 2 + store i16 %load_val3, ptr %shadow_val, align 2 ret void } - define void @__init___vtable_fb_test(%__vtable_FB_Test* %0) { + define void @__init___vtable_fb_test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 - %deref = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref, i32 0, i32 0 - store void (%FB_Test*)* @FB_Test, void (%FB_Test*)** %__body, align 8 - %deref1 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %shadow_val = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref1, i32 0, i32 1 - store void (%FB_Test*)* @FB_Test__shadow_val, void (%FB_Test*)** %shadow_val, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %shadow_val = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + store ptr @FB_Test__shadow_val, ptr %shadow_val, align 8 ret void } - define void @__init_fb_test(%FB_Test* %0) { + define void @__init_fb_test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 - %deref = load %FB_Test*, %FB_Test** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test* @__vtable_FB_Test_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_FB_Test(%FB_Test* %0) { + define void @__user_init_FB_Test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB_Test(%__vtable_FB_Test* %0) { + define void @__user_init___vtable_FB_Test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb_test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__user_init___vtable_FB_Test(%__vtable_FB_Test* @__vtable_FB_Test_instance) + call void @__init___vtable_fb_test(ptr @__vtable_FB_Test_instance) + call void @__user_init___vtable_FB_Test(ptr @__vtable_FB_Test_instance) ret void } "#); @@ -1624,77 +1618,77 @@ fn this_calling_function_and_passing_this() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB_Test = type { void (%FB_Test*)* } - %FB_Test = type { i32*, i16 } + %__vtable_FB_Test = type { ptr } + %FB_Test = type { ptr, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB_Test__init = unnamed_addr constant %__vtable_FB_Test zeroinitializer @__FB_Test__init = unnamed_addr constant %FB_Test zeroinitializer @__vtable_FB_Test_instance = global %__vtable_FB_Test zeroinitializer - define void @FB_Test(%FB_Test* %0) { + define void @FB_Test(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 - %1 = load %FB_Test*, %FB_Test** %this, align 8 - %call = call i16 @foo(%FB_Test* %1) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %1 = load ptr, ptr %this, align 8 + %call = call i16 @foo(ptr %1) ret void } - define i16 @foo(%FB_Test* %0) { + define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 - %pfb = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %pfb, align 8 - store i16 0, i16* %foo, align 2 - %deref = load %FB_Test*, %FB_Test** %pfb, align 8 - %x = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 - store i16 %load_x, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + %pfb = alloca ptr, align 8 + store ptr %0, ptr %pfb, align 8 + store i16 0, ptr %foo, align 2 + %deref = load ptr, ptr %pfb, align 8 + %x = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 + store i16 %load_x, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } - define void @__init___vtable_fb_test(%__vtable_FB_Test* %0) { + define void @__init___vtable_fb_test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 - %deref = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref, i32 0, i32 0 - store void (%FB_Test*)* @FB_Test, void (%FB_Test*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test, ptr %__body, align 8 ret void } - define void @__init_fb_test(%FB_Test* %0) { + define void @__init_fb_test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 - %deref = load %FB_Test*, %FB_Test** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test* @__vtable_FB_Test_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_FB_Test(%FB_Test* %0) { + define void @__user_init_FB_Test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB_Test(%__vtable_FB_Test* %0) { + define void @__user_init___vtable_FB_Test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb_test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__user_init___vtable_FB_Test(%__vtable_FB_Test* @__vtable_FB_Test_instance) + call void @__init___vtable_fb_test(ptr @__vtable_FB_Test_instance) + call void @__user_init___vtable_FB_Test(ptr @__vtable_FB_Test_instance) ret void } "#); @@ -1730,123 +1724,123 @@ fn this_in_property_and_calling_method() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB_Test = type { void (%FB_Test*)*, i16 (%FB_Test*)*, i16 (%FB_Test*)*, void (%FB_Test*, i16)* } - %FB_Test = type { i32*, i16 } + %__vtable_FB_Test = type { ptr, ptr, ptr, ptr } + %FB_Test = type { ptr, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB_Test__init = unnamed_addr constant %__vtable_FB_Test zeroinitializer @__FB_Test__init = unnamed_addr constant %FB_Test zeroinitializer @__vtable_FB_Test_instance = global %__vtable_FB_Test zeroinitializer - define void @FB_Test(%FB_Test* %0) { + define void @FB_Test(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 ret void } - define i16 @FB_Test__DoubleX(%FB_Test* %0) { + define i16 @FB_Test__DoubleX(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 %FB_Test.DoubleX = alloca i16, align 2 - store i16 0, i16* %FB_Test.DoubleX, align 2 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - %x1 = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 1 - %load_x = load i16, i16* %x1, align 2 + store i16 0, ptr %FB_Test.DoubleX, align 2 + %deref = load ptr, ptr %this, align 8 + %x1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %load_x = load i16, ptr %x1, align 2 %1 = sext i16 %load_x to i32 %tmpVar = mul i32 2, %1 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %FB_Test.DoubleX, align 2 - %FB_Test__DoubleX_ret = load i16, i16* %FB_Test.DoubleX, align 2 + store i16 %2, ptr %FB_Test.DoubleX, align 2 + %FB_Test__DoubleX_ret = load i16, ptr %FB_Test.DoubleX, align 2 ret i16 %FB_Test__DoubleX_ret } - define i16 @FB_Test____get_Value(%FB_Test* %0) { + define i16 @FB_Test____get_Value(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 %FB_Test.__get_Value = alloca i16, align 2 %Value = alloca i16, align 2 - store i16 0, i16* %Value, align 2 - store i16 0, i16* %FB_Test.__get_Value, align 2 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - %call = call i16 @FB_Test__DoubleX(%FB_Test* %deref) - store i16 %call, i16* %Value, align 2 - %load_Value = load i16, i16* %Value, align 2 - store i16 %load_Value, i16* %FB_Test.__get_Value, align 2 - %FB_Test____get_Value_ret = load i16, i16* %FB_Test.__get_Value, align 2 + store i16 0, ptr %Value, align 2 + store i16 0, ptr %FB_Test.__get_Value, align 2 + %deref = load ptr, ptr %this, align 8 + %call = call i16 @FB_Test__DoubleX(ptr %deref) + store i16 %call, ptr %Value, align 2 + %load_Value = load i16, ptr %Value, align 2 + store i16 %load_Value, ptr %FB_Test.__get_Value, align 2 + %FB_Test____get_Value_ret = load i16, ptr %FB_Test.__get_Value, align 2 ret i16 %FB_Test____get_Value_ret } - define void @FB_Test____set_Value(%FB_Test* %0, i16 %1) { + define void @FB_Test____set_Value(ptr %0, i16 %1) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 %Value = alloca i16, align 2 - store i16 %1, i16* %Value, align 2 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - %x1 = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 1 - %load_Value = load i16, i16* %Value, align 2 - store i16 %load_Value, i16* %x1, align 2 + store i16 %1, ptr %Value, align 2 + %deref = load ptr, ptr %this, align 8 + %x1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %load_Value = load i16, ptr %Value, align 2 + store i16 %load_Value, ptr %x1, align 2 ret void } - define void @__init___vtable_fb_test(%__vtable_FB_Test* %0) { + define void @__init___vtable_fb_test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 - %deref = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref, i32 0, i32 0 - store void (%FB_Test*)* @FB_Test, void (%FB_Test*)** %__body, align 8 - %deref1 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %DoubleX = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref1, i32 0, i32 1 - store i16 (%FB_Test*)* @FB_Test__DoubleX, i16 (%FB_Test*)** %DoubleX, align 8 - %deref2 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__get_Value = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref2, i32 0, i32 2 - store i16 (%FB_Test*)* @FB_Test____get_Value, i16 (%FB_Test*)** %__get_Value, align 8 - %deref3 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__set_Value = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref3, i32 0, i32 3 - store void (%FB_Test*, i16)* @FB_Test____set_Value, void (%FB_Test*, i16)** %__set_Value, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %DoubleX = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + store ptr @FB_Test__DoubleX, ptr %DoubleX, align 8 + %deref2 = load ptr, ptr %self, align 8 + %__get_Value = getelementptr inbounds %__vtable_FB_Test, ptr %deref2, i32 0, i32 2 + store ptr @FB_Test____get_Value, ptr %__get_Value, align 8 + %deref3 = load ptr, ptr %self, align 8 + %__set_Value = getelementptr inbounds %__vtable_FB_Test, ptr %deref3, i32 0, i32 3 + store ptr @FB_Test____set_Value, ptr %__set_Value, align 8 ret void } - define void @__init_fb_test(%FB_Test* %0) { + define void @__init_fb_test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 - %deref = load %FB_Test*, %FB_Test** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test* @__vtable_FB_Test_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_FB_Test(%FB_Test* %0) { + define void @__user_init_FB_Test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB_Test(%__vtable_FB_Test* %0) { + define void @__user_init___vtable_FB_Test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb_test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__user_init___vtable_FB_Test(%__vtable_FB_Test* @__vtable_FB_Test_instance) + call void @__init___vtable_fb_test(ptr @__vtable_FB_Test_instance) + call void @__user_init___vtable_FB_Test(ptr @__vtable_FB_Test_instance) ret void } "#); @@ -1875,79 +1869,79 @@ fn this_with_self_pointer() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB_Test = type { void (%FB_Test*)*, void (%FB_Test*)* } - %FB_Test = type { i32*, %FB_Test* } + %__vtable_FB_Test = type { ptr, ptr } + %FB_Test = type { ptr, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB_Test__init = unnamed_addr constant %__vtable_FB_Test zeroinitializer @__FB_Test__init = unnamed_addr constant %FB_Test zeroinitializer @__vtable_FB_Test_instance = global %__vtable_FB_Test zeroinitializer - define void @FB_Test(%FB_Test* %0) { + define void @FB_Test(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %refToSelf = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %refToSelf = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 ret void } - define void @FB_Test__InitRef(%FB_Test* %0) { + define void @FB_Test__InitRef(ptr %0) { entry: - %this = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 0 - %refToSelf = getelementptr inbounds %FB_Test, %FB_Test* %0, i32 0, i32 1 - %deref = load %FB_Test*, %FB_Test** %this, align 8 - store %FB_Test* %deref, %FB_Test** %refToSelf, align 8 - %deref1 = load %FB_Test*, %FB_Test** %this, align 8 - store %FB_Test* %deref1, %FB_Test** %refToSelf, align 8 - %1 = load %FB_Test*, %FB_Test** %this, align 8 - store %FB_Test* %1, %FB_Test** %refToSelf, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %refToSelf = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %deref = load ptr, ptr %this, align 8 + store ptr %deref, ptr %refToSelf, align 8 + %deref1 = load ptr, ptr %this, align 8 + store ptr %deref1, ptr %refToSelf, align 8 + %1 = load ptr, ptr %this, align 8 + store ptr %1, ptr %refToSelf, align 8 ret void } - define void @__init___vtable_fb_test(%__vtable_FB_Test* %0) { + define void @__init___vtable_fb_test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 - %deref = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref, i32 0, i32 0 - store void (%FB_Test*)* @FB_Test, void (%FB_Test*)** %__body, align 8 - %deref1 = load %__vtable_FB_Test*, %__vtable_FB_Test** %self, align 8 - %InitRef = getelementptr inbounds %__vtable_FB_Test, %__vtable_FB_Test* %deref1, i32 0, i32 1 - store void (%FB_Test*)* @FB_Test__InitRef, void (%FB_Test*)** %InitRef, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @FB_Test, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %InitRef = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + store ptr @FB_Test__InitRef, ptr %InitRef, align 8 ret void } - define void @__init_fb_test(%FB_Test* %0) { + define void @__init_fb_test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 - %deref = load %FB_Test*, %FB_Test** %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, %FB_Test* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB_Test* @__vtable_FB_Test_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_FB_Test(%FB_Test* %0) { + define void @__user_init_FB_Test(ptr %0) { entry: - %self = alloca %FB_Test*, align 8 - store %FB_Test* %0, %FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB_Test(%__vtable_FB_Test* %0) { + define void @__user_init___vtable_FB_Test(ptr %0) { entry: - %self = alloca %__vtable_FB_Test*, align 8 - store %__vtable_FB_Test* %0, %__vtable_FB_Test** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb_test(%__vtable_FB_Test* @__vtable_FB_Test_instance) - call void @__user_init___vtable_FB_Test(%__vtable_FB_Test* @__vtable_FB_Test_instance) + call void @__init___vtable_fb_test(ptr @__vtable_FB_Test_instance) + call void @__user_init___vtable_FB_Test(ptr @__vtable_FB_Test_instance) ret void } "#); @@ -1974,63 +1968,63 @@ fn this_in_variable_initialization() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_FB = type { void (%FB*)* } - %FB = type { i32*, i16, %FB*, i16 } + %__vtable_FB = type { ptr } + %FB = type { ptr, i16, ptr, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_FB__init = unnamed_addr constant %__vtable_FB zeroinitializer - @__FB__init = unnamed_addr constant %FB { i32* null, i16 5, %FB* null, i16 5 } + @__FB__init = unnamed_addr constant %FB { ptr null, i16 5, ptr null, i16 5 } @__vtable_FB_instance = global %__vtable_FB zeroinitializer - define void @FB(%FB* %0) { + define void @FB(ptr %0) { entry: - %this = alloca %FB*, align 8 - store %FB* %0, %FB** %this, align 8 - %__vtable = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 - %x = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 - %self = getelementptr inbounds %FB, %FB* %0, i32 0, i32 2 - %y = getelementptr inbounds %FB, %FB* %0, i32 0, i32 3 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 + %self = getelementptr inbounds %FB, ptr %0, i32 0, i32 2 + %y = getelementptr inbounds %FB, ptr %0, i32 0, i32 3 ret void } - define void @__init___vtable_fb(%__vtable_FB* %0) { + define void @__init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_FB*, align 8 - store %__vtable_FB* %0, %__vtable_FB** %self, align 8 - %deref = load %__vtable_FB*, %__vtable_FB** %self, align 8 - %__body = getelementptr inbounds %__vtable_FB, %__vtable_FB* %deref, i32 0, i32 0 - store void (%FB*)* @FB, void (%FB*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_FB, ptr %deref, i32 0, i32 0 + store ptr @FB, ptr %__body, align 8 ret void } - define void @__init_fb(%FB* %0) { + define void @__init_fb(ptr %0) { entry: - %self = alloca %FB*, align 8 - store %FB* %0, %FB** %self, align 8 - %deref = load %FB*, %FB** %self, align 8 - %__vtable = getelementptr inbounds %FB, %FB* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_FB* @__vtable_FB_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %FB, ptr %deref, i32 0, i32 0 + store ptr @__vtable_FB_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_FB(%FB* %0) { + define void @__user_init_FB(ptr %0) { entry: - %self = alloca %FB*, align 8 - store %FB* %0, %FB** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_FB(%__vtable_FB* %0) { + define void @__user_init___vtable_FB(ptr %0) { entry: - %self = alloca %__vtable_FB*, align 8 - store %__vtable_FB* %0, %__vtable_FB** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb(%__vtable_FB* @__vtable_FB_instance) - call void @__user_init___vtable_FB(%__vtable_FB* @__vtable_FB_instance) + call void @__init___vtable_fb(ptr @__vtable_FB_instance) + call void @__user_init___vtable_FB(ptr @__vtable_FB_instance) ret void } "#); @@ -2054,70 +2048,70 @@ fn this_in_action_in_functionblock() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_fb = type { void (%fb*)* } - %fb = type { i32* } + %__vtable_fb = type { ptr } + %fb = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_fb__init = unnamed_addr constant %__vtable_fb zeroinitializer @__fb__init = unnamed_addr constant %fb zeroinitializer @__vtable_fb_instance = global %__vtable_fb zeroinitializer - define void @fb(%fb* %0) { + define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void } - define void @fb__foo(%fb* %0) { + define void @fb__foo(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 - %deref = load %fb*, %fb** %this, align 8 - call void @fb(%fb* %deref) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %this, align 8 + call void @fb(ptr %deref) ret void } - define void @__init___vtable_fb(%__vtable_fb* %0) { + define void @__init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 - %deref = load %__vtable_fb*, %__vtable_fb** %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, %__vtable_fb* %deref, i32 0, i32 0 - store void (%fb*)* @fb, void (%fb*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @fb, ptr %__body, align 8 ret void } - define void @__init_fb(%fb* %0) { + define void @__init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 - %deref = load %fb*, %fb** %self, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_fb* @__vtable_fb_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_fb(%fb* %0) { + define void @__user_init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_fb(%__vtable_fb* %0) { + define void @__user_init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) - call void @__user_init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) + call void @__init___vtable_fb(ptr @__vtable_fb_instance) + call void @__user_init___vtable_fb(ptr @__vtable_fb_instance) ret void } "#); @@ -2140,76 +2134,76 @@ fn this_calling_functionblock_body_from_method() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_fb = type { void (%fb*)*, i16 (%fb*)* } - %fb = type { i32* } + %__vtable_fb = type { ptr, ptr } + %fb = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_fb__init = unnamed_addr constant %__vtable_fb zeroinitializer @__fb__init = unnamed_addr constant %fb zeroinitializer @__vtable_fb_instance = global %__vtable_fb zeroinitializer - define void @fb(%fb* %0) { + define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void } - define i16 @fb__foo(%fb* %0) { + define i16 @fb__foo(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 %fb.foo = alloca i16, align 2 - store i16 0, i16* %fb.foo, align 2 - %deref = load %fb*, %fb** %this, align 8 - call void @fb(%fb* %deref) - %fb__foo_ret = load i16, i16* %fb.foo, align 2 + store i16 0, ptr %fb.foo, align 2 + %deref = load ptr, ptr %this, align 8 + call void @fb(ptr %deref) + %fb__foo_ret = load i16, ptr %fb.foo, align 2 ret i16 %fb__foo_ret } - define void @__init___vtable_fb(%__vtable_fb* %0) { + define void @__init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 - %deref = load %__vtable_fb*, %__vtable_fb** %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, %__vtable_fb* %deref, i32 0, i32 0 - store void (%fb*)* @fb, void (%fb*)** %__body, align 8 - %deref1 = load %__vtable_fb*, %__vtable_fb** %self, align 8 - %foo = getelementptr inbounds %__vtable_fb, %__vtable_fb* %deref1, i32 0, i32 1 - store i16 (%fb*)* @fb__foo, i16 (%fb*)** %foo, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @fb, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_fb, ptr %deref1, i32 0, i32 1 + store ptr @fb__foo, ptr %foo, align 8 ret void } - define void @__init_fb(%fb* %0) { + define void @__init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 - %deref = load %fb*, %fb** %self, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_fb* @__vtable_fb_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_fb(%fb* %0) { + define void @__user_init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_fb(%__vtable_fb* %0) { + define void @__user_init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) - call void @__user_init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) + call void @__init___vtable_fb(ptr @__vtable_fb_instance) + call void @__user_init___vtable_fb(ptr @__vtable_fb_instance) ret void } "#); @@ -2244,12 +2238,12 @@ fn fb_extension_with_output() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, i16 (%foo*, i16, i16, i16*)* } - %foo = type { i32* } - %__vtable_foo2 = type { void (%foo2*)*, i16 (%foo*, i16, i16, i16*)* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } + %__vtable_foo2 = type { ptr, ptr } %foo2 = type { %foo } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -2257,137 +2251,135 @@ fn fb_extension_with_output() { @__foo2__init = unnamed_addr constant %foo2 zeroinitializer @__vtable_foo2_instance = global %__vtable_foo2 zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define i16 @foo__met1(%foo* %0, i16 %1, i16 %2, i16* %3) { + define i16 @foo__met1(ptr %0, i16 %1, i16 %2, ptr %3) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %foo.met1 = alloca i16, align 2 %mandatoryInput = alloca i16, align 2 - store i16 %1, i16* %mandatoryInput, align 2 + store i16 %1, ptr %mandatoryInput, align 2 %optionalInput = alloca i16, align 2 - store i16 %2, i16* %optionalInput, align 2 - %outputValue = alloca i16*, align 8 - store i16* %3, i16** %outputValue, align 8 - store i16 0, i16* %foo.met1, align 2 - %foo__met1_ret = load i16, i16* %foo.met1, align 2 + store i16 %2, ptr %optionalInput, align 2 + %outputValue = alloca ptr, align 8 + store ptr %3, ptr %outputValue, align 8 + store i16 0, ptr %foo.met1, align 2 + %foo__met1_ret = load i16, ptr %foo.met1, align 2 ret i16 %foo__met1_ret } - define void @foo2(%foo2* %0) { - entry: - %this = alloca %foo2*, align 8 - store %foo2* %0, %foo2** %this, align 8 - %__foo = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 0 - %deref = load %foo2*, %foo2** %this, align 8 - %__foo1 = getelementptr inbounds %foo2, %foo2* %deref, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo1, i32 0, i32 0 - %deref2 = load i32*, i32** %__vtable, align 8 - %cast = bitcast i32* %deref2 to %__vtable_foo2* - %met1 = getelementptr inbounds %__vtable_foo2, %__vtable_foo2* %cast, i32 0, i32 1 - %1 = load i16 (%foo*, i16, i16, i16*)*, i16 (%foo*, i16, i16, i16*)** %met1, align 8 - %deref3 = load %foo2*, %foo2** %this, align 8 - %cast4 = bitcast %foo2* %deref3 to %foo* + define void @foo2(ptr %0) { + entry: + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__foo = getelementptr inbounds %foo2, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %this, align 8 + %__foo1 = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo1, i32 0, i32 0 + %deref2 = load ptr, ptr %__vtable, align 8 + %met1 = getelementptr inbounds %__vtable_foo2, ptr %deref2, i32 0, i32 1 + %1 = load ptr, ptr %met1, align 8 + %deref3 = load ptr, ptr %this, align 8 %2 = alloca i16, align 2 - %fnptr_call = call i16 %1(%foo* %cast4, i16 0, i16 0, i16* %2) + %fnptr_call = call i16 %1(ptr %deref3, i16 0, i16 0, ptr %2) ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store i16 (%foo*, i16, i16, i16*)* @foo__met1, i16 (%foo*, i16, i16, i16*)** %met1, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__met1, ptr %met1, align 8 ret void } - define void @__init___vtable_foo2(%__vtable_foo2* %0) { + define void @__init___vtable_foo2(ptr %0) { entry: - %self = alloca %__vtable_foo2*, align 8 - store %__vtable_foo2* %0, %__vtable_foo2** %self, align 8 - %deref = load %__vtable_foo2*, %__vtable_foo2** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo2, %__vtable_foo2* %deref, i32 0, i32 0 - store void (%foo2*)* @foo2, void (%foo2*)** %__body, align 8 - %deref1 = load %__vtable_foo2*, %__vtable_foo2** %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo2, %__vtable_foo2* %deref1, i32 0, i32 1 - store i16 (%foo*, i16, i16, i16*)* @foo__met1, i16 (%foo*, i16, i16, i16*)** %met1, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo2, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__met1, ptr %met1, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__init_foo2(%foo2* %0) { + define void @__init_foo2(ptr %0) { entry: - %self = alloca %foo2*, align 8 - store %foo2* %0, %foo2** %self, align 8 - %deref = load %foo2*, %foo2** %self, align 8 - %__foo = getelementptr inbounds %foo2, %foo2* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %__foo) - %deref1 = load %foo2*, %foo2** %self, align 8 - %__foo2 = getelementptr inbounds %foo2, %foo2* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo2, i32 0, i32 0 - store i32* bitcast (%__vtable_foo2* @__vtable_foo2_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %__foo) + %deref1 = load ptr, ptr %self, align 8 + %__foo2 = getelementptr inbounds %foo2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + store ptr @__vtable_foo2_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_foo2(%foo2* %0) { + define void @__user_init_foo2(ptr %0) { entry: - %self = alloca %foo2*, align 8 - store %foo2* %0, %foo2** %self, align 8 - %deref = load %foo2*, %foo2** %self, align 8 - %__foo = getelementptr inbounds %foo2, %foo2* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %__foo) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %__foo) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo2(%__vtable_foo2* %0) { + define void @__user_init___vtable_foo2(ptr %0) { entry: - %self = alloca %__vtable_foo2*, align 8 - store %__vtable_foo2* %0, %__vtable_foo2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_foo2(%__vtable_foo2* @__vtable_foo2_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo2(%__vtable_foo2* @__vtable_foo2_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_foo2(ptr @__vtable_foo2_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo2(ptr @__vtable_foo2_instance) ret void } "#); @@ -2435,12 +2427,12 @@ fn function_with_output_used_in_main_by_extension() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, i16 (%foo*, i16, i16, i16*)* } - %foo = type { i32* } - %__vtable_foo2 = type { void (%foo2*)*, i16 (%foo*, i16, i16, i16*)* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } + %__vtable_foo2 = type { ptr, ptr } %foo2 = type { %foo, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -2448,45 +2440,45 @@ fn function_with_output_used_in_main_by_extension() { @__foo2__init = unnamed_addr constant %foo2 zeroinitializer @__vtable_foo2_instance = global %__vtable_foo2 zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define i16 @foo__met1(%foo* %0, i16 %1, i16 %2, i16* %3) { + define i16 @foo__met1(ptr %0, i16 %1, i16 %2, ptr %3) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %foo.met1 = alloca i16, align 2 %mandatoryInput = alloca i16, align 2 - store i16 %1, i16* %mandatoryInput, align 2 + store i16 %1, ptr %mandatoryInput, align 2 %optionalInput = alloca i16, align 2 - store i16 %2, i16* %optionalInput, align 2 - %outputValue = alloca i16*, align 8 - store i16* %3, i16** %outputValue, align 8 - store i16 0, i16* %foo.met1, align 2 - %deref = load i16*, i16** %outputValue, align 8 - %load_mandatoryInput = load i16, i16* %mandatoryInput, align 2 + store i16 %2, ptr %optionalInput, align 2 + %outputValue = alloca ptr, align 8 + store ptr %3, ptr %outputValue, align 8 + store i16 0, ptr %foo.met1, align 2 + %deref = load ptr, ptr %outputValue, align 8 + %load_mandatoryInput = load i16, ptr %mandatoryInput, align 2 %4 = sext i16 %load_mandatoryInput to i32 - %load_optionalInput = load i16, i16* %optionalInput, align 2 + %load_optionalInput = load i16, ptr %optionalInput, align 2 %5 = sext i16 %load_optionalInput to i32 %tmpVar = add i32 %4, %5 %6 = trunc i32 %tmpVar to i16 - store i16 %6, i16* %deref, align 2 - %foo__met1_ret = load i16, i16* %foo.met1, align 2 + store i16 %6, ptr %deref, align 2 + %foo__met1_ret = load i16, ptr %foo.met1, align 2 ret i16 %foo__met1_ret } - define void @foo2(%foo2* %0) { + define void @foo2(ptr %0) { entry: - %this = alloca %foo2*, align 8 - store %foo2* %0, %foo2** %this, align 8 - %__foo = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__foo = getelementptr inbounds %foo2, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo2, ptr %0, i32 0, i32 1 ret void } @@ -2496,116 +2488,114 @@ fn function_with_output_used_in_main_by_extension() { %foo_inst = alloca %foo, align 8 %foo2_inst = alloca %foo2, align 8 %out = alloca i16, align 2 - %0 = bitcast %foo* %foo_inst to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false) - %1 = bitcast %foo2* %foo2_inst to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%foo2* @__foo2__init to i8*), i64 ptrtoint (%foo2* getelementptr (%foo2, %foo2* null, i32 1) to i64), i1 false) - store i16 0, i16* %out, align 2 - store i32 0, i32* %main, align 4 - call void @__init_foo(%foo* %foo_inst) - call void @__init_foo2(%foo2* %foo2_inst) - call void @__user_init_foo(%foo* %foo_inst) - call void @__user_init_foo2(%foo2* %foo2_inst) - %call = call i16 @foo__met1(%foo* %foo_inst, i16 1, i16 5, i16* %out) - %__foo = getelementptr inbounds %foo2, %foo2* %foo2_inst, i32 0, i32 0 - %call1 = call i16 @foo__met1(%foo* %__foo, i16 2, i16 5, i16* %out) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %foo_inst, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %foo2_inst, ptr align 1 @__foo2__init, i64 ptrtoint (ptr getelementptr (%foo2, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %out, align 2 + store i32 0, ptr %main, align 4 + call void @__init_foo(ptr %foo_inst) + call void @__init_foo2(ptr %foo2_inst) + call void @__user_init_foo(ptr %foo_inst) + call void @__user_init_foo2(ptr %foo2_inst) + %call = call i16 @foo__met1(ptr %foo_inst, i16 1, i16 5, ptr %out) + %__foo = getelementptr inbounds %foo2, ptr %foo2_inst, i32 0, i32 0 + %call1 = call i16 @foo__met1(ptr %__foo, i16 2, i16 5, ptr %out) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store i16 (%foo*, i16, i16, i16*)* @foo__met1, i16 (%foo*, i16, i16, i16*)** %met1, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__met1, ptr %met1, align 8 ret void } - define void @__init___vtable_foo2(%__vtable_foo2* %0) { + define void @__init___vtable_foo2(ptr %0) { entry: - %self = alloca %__vtable_foo2*, align 8 - store %__vtable_foo2* %0, %__vtable_foo2** %self, align 8 - %deref = load %__vtable_foo2*, %__vtable_foo2** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo2, %__vtable_foo2* %deref, i32 0, i32 0 - store void (%foo2*)* @foo2, void (%foo2*)** %__body, align 8 - %deref1 = load %__vtable_foo2*, %__vtable_foo2** %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo2, %__vtable_foo2* %deref1, i32 0, i32 1 - store i16 (%foo*, i16, i16, i16*)* @foo__met1, i16 (%foo*, i16, i16, i16*)** %met1, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo2, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__met1, ptr %met1, align 8 ret void } - define void @__init_foo2(%foo2* %0) { + define void @__init_foo2(ptr %0) { entry: - %self = alloca %foo2*, align 8 - store %foo2* %0, %foo2** %self, align 8 - %deref = load %foo2*, %foo2** %self, align 8 - %__foo = getelementptr inbounds %foo2, %foo2* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %__foo) - %deref1 = load %foo2*, %foo2** %self, align 8 - %__foo2 = getelementptr inbounds %foo2, %foo2* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo2, i32 0, i32 0 - store i32* bitcast (%__vtable_foo2* @__vtable_foo2_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %__foo) + %deref1 = load ptr, ptr %self, align 8 + %__foo2 = getelementptr inbounds %foo2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + store ptr @__vtable_foo2_instance, ptr %__vtable, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_foo2(%foo2* %0) { + define void @__user_init_foo2(ptr %0) { entry: - %self = alloca %foo2*, align 8 - store %foo2* %0, %foo2** %self, align 8 - %deref = load %foo2*, %foo2** %self, align 8 - %__foo = getelementptr inbounds %foo2, %foo2* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %__foo) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %__foo) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo2(%__vtable_foo2* %0) { + define void @__user_init___vtable_foo2(ptr %0) { entry: - %self = alloca %__vtable_foo2*, align 8 - store %__vtable_foo2* %0, %__vtable_foo2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_foo2(%__vtable_foo2* @__vtable_foo2_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo2(%__vtable_foo2* @__vtable_foo2_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_foo2(ptr @__vtable_foo2_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo2(ptr @__vtable_foo2_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } diff --git a/src/codegen/tests/oop_tests/debug_tests.rs b/src/codegen/tests/oop_tests/debug_tests.rs index 71235a31b43..29d3ed8e16c 100644 --- a/src/codegen/tests/oop_tests/debug_tests.rs +++ b/src/codegen/tests/oop_tests/debug_tests.rs @@ -23,12 +23,12 @@ fn members_from_base_class_are_available_in_subclasses() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, i16, [81 x i8], [11 x [81 x i8]] } - %__vtable_bar = type { void (%bar*)* } + %__vtable_foo = type { ptr } + %foo = type { ptr, i16, [81 x i8], [11 x [81 x i8]] } + %__vtable_bar = type { ptr } %bar = type { %foo } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer, !dbg !0 @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -36,115 +36,115 @@ fn members_from_base_class_are_available_in_subclasses() { @__bar__init = unnamed_addr constant %bar zeroinitializer, !dbg !22 @__vtable_bar_instance = global %__vtable_bar zeroinitializer - define void @foo(%foo* %0) !dbg !32 { + define void @foo(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata %foo* %0, metadata !36, metadata !DIExpression()), !dbg !37 - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %a = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - %c = getelementptr inbounds %foo, %foo* %0, i32 0, i32 3 + call void @llvm.dbg.declare(metadata ptr %0, metadata !36, metadata !DIExpression()), !dbg !37 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 ret void, !dbg !37 } - define void @bar(%bar* %0) !dbg !38 { + define void @bar(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata %bar* %0, metadata !41, metadata !DIExpression()), !dbg !42 - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__foo = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !41, metadata !DIExpression()), !dbg !42 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 ret void, !dbg !42 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %__foo) - %deref1 = load %bar*, %bar** %self, align 8 - %__foo2 = getelementptr inbounds %bar, %bar* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo2, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %__foo) + %deref1 = load ptr, ptr %self, align 8 + %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %__foo) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %__foo) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -224,14 +224,14 @@ fn write_to_parent_variable_qualified_access() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_fb = type { void (%fb*)* } - %fb = type { i32*, i16, i16 } - %__vtable_fb2 = type { void (%fb2*)* } + %__vtable_fb = type { ptr } + %fb = type { ptr, i16, i16 } + %__vtable_fb2 = type { ptr } %fb2 = type { %fb } - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, %fb2 } + %__vtable_foo = type { ptr } + %foo = type { ptr, %fb2 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_fb__init = unnamed_addr constant %__vtable_fb zeroinitializer @__fb__init = unnamed_addr constant %fb zeroinitializer, !dbg !0 @__vtable_fb_instance = global %__vtable_fb zeroinitializer @@ -242,169 +242,169 @@ fn write_to_parent_variable_qualified_access() { @__foo__init = unnamed_addr constant %foo zeroinitializer, !dbg !19 @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @fb(%fb* %0) !dbg !32 { + define void @fb(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata %fb* %0, metadata !36, metadata !DIExpression()), !dbg !37 - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 - %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 1 - %y = getelementptr inbounds %fb, %fb* %0, i32 0, i32 2 + call void @llvm.dbg.declare(metadata ptr %0, metadata !36, metadata !DIExpression()), !dbg !37 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %fb, ptr %0, i32 0, i32 2 ret void, !dbg !37 } - define void @fb2(%fb2* %0) !dbg !38 { + define void @fb2(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata %fb2* %0, metadata !41, metadata !DIExpression()), !dbg !42 - %this = alloca %fb2*, align 8 - store %fb2* %0, %fb2** %this, align 8 - %__fb = getelementptr inbounds %fb2, %fb2* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !41, metadata !DIExpression()), !dbg !42 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__fb = getelementptr inbounds %fb2, ptr %0, i32 0, i32 0 ret void, !dbg !42 } - define void @foo(%foo* %0) !dbg !43 { + define void @foo(ptr %0) !dbg !43 { entry: - call void @llvm.dbg.declare(metadata %foo* %0, metadata !46, metadata !DIExpression()), !dbg !47 - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %myFb = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %__fb = getelementptr inbounds %fb2, %fb2* %myFb, i32 0, i32 0, !dbg !47 - %x = getelementptr inbounds %fb, %fb* %__fb, i32 0, i32 1, !dbg !47 - store i16 1, i16* %x, align 2, !dbg !47 + call void @llvm.dbg.declare(metadata ptr %0, metadata !46, metadata !DIExpression()), !dbg !47 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %myFb = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__fb = getelementptr inbounds %fb2, ptr %myFb, i32 0, i32 0, !dbg !47 + %x = getelementptr inbounds %fb, ptr %__fb, i32 0, i32 1, !dbg !47 + store i16 1, ptr %x, align 2, !dbg !47 ret void, !dbg !48 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_fb(%__vtable_fb* %0) { + define void @__init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 - %deref = load %__vtable_fb*, %__vtable_fb** %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, %__vtable_fb* %deref, i32 0, i32 0 - store void (%fb*)* @fb, void (%fb*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @fb, ptr %__body, align 8 ret void } - define void @__init___vtable_fb2(%__vtable_fb2* %0) { + define void @__init___vtable_fb2(ptr %0) { entry: - %self = alloca %__vtable_fb2*, align 8 - store %__vtable_fb2* %0, %__vtable_fb2** %self, align 8 - %deref = load %__vtable_fb2*, %__vtable_fb2** %self, align 8 - %__body = getelementptr inbounds %__vtable_fb2, %__vtable_fb2* %deref, i32 0, i32 0 - store void (%fb2*)* @fb2, void (%fb2*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @fb2, ptr %__body, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_fb2(%fb2* %0) { + define void @__init_fb2(ptr %0) { entry: - %self = alloca %fb2*, align 8 - store %fb2* %0, %fb2** %self, align 8 - %deref = load %fb2*, %fb2** %self, align 8 - %__fb = getelementptr inbounds %fb2, %fb2* %deref, i32 0, i32 0 - call void @__init_fb(%fb* %__fb) - %deref1 = load %fb2*, %fb2** %self, align 8 - %__fb2 = getelementptr inbounds %fb2, %fb2* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %fb, %fb* %__fb2, i32 0, i32 0 - store i32* bitcast (%__vtable_fb2* @__vtable_fb2_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + call void @__init_fb(ptr %__fb) + %deref1 = load ptr, ptr %self, align 8 + %__fb2 = getelementptr inbounds %fb2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %fb, ptr %__fb2, i32 0, i32 0 + store ptr @__vtable_fb2_instance, ptr %__vtable, align 8 ret void } - define void @__init_fb(%fb* %0) { + define void @__init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 - %deref = load %fb*, %fb** %self, align 8 - %__vtable = getelementptr inbounds %fb, %fb* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_fb* @__vtable_fb_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %myFb = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 1 - call void @__init_fb2(%fb2* %myFb) - %deref1 = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + call void @__init_fb2(ptr %myFb) + %deref1 = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_fb(%fb* %0) { + define void @__user_init_fb(ptr %0) { entry: - %self = alloca %fb*, align 8 - store %fb* %0, %fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_fb2(%fb2* %0) { + define void @__user_init_fb2(ptr %0) { entry: - %self = alloca %fb2*, align 8 - store %fb2* %0, %fb2** %self, align 8 - %deref = load %fb2*, %fb2** %self, align 8 - %__fb = getelementptr inbounds %fb2, %fb2* %deref, i32 0, i32 0 - call void @__user_init_fb(%fb* %__fb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + call void @__user_init_fb(ptr %__fb) ret void } - define void @__user_init___vtable_fb(%__vtable_fb* %0) { + define void @__user_init___vtable_fb(ptr %0) { entry: - %self = alloca %__vtable_fb*, align 8 - store %__vtable_fb* %0, %__vtable_fb** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_fb2(%__vtable_fb2* %0) { + define void @__user_init___vtable_fb2(ptr %0) { entry: - %self = alloca %__vtable_fb2*, align 8 - store %__vtable_fb2* %0, %__vtable_fb2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %myFb = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 1 - call void @__user_init_fb2(%fb2* %myFb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + call void @__user_init_fb2(ptr %myFb) ret void } define void @__init___Test() { entry: - call void @__init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) - call void @__init___vtable_fb2(%__vtable_fb2* @__vtable_fb2_instance) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_fb(%__vtable_fb* @__vtable_fb_instance) - call void @__user_init___vtable_fb2(%__vtable_fb2* @__vtable_fb2_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_fb(ptr @__vtable_fb_instance) + call void @__init___vtable_fb2(ptr @__vtable_fb2_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_fb(ptr @__vtable_fb_instance) + call void @__user_init___vtable_fb2(ptr @__vtable_fb2_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -494,14 +494,14 @@ fn write_to_parent_variable_in_instance() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32*, [81 x i8] } - %__vtable_bar = type { void (%bar*)*, void (%foo*)* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr, [81 x i8] } + %__vtable_bar = type { ptr, ptr } %bar = type { %foo } @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"world\00" - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer, !dbg !0 @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -509,37 +509,35 @@ fn write_to_parent_variable_in_instance() { @__bar__init = unnamed_addr constant %bar zeroinitializer, !dbg !16 @__vtable_bar_instance = global %__vtable_bar zeroinitializer - define void @foo(%foo* %0) !dbg !26 { + define void @foo(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata %foo* %0, metadata !30, metadata !DIExpression()), !dbg !31 - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + call void @llvm.dbg.declare(metadata ptr %0, metadata !30, metadata !DIExpression()), !dbg !31 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void, !dbg !31 } - define void @foo__baz(%foo* %0) !dbg !32 { + define void @foo__baz(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata %foo* %0, metadata !33, metadata !DIExpression()), !dbg !34 - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %s to i8*, !dbg !34 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false), !dbg !34 + call void @llvm.dbg.declare(metadata ptr %0, metadata !33, metadata !DIExpression()), !dbg !34 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false), !dbg !34 ret void, !dbg !35 } - define void @bar(%bar* %0) !dbg !36 { + define void @bar(ptr %0) !dbg !36 { entry: - call void @llvm.dbg.declare(metadata %bar* %0, metadata !39, metadata !DIExpression()), !dbg !40 - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__foo = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %__foo, i32 0, i32 1, !dbg !40 - %1 = bitcast [81 x i8]* %s to i8*, !dbg !40 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false), !dbg !40 + call void @llvm.dbg.declare(metadata ptr %0, metadata !39, metadata !DIExpression()), !dbg !40 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %__foo, i32 0, i32 1, !dbg !40 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_1, i32 6, i1 false), !dbg !40 ret void, !dbg !41 } @@ -547,125 +545,123 @@ fn write_to_parent_variable_in_instance() { entry: %s = alloca [81 x i8], align 1 %fb = alloca %bar, align 8 - call void @llvm.dbg.declare(metadata [81 x i8]* %s, metadata !45, metadata !DIExpression()), !dbg !46 - %0 = bitcast [81 x i8]* %s to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata %bar* %fb, metadata !47, metadata !DIExpression()), !dbg !48 - %1 = bitcast %bar* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%bar* @__bar__init to i8*), i64 ptrtoint (%bar* getelementptr (%bar, %bar* null, i32 1) to i64), i1 false) - call void @__init_bar(%bar* %fb), !dbg !49 - call void @__user_init_bar(%bar* %fb), !dbg !49 - %__foo = getelementptr inbounds %bar, %bar* %fb, i32 0, i32 0, !dbg !49 - call void @foo__baz(%foo* %__foo), !dbg !50 - call void @bar(%bar* %fb), !dbg !51 + call void @llvm.dbg.declare(metadata ptr %s, metadata !45, metadata !DIExpression()), !dbg !46 + call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %fb, metadata !47, metadata !DIExpression()), !dbg !48 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__bar__init, i64 ptrtoint (ptr getelementptr (%bar, ptr null, i32 1) to i64), i1 false) + call void @__init_bar(ptr %fb), !dbg !49 + call void @__user_init_bar(ptr %fb), !dbg !49 + %__foo = getelementptr inbounds %bar, ptr %fb, i32 0, i32 0, !dbg !49 + call void @foo__baz(ptr %__foo), !dbg !50 + call void @bar(ptr %fb), !dbg !51 ret void, !dbg !52 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #2 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__baz, void (%foo*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__baz, ptr %baz, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 - %deref1 = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %baz = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__baz, void (%foo*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__baz, ptr %baz, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %__foo) - %deref1 = load %bar*, %bar** %self, align 8 - %__foo2 = getelementptr inbounds %bar, %bar* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo2, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %__foo) + %deref1 = load ptr, ptr %self, align 8 + %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %__foo) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %__foo) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn } - attributes #2 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #2 = { argmemonly nocallback nofree nounwind willreturn writeonly } !llvm.module.flags = !{!22, !23} !llvm.dbg.cu = !{!24} @@ -768,14 +764,14 @@ fn array_in_parent_generated() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_grandparent = type { void (%grandparent*)* } - %grandparent = type { i32*, [6 x i16], i16 } - %__vtable_parent = type { void (%parent*)* } + %__vtable_grandparent = type { ptr } + %grandparent = type { ptr, [6 x i16], i16 } + %__vtable_parent = type { ptr } %parent = type { %grandparent, [11 x i16], i16 } - %__vtable_child = type { void (%child*)* } + %__vtable_child = type { ptr } %child = type { %parent, [11 x i16] } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_grandparent__init = unnamed_addr constant %__vtable_grandparent zeroinitializer @__grandparent__init = unnamed_addr constant %grandparent zeroinitializer, !dbg !0 @__vtable_grandparent_instance = global %__vtable_grandparent zeroinitializer @@ -786,207 +782,206 @@ fn array_in_parent_generated() { @__child__init = unnamed_addr constant %child zeroinitializer, !dbg !27 @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @grandparent(%grandparent* %0) !dbg !38 { + define void @grandparent(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata %grandparent* %0, metadata !42, metadata !DIExpression()), !dbg !43 - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 2 + call void @llvm.dbg.declare(metadata ptr %0, metadata !42, metadata !DIExpression()), !dbg !43 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 ret void, !dbg !43 } - define void @parent(%parent* %0) !dbg !44 { + define void @parent(ptr %0) !dbg !44 { entry: - call void @llvm.dbg.declare(metadata %parent* %0, metadata !47, metadata !DIExpression()), !dbg !48 - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + call void @llvm.dbg.declare(metadata ptr %0, metadata !47, metadata !DIExpression()), !dbg !48 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void, !dbg !48 } - define void @child(%child* %0) !dbg !49 { + define void @child(ptr %0) !dbg !49 { entry: - call void @llvm.dbg.declare(metadata %child* %0, metadata !52, metadata !DIExpression()), !dbg !53 - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %z = getelementptr inbounds %child, %child* %0, i32 0, i32 1 + call void @llvm.dbg.declare(metadata ptr %0, metadata !52, metadata !DIExpression()), !dbg !53 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 ret void, !dbg !53 } define void @main() !dbg !54 { entry: %arr = alloca [11 x %child], align 8 - call void @llvm.dbg.declare(metadata [11 x %child]* %arr, metadata !57, metadata !DIExpression()), !dbg !59 - %0 = bitcast [11 x %child]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([11 x %child]* getelementptr ([11 x %child], [11 x %child]* null, i32 1) to i64), i1 false) - %tmpVar = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 0, !dbg !60 - %__parent = getelementptr inbounds %child, %child* %tmpVar, i32 0, i32 0, !dbg !60 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 0, !dbg !60 - %a = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 2, !dbg !60 - store i16 10, i16* %a, align 2, !dbg !60 - %tmpVar1 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 0, !dbg !61 - %__parent2 = getelementptr inbounds %child, %child* %tmpVar1, i32 0, i32 0, !dbg !61 - %__grandparent3 = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0, !dbg !61 - %y = getelementptr inbounds %grandparent, %grandparent* %__grandparent3, i32 0, i32 1, !dbg !61 - %tmpVar4 = getelementptr inbounds [6 x i16], [6 x i16]* %y, i32 0, i32 0, !dbg !61 - store i16 20, i16* %tmpVar4, align 2, !dbg !61 - %tmpVar5 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 1, !dbg !62 - %__parent6 = getelementptr inbounds %child, %child* %tmpVar5, i32 0, i32 0, !dbg !62 - %b = getelementptr inbounds %parent, %parent* %__parent6, i32 0, i32 2, !dbg !62 - store i16 30, i16* %b, align 2, !dbg !62 - %tmpVar7 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 1, !dbg !63 - %__parent8 = getelementptr inbounds %child, %child* %tmpVar7, i32 0, i32 0, !dbg !63 - %x = getelementptr inbounds %parent, %parent* %__parent8, i32 0, i32 1, !dbg !63 - %tmpVar9 = getelementptr inbounds [11 x i16], [11 x i16]* %x, i32 0, i32 1, !dbg !63 - store i16 40, i16* %tmpVar9, align 2, !dbg !63 - %tmpVar10 = getelementptr inbounds [11 x %child], [11 x %child]* %arr, i32 0, i32 2, !dbg !64 - %z = getelementptr inbounds %child, %child* %tmpVar10, i32 0, i32 1, !dbg !64 - %tmpVar11 = getelementptr inbounds [11 x i16], [11 x i16]* %z, i32 0, i32 2, !dbg !64 - store i16 50, i16* %tmpVar11, align 2, !dbg !64 + call void @llvm.dbg.declare(metadata ptr %arr, metadata !57, metadata !DIExpression()), !dbg !59 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([11 x %child], ptr null, i32 1) to i64), i1 false) + %tmpVar = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0, !dbg !60 + %__parent = getelementptr inbounds %child, ptr %tmpVar, i32 0, i32 0, !dbg !60 + %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0, !dbg !60 + %a = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 2, !dbg !60 + store i16 10, ptr %a, align 2, !dbg !60 + %tmpVar1 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0, !dbg !61 + %__parent2 = getelementptr inbounds %child, ptr %tmpVar1, i32 0, i32 0, !dbg !61 + %__grandparent3 = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0, !dbg !61 + %y = getelementptr inbounds %grandparent, ptr %__grandparent3, i32 0, i32 1, !dbg !61 + %tmpVar4 = getelementptr inbounds [6 x i16], ptr %y, i32 0, i32 0, !dbg !61 + store i16 20, ptr %tmpVar4, align 2, !dbg !61 + %tmpVar5 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1, !dbg !62 + %__parent6 = getelementptr inbounds %child, ptr %tmpVar5, i32 0, i32 0, !dbg !62 + %b = getelementptr inbounds %parent, ptr %__parent6, i32 0, i32 2, !dbg !62 + store i16 30, ptr %b, align 2, !dbg !62 + %tmpVar7 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1, !dbg !63 + %__parent8 = getelementptr inbounds %child, ptr %tmpVar7, i32 0, i32 0, !dbg !63 + %x = getelementptr inbounds %parent, ptr %__parent8, i32 0, i32 1, !dbg !63 + %tmpVar9 = getelementptr inbounds [11 x i16], ptr %x, i32 0, i32 1, !dbg !63 + store i16 40, ptr %tmpVar9, align 2, !dbg !63 + %tmpVar10 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 2, !dbg !64 + %z = getelementptr inbounds %child, ptr %tmpVar10, i32 0, i32 1, !dbg !64 + %tmpVar11 = getelementptr inbounds [11 x i16], ptr %z, i32 0, i32 2, !dbg !64 + store i16 50, ptr %tmpVar11, align 2, !dbg !64 ret void, !dbg !65 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - define void @__init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 - %deref = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref, i32 0, i32 0 - store void (%grandparent*)* @grandparent, void (%grandparent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @grandparent, ptr %__body, align 8 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__init_grandparent(%grandparent* %__grandparent) - %deref1 = load %parent*, %parent** %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, %parent* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent2, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__init_grandparent(ptr %__grandparent) + %deref1 = load ptr, ptr %self, align 8 + %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_grandparent(%grandparent* %0) { + define void @__init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 - %deref = load %grandparent*, %grandparent** %self, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_grandparent* @__vtable_grandparent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_grandparent(%grandparent* %0) { + define void @__user_init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__user_init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__user_init_grandparent(%grandparent* %__grandparent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__user_init_grandparent(ptr %__grandparent) ret void } define void @__init___Test() { entry: - call void @__init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1093,14 +1088,14 @@ fn complex_array_access_generated() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_grandparent = type { void (%grandparent*)* } - %grandparent = type { i32*, [6 x i16], i16 } - %__vtable_parent = type { void (%parent*)* } + %__vtable_grandparent = type { ptr } + %grandparent = type { ptr, [6 x i16], i16 } + %__vtable_parent = type { ptr } %parent = type { %grandparent, [11 x i16], i16 } - %__vtable_child = type { void (%child*)* } + %__vtable_child = type { ptr } %child = type { %parent, [11 x i16] } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_grandparent__init = unnamed_addr constant %__vtable_grandparent zeroinitializer @__grandparent__init = unnamed_addr constant %grandparent zeroinitializer, !dbg !0 @__vtable_grandparent_instance = global %__vtable_grandparent zeroinitializer @@ -1111,194 +1106,194 @@ fn complex_array_access_generated() { @__child__init = unnamed_addr constant %child zeroinitializer, !dbg !27 @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @grandparent(%grandparent* %0) !dbg !38 { + define void @grandparent(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata %grandparent* %0, metadata !42, metadata !DIExpression()), !dbg !43 - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 2 + call void @llvm.dbg.declare(metadata ptr %0, metadata !42, metadata !DIExpression()), !dbg !43 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 ret void, !dbg !43 } - define void @parent(%parent* %0) !dbg !44 { + define void @parent(ptr %0) !dbg !44 { entry: - call void @llvm.dbg.declare(metadata %parent* %0, metadata !47, metadata !DIExpression()), !dbg !48 - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + call void @llvm.dbg.declare(metadata ptr %0, metadata !47, metadata !DIExpression()), !dbg !48 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void, !dbg !48 } - define void @child(%child* %0) !dbg !49 { + define void @child(ptr %0) !dbg !49 { entry: - call void @llvm.dbg.declare(metadata %child* %0, metadata !52, metadata !DIExpression()), !dbg !53 - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %z = getelementptr inbounds %child, %child* %0, i32 0, i32 1 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 0, !dbg !53 - %y = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 1, !dbg !53 - %b = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2, !dbg !53 - %load_b = load i16, i16* %b, align 2, !dbg !53 + call void @llvm.dbg.declare(metadata ptr %0, metadata !52, metadata !DIExpression()), !dbg !53 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0, !dbg !53 + %y = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 1, !dbg !53 + %b = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2, !dbg !53 + %load_b = load i16, ptr %b, align 2, !dbg !53 %1 = sext i16 %load_b to i32, !dbg !53 - %b1 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2, !dbg !53 - %load_b2 = load i16, i16* %b1, align 2, !dbg !53 + %b1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2, !dbg !53 + %load_b2 = load i16, ptr %b1, align 2, !dbg !53 %2 = sext i16 %load_b2 to i32, !dbg !53 %tmpVar = mul i32 %2, 2, !dbg !53 %tmpVar3 = mul i32 1, %tmpVar, !dbg !53 %tmpVar4 = add i32 %tmpVar3, 0, !dbg !53 - %tmpVar5 = getelementptr inbounds [11 x i16], [11 x i16]* %z, i32 0, i32 %tmpVar4, !dbg !53 - %load_tmpVar = load i16, i16* %tmpVar5, align 2, !dbg !53 + %tmpVar5 = getelementptr inbounds [11 x i16], ptr %z, i32 0, i32 %tmpVar4, !dbg !53 + %load_tmpVar = load i16, ptr %tmpVar5, align 2, !dbg !53 %3 = sext i16 %load_tmpVar to i32, !dbg !53 %tmpVar6 = add i32 %1, %3, !dbg !53 - %__grandparent7 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 0, !dbg !53 - %a = getelementptr inbounds %grandparent, %grandparent* %__grandparent7, i32 0, i32 2, !dbg !53 - %load_a = load i16, i16* %a, align 2, !dbg !53 + %__grandparent7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0, !dbg !53 + %a = getelementptr inbounds %grandparent, ptr %__grandparent7, i32 0, i32 2, !dbg !53 + %load_a = load i16, ptr %a, align 2, !dbg !53 %4 = sext i16 %load_a to i32, !dbg !53 %tmpVar8 = sub i32 %tmpVar6, %4, !dbg !53 %tmpVar9 = mul i32 1, %tmpVar8, !dbg !53 %tmpVar10 = add i32 %tmpVar9, 0, !dbg !53 - %tmpVar11 = getelementptr inbounds [6 x i16], [6 x i16]* %y, i32 0, i32 %tmpVar10, !dbg !53 - store i16 20, i16* %tmpVar11, align 2, !dbg !53 + %tmpVar11 = getelementptr inbounds [6 x i16], ptr %y, i32 0, i32 %tmpVar10, !dbg !53 + store i16 20, ptr %tmpVar11, align 2, !dbg !53 ret void, !dbg !54 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 - %deref = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref, i32 0, i32 0 - store void (%grandparent*)* @grandparent, void (%grandparent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @grandparent, ptr %__body, align 8 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__init_grandparent(%grandparent* %__grandparent) - %deref1 = load %parent*, %parent** %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, %parent* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent2, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__init_grandparent(ptr %__grandparent) + %deref1 = load ptr, ptr %self, align 8 + %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_grandparent(%grandparent* %0) { + define void @__init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 - %deref = load %grandparent*, %grandparent** %self, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_grandparent* @__vtable_grandparent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_grandparent(%grandparent* %0) { + define void @__user_init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__user_init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__user_init_grandparent(%grandparent* %__grandparent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__user_init_grandparent(ptr %__grandparent) ret void } define void @__init___Test() { entry: - call void @__init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1380,12 +1375,12 @@ fn function_block_method_debug_info() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } - %__vtable_bar = type { void (%bar*)*, void (%foo*)* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } + %__vtable_bar = type { ptr, ptr } %bar = type { %foo } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer, !dbg !0 @__vtable_foo_instance = global %__vtable_foo zeroinitializer @@ -1393,127 +1388,127 @@ fn function_block_method_debug_info() { @__bar__init = unnamed_addr constant %bar zeroinitializer, !dbg !10 @__vtable_bar_instance = global %__vtable_bar zeroinitializer - define void @foo(%foo* %0) !dbg !20 { + define void @foo(ptr %0) !dbg !20 { entry: - call void @llvm.dbg.declare(metadata %foo* %0, metadata !24, metadata !DIExpression()), !dbg !25 - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !24, metadata !DIExpression()), !dbg !25 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void, !dbg !25 } - define void @foo__baz(%foo* %0) !dbg !26 { + define void @foo__baz(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata %foo* %0, metadata !27, metadata !DIExpression()), !dbg !28 - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !27, metadata !DIExpression()), !dbg !28 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void, !dbg !28 } - define void @bar(%bar* %0) !dbg !29 { + define void @bar(ptr %0) !dbg !29 { entry: - call void @llvm.dbg.declare(metadata %bar* %0, metadata !32, metadata !DIExpression()), !dbg !33 - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__foo = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !32, metadata !DIExpression()), !dbg !33 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 ret void, !dbg !33 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__baz, void (%foo*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__baz, ptr %baz, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 - %deref1 = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %baz = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__baz, void (%foo*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__baz, ptr %baz, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__init_foo(%foo* %__foo) - %deref1 = load %bar*, %bar** %self, align 8 - %__foo2 = getelementptr inbounds %bar, %bar* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, %foo* %__foo2, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__init_foo(ptr %__foo) + %deref1 = load ptr, ptr %self, align 8 + %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %__foo = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 0 - call void @__user_init_foo(%foo* %__foo) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + call void @__user_init_foo(ptr %__foo) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!16, !17} !llvm.dbg.cu = !{!18} @@ -1623,14 +1618,14 @@ END_FUNCTION target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i32 } - %__vtable_child = type { void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i32 } + %__vtable_child = type { ptr } %child = type { %parent, i32 } - %__vtable_grandchild = type { void (%grandchild*)* } + %__vtable_grandchild = type { ptr } %grandchild = type { %child, i32 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer @__parent__init = unnamed_addr constant %parent zeroinitializer, !dbg !0 @__vtable_parent_instance = global %__vtable_parent zeroinitializer @@ -1641,33 +1636,33 @@ END_FUNCTION @__grandchild__init = unnamed_addr constant %grandchild zeroinitializer, !dbg !19 @__vtable_grandchild_instance = global %__vtable_grandchild zeroinitializer - define void @parent(%parent* %0) !dbg !30 { + define void @parent(ptr %0) !dbg !30 { entry: - call void @llvm.dbg.declare(metadata %parent* %0, metadata !34, metadata !DIExpression()), !dbg !35 - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %a = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + call void @llvm.dbg.declare(metadata ptr %0, metadata !34, metadata !DIExpression()), !dbg !35 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void, !dbg !35 } - define void @child(%child* %0) !dbg !36 { + define void @child(ptr %0) !dbg !36 { entry: - call void @llvm.dbg.declare(metadata %child* %0, metadata !39, metadata !DIExpression()), !dbg !40 - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %b = getelementptr inbounds %child, %child* %0, i32 0, i32 1 + call void @llvm.dbg.declare(metadata ptr %0, metadata !39, metadata !DIExpression()), !dbg !40 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %child, ptr %0, i32 0, i32 1 ret void, !dbg !40 } - define void @grandchild(%grandchild* %0) !dbg !41 { + define void @grandchild(ptr %0) !dbg !41 { entry: - call void @llvm.dbg.declare(metadata %grandchild* %0, metadata !44, metadata !DIExpression()), !dbg !45 - %this = alloca %grandchild*, align 8 - store %grandchild* %0, %grandchild** %this, align 8 - %__child = getelementptr inbounds %grandchild, %grandchild* %0, i32 0, i32 0 - %c = getelementptr inbounds %grandchild, %grandchild* %0, i32 0, i32 1 + call void @llvm.dbg.declare(metadata ptr %0, metadata !44, metadata !DIExpression()), !dbg !45 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__child = getelementptr inbounds %grandchild, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds %grandchild, ptr %0, i32 0, i32 1 ret void, !dbg !45 } @@ -1680,258 +1675,252 @@ END_FUNCTION %parent1 = alloca %parent, align 8 %child1 = alloca %child, align 8 %grandchild1 = alloca %grandchild, align 8 - call void @llvm.dbg.declare(metadata [3 x %parent]* %array_of_parent, metadata !49, metadata !DIExpression()), !dbg !53 - %0 = bitcast [3 x %parent]* %array_of_parent to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([3 x %parent]* getelementptr ([3 x %parent], [3 x %parent]* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata [3 x %child]* %array_of_child, metadata !54, metadata !DIExpression()), !dbg !56 - %1 = bitcast [3 x %child]* %array_of_child to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([3 x %child]* getelementptr ([3 x %child], [3 x %child]* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata [3 x %grandchild]* %array_of_grandchild, metadata !57, metadata !DIExpression()), !dbg !59 - %2 = bitcast [3 x %grandchild]* %array_of_grandchild to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([3 x %grandchild]* getelementptr ([3 x %grandchild], [3 x %grandchild]* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata %parent* %parent1, metadata !60, metadata !DIExpression()), !dbg !61 - %3 = bitcast %parent* %parent1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 bitcast (%parent* @__parent__init to i8*), i64 ptrtoint (%parent* getelementptr (%parent, %parent* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata %child* %child1, metadata !62, metadata !DIExpression()), !dbg !63 - %4 = bitcast %child* %child1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 bitcast (%child* @__child__init to i8*), i64 ptrtoint (%child* getelementptr (%child, %child* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata %grandchild* %grandchild1, metadata !64, metadata !DIExpression()), !dbg !65 - %5 = bitcast %grandchild* %grandchild1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 bitcast (%grandchild* @__grandchild__init to i8*), i64 ptrtoint (%grandchild* getelementptr (%grandchild, %grandchild* null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata i32* %main, metadata !66, metadata !DIExpression()), !dbg !67 - store i32 0, i32* %main, align 4 - call void @__init_parent(%parent* %parent1), !dbg !68 - call void @__init_child(%child* %child1), !dbg !68 - call void @__init_grandchild(%grandchild* %grandchild1), !dbg !68 - call void @__user_init_parent(%parent* %parent1), !dbg !68 - call void @__user_init_child(%child* %child1), !dbg !68 - call void @__user_init_grandchild(%grandchild* %grandchild1), !dbg !68 - %a = getelementptr inbounds %parent, %parent* %parent1, i32 0, i32 1, !dbg !69 - store i32 1, i32* %a, align 4, !dbg !69 - %__parent = getelementptr inbounds %child, %child* %child1, i32 0, i32 0, !dbg !70 - %a1 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1, !dbg !70 - store i32 2, i32* %a1, align 4, !dbg !70 - %b = getelementptr inbounds %child, %child* %child1, i32 0, i32 1, !dbg !71 - store i32 3, i32* %b, align 4, !dbg !71 - %__child = getelementptr inbounds %grandchild, %grandchild* %grandchild1, i32 0, i32 0, !dbg !72 - %__parent2 = getelementptr inbounds %child, %child* %__child, i32 0, i32 0, !dbg !72 - %a3 = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 1, !dbg !72 - store i32 4, i32* %a3, align 4, !dbg !72 - %__child4 = getelementptr inbounds %grandchild, %grandchild* %grandchild1, i32 0, i32 0, !dbg !73 - %b5 = getelementptr inbounds %child, %child* %__child4, i32 0, i32 1, !dbg !73 - store i32 5, i32* %b5, align 4, !dbg !73 - %c = getelementptr inbounds %grandchild, %grandchild* %grandchild1, i32 0, i32 1, !dbg !74 - store i32 6, i32* %c, align 4, !dbg !74 - %tmpVar = getelementptr inbounds [3 x %parent], [3 x %parent]* %array_of_parent, i32 0, i32 0, !dbg !75 - %a6 = getelementptr inbounds %parent, %parent* %tmpVar, i32 0, i32 1, !dbg !75 - store i32 7, i32* %a6, align 4, !dbg !75 - %tmpVar7 = getelementptr inbounds [3 x %child], [3 x %child]* %array_of_child, i32 0, i32 0, !dbg !76 - %__parent8 = getelementptr inbounds %child, %child* %tmpVar7, i32 0, i32 0, !dbg !76 - %a9 = getelementptr inbounds %parent, %parent* %__parent8, i32 0, i32 1, !dbg !76 - store i32 8, i32* %a9, align 4, !dbg !76 - %tmpVar10 = getelementptr inbounds [3 x %child], [3 x %child]* %array_of_child, i32 0, i32 0, !dbg !77 - %b11 = getelementptr inbounds %child, %child* %tmpVar10, i32 0, i32 1, !dbg !77 - store i32 9, i32* %b11, align 4, !dbg !77 - %tmpVar12 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 0, !dbg !78 - %__child13 = getelementptr inbounds %grandchild, %grandchild* %tmpVar12, i32 0, i32 0, !dbg !78 - %__parent14 = getelementptr inbounds %child, %child* %__child13, i32 0, i32 0, !dbg !78 - %a15 = getelementptr inbounds %parent, %parent* %__parent14, i32 0, i32 1, !dbg !78 - store i32 10, i32* %a15, align 4, !dbg !78 - %tmpVar16 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 0, !dbg !79 - %__child17 = getelementptr inbounds %grandchild, %grandchild* %tmpVar16, i32 0, i32 0, !dbg !79 - %b18 = getelementptr inbounds %child, %child* %__child17, i32 0, i32 1, !dbg !79 - store i32 11, i32* %b18, align 4, !dbg !79 - %tmpVar19 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 0, !dbg !80 - %c20 = getelementptr inbounds %grandchild, %grandchild* %tmpVar19, i32 0, i32 1, !dbg !80 - store i32 12, i32* %c20, align 4, !dbg !80 - %tmpVar21 = getelementptr inbounds [3 x %parent], [3 x %parent]* %array_of_parent, i32 0, i32 1, !dbg !81 - %a22 = getelementptr inbounds %parent, %parent* %tmpVar21, i32 0, i32 1, !dbg !81 - store i32 13, i32* %a22, align 4, !dbg !81 - %tmpVar23 = getelementptr inbounds [3 x %child], [3 x %child]* %array_of_child, i32 0, i32 1, !dbg !82 - %__parent24 = getelementptr inbounds %child, %child* %tmpVar23, i32 0, i32 0, !dbg !82 - %a25 = getelementptr inbounds %parent, %parent* %__parent24, i32 0, i32 1, !dbg !82 - store i32 14, i32* %a25, align 4, !dbg !82 - %tmpVar26 = getelementptr inbounds [3 x %child], [3 x %child]* %array_of_child, i32 0, i32 1, !dbg !83 - %b27 = getelementptr inbounds %child, %child* %tmpVar26, i32 0, i32 1, !dbg !83 - store i32 15, i32* %b27, align 4, !dbg !83 - %tmpVar28 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 1, !dbg !84 - %__child29 = getelementptr inbounds %grandchild, %grandchild* %tmpVar28, i32 0, i32 0, !dbg !84 - %__parent30 = getelementptr inbounds %child, %child* %__child29, i32 0, i32 0, !dbg !84 - %a31 = getelementptr inbounds %parent, %parent* %__parent30, i32 0, i32 1, !dbg !84 - store i32 16, i32* %a31, align 4, !dbg !84 - %tmpVar32 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 1, !dbg !85 - %__child33 = getelementptr inbounds %grandchild, %grandchild* %tmpVar32, i32 0, i32 0, !dbg !85 - %b34 = getelementptr inbounds %child, %child* %__child33, i32 0, i32 1, !dbg !85 - store i32 17, i32* %b34, align 4, !dbg !85 - %tmpVar35 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 1, !dbg !86 - %c36 = getelementptr inbounds %grandchild, %grandchild* %tmpVar35, i32 0, i32 1, !dbg !86 - store i32 18, i32* %c36, align 4, !dbg !86 - %tmpVar37 = getelementptr inbounds [3 x %parent], [3 x %parent]* %array_of_parent, i32 0, i32 2, !dbg !87 - %a38 = getelementptr inbounds %parent, %parent* %tmpVar37, i32 0, i32 1, !dbg !87 - store i32 19, i32* %a38, align 4, !dbg !87 - %tmpVar39 = getelementptr inbounds [3 x %child], [3 x %child]* %array_of_child, i32 0, i32 2, !dbg !88 - %__parent40 = getelementptr inbounds %child, %child* %tmpVar39, i32 0, i32 0, !dbg !88 - %a41 = getelementptr inbounds %parent, %parent* %__parent40, i32 0, i32 1, !dbg !88 - store i32 20, i32* %a41, align 4, !dbg !88 - %tmpVar42 = getelementptr inbounds [3 x %child], [3 x %child]* %array_of_child, i32 0, i32 2, !dbg !89 - %b43 = getelementptr inbounds %child, %child* %tmpVar42, i32 0, i32 1, !dbg !89 - store i32 21, i32* %b43, align 4, !dbg !89 - %tmpVar44 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 2, !dbg !90 - %__child45 = getelementptr inbounds %grandchild, %grandchild* %tmpVar44, i32 0, i32 0, !dbg !90 - %__parent46 = getelementptr inbounds %child, %child* %__child45, i32 0, i32 0, !dbg !90 - %a47 = getelementptr inbounds %parent, %parent* %__parent46, i32 0, i32 1, !dbg !90 - store i32 22, i32* %a47, align 4, !dbg !90 - %tmpVar48 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 2, !dbg !91 - %__child49 = getelementptr inbounds %grandchild, %grandchild* %tmpVar48, i32 0, i32 0, !dbg !91 - %b50 = getelementptr inbounds %child, %child* %__child49, i32 0, i32 1, !dbg !91 - store i32 23, i32* %b50, align 4, !dbg !91 - %tmpVar51 = getelementptr inbounds [3 x %grandchild], [3 x %grandchild]* %array_of_grandchild, i32 0, i32 2, !dbg !92 - %c52 = getelementptr inbounds %grandchild, %grandchild* %tmpVar51, i32 0, i32 1, !dbg !92 - store i32 24, i32* %c52, align 4, !dbg !92 - %main_ret = load i32, i32* %main, align 4, !dbg !93 + call void @llvm.dbg.declare(metadata ptr %array_of_parent, metadata !49, metadata !DIExpression()), !dbg !53 + call void @llvm.memset.p0.i64(ptr align 1 %array_of_parent, i8 0, i64 ptrtoint (ptr getelementptr ([3 x %parent], ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %array_of_child, metadata !54, metadata !DIExpression()), !dbg !56 + call void @llvm.memset.p0.i64(ptr align 1 %array_of_child, i8 0, i64 ptrtoint (ptr getelementptr ([3 x %child], ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %array_of_grandchild, metadata !57, metadata !DIExpression()), !dbg !59 + call void @llvm.memset.p0.i64(ptr align 1 %array_of_grandchild, i8 0, i64 ptrtoint (ptr getelementptr ([3 x %grandchild], ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %parent1, metadata !60, metadata !DIExpression()), !dbg !61 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %parent1, ptr align 1 @__parent__init, i64 ptrtoint (ptr getelementptr (%parent, ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %child1, metadata !62, metadata !DIExpression()), !dbg !63 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %child1, ptr align 1 @__child__init, i64 ptrtoint (ptr getelementptr (%child, ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %grandchild1, metadata !64, metadata !DIExpression()), !dbg !65 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %grandchild1, ptr align 1 @__grandchild__init, i64 ptrtoint (ptr getelementptr (%grandchild, ptr null, i32 1) to i64), i1 false) + call void @llvm.dbg.declare(metadata ptr %main, metadata !66, metadata !DIExpression()), !dbg !67 + store i32 0, ptr %main, align 4 + call void @__init_parent(ptr %parent1), !dbg !68 + call void @__init_child(ptr %child1), !dbg !68 + call void @__init_grandchild(ptr %grandchild1), !dbg !68 + call void @__user_init_parent(ptr %parent1), !dbg !68 + call void @__user_init_child(ptr %child1), !dbg !68 + call void @__user_init_grandchild(ptr %grandchild1), !dbg !68 + %a = getelementptr inbounds %parent, ptr %parent1, i32 0, i32 1, !dbg !69 + store i32 1, ptr %a, align 4, !dbg !69 + %__parent = getelementptr inbounds %child, ptr %child1, i32 0, i32 0, !dbg !70 + %a1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1, !dbg !70 + store i32 2, ptr %a1, align 4, !dbg !70 + %b = getelementptr inbounds %child, ptr %child1, i32 0, i32 1, !dbg !71 + store i32 3, ptr %b, align 4, !dbg !71 + %__child = getelementptr inbounds %grandchild, ptr %grandchild1, i32 0, i32 0, !dbg !72 + %__parent2 = getelementptr inbounds %child, ptr %__child, i32 0, i32 0, !dbg !72 + %a3 = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 1, !dbg !72 + store i32 4, ptr %a3, align 4, !dbg !72 + %__child4 = getelementptr inbounds %grandchild, ptr %grandchild1, i32 0, i32 0, !dbg !73 + %b5 = getelementptr inbounds %child, ptr %__child4, i32 0, i32 1, !dbg !73 + store i32 5, ptr %b5, align 4, !dbg !73 + %c = getelementptr inbounds %grandchild, ptr %grandchild1, i32 0, i32 1, !dbg !74 + store i32 6, ptr %c, align 4, !dbg !74 + %tmpVar = getelementptr inbounds [3 x %parent], ptr %array_of_parent, i32 0, i32 0, !dbg !75 + %a6 = getelementptr inbounds %parent, ptr %tmpVar, i32 0, i32 1, !dbg !75 + store i32 7, ptr %a6, align 4, !dbg !75 + %tmpVar7 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 0, !dbg !76 + %__parent8 = getelementptr inbounds %child, ptr %tmpVar7, i32 0, i32 0, !dbg !76 + %a9 = getelementptr inbounds %parent, ptr %__parent8, i32 0, i32 1, !dbg !76 + store i32 8, ptr %a9, align 4, !dbg !76 + %tmpVar10 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 0, !dbg !77 + %b11 = getelementptr inbounds %child, ptr %tmpVar10, i32 0, i32 1, !dbg !77 + store i32 9, ptr %b11, align 4, !dbg !77 + %tmpVar12 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 0, !dbg !78 + %__child13 = getelementptr inbounds %grandchild, ptr %tmpVar12, i32 0, i32 0, !dbg !78 + %__parent14 = getelementptr inbounds %child, ptr %__child13, i32 0, i32 0, !dbg !78 + %a15 = getelementptr inbounds %parent, ptr %__parent14, i32 0, i32 1, !dbg !78 + store i32 10, ptr %a15, align 4, !dbg !78 + %tmpVar16 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 0, !dbg !79 + %__child17 = getelementptr inbounds %grandchild, ptr %tmpVar16, i32 0, i32 0, !dbg !79 + %b18 = getelementptr inbounds %child, ptr %__child17, i32 0, i32 1, !dbg !79 + store i32 11, ptr %b18, align 4, !dbg !79 + %tmpVar19 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 0, !dbg !80 + %c20 = getelementptr inbounds %grandchild, ptr %tmpVar19, i32 0, i32 1, !dbg !80 + store i32 12, ptr %c20, align 4, !dbg !80 + %tmpVar21 = getelementptr inbounds [3 x %parent], ptr %array_of_parent, i32 0, i32 1, !dbg !81 + %a22 = getelementptr inbounds %parent, ptr %tmpVar21, i32 0, i32 1, !dbg !81 + store i32 13, ptr %a22, align 4, !dbg !81 + %tmpVar23 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 1, !dbg !82 + %__parent24 = getelementptr inbounds %child, ptr %tmpVar23, i32 0, i32 0, !dbg !82 + %a25 = getelementptr inbounds %parent, ptr %__parent24, i32 0, i32 1, !dbg !82 + store i32 14, ptr %a25, align 4, !dbg !82 + %tmpVar26 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 1, !dbg !83 + %b27 = getelementptr inbounds %child, ptr %tmpVar26, i32 0, i32 1, !dbg !83 + store i32 15, ptr %b27, align 4, !dbg !83 + %tmpVar28 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 1, !dbg !84 + %__child29 = getelementptr inbounds %grandchild, ptr %tmpVar28, i32 0, i32 0, !dbg !84 + %__parent30 = getelementptr inbounds %child, ptr %__child29, i32 0, i32 0, !dbg !84 + %a31 = getelementptr inbounds %parent, ptr %__parent30, i32 0, i32 1, !dbg !84 + store i32 16, ptr %a31, align 4, !dbg !84 + %tmpVar32 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 1, !dbg !85 + %__child33 = getelementptr inbounds %grandchild, ptr %tmpVar32, i32 0, i32 0, !dbg !85 + %b34 = getelementptr inbounds %child, ptr %__child33, i32 0, i32 1, !dbg !85 + store i32 17, ptr %b34, align 4, !dbg !85 + %tmpVar35 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 1, !dbg !86 + %c36 = getelementptr inbounds %grandchild, ptr %tmpVar35, i32 0, i32 1, !dbg !86 + store i32 18, ptr %c36, align 4, !dbg !86 + %tmpVar37 = getelementptr inbounds [3 x %parent], ptr %array_of_parent, i32 0, i32 2, !dbg !87 + %a38 = getelementptr inbounds %parent, ptr %tmpVar37, i32 0, i32 1, !dbg !87 + store i32 19, ptr %a38, align 4, !dbg !87 + %tmpVar39 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 2, !dbg !88 + %__parent40 = getelementptr inbounds %child, ptr %tmpVar39, i32 0, i32 0, !dbg !88 + %a41 = getelementptr inbounds %parent, ptr %__parent40, i32 0, i32 1, !dbg !88 + store i32 20, ptr %a41, align 4, !dbg !88 + %tmpVar42 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 2, !dbg !89 + %b43 = getelementptr inbounds %child, ptr %tmpVar42, i32 0, i32 1, !dbg !89 + store i32 21, ptr %b43, align 4, !dbg !89 + %tmpVar44 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 2, !dbg !90 + %__child45 = getelementptr inbounds %grandchild, ptr %tmpVar44, i32 0, i32 0, !dbg !90 + %__parent46 = getelementptr inbounds %child, ptr %__child45, i32 0, i32 0, !dbg !90 + %a47 = getelementptr inbounds %parent, ptr %__parent46, i32 0, i32 1, !dbg !90 + store i32 22, ptr %a47, align 4, !dbg !90 + %tmpVar48 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 2, !dbg !91 + %__child49 = getelementptr inbounds %grandchild, ptr %tmpVar48, i32 0, i32 0, !dbg !91 + %b50 = getelementptr inbounds %child, ptr %__child49, i32 0, i32 1, !dbg !91 + store i32 23, ptr %b50, align 4, !dbg !91 + %tmpVar51 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 2, !dbg !92 + %c52 = getelementptr inbounds %grandchild, ptr %tmpVar51, i32 0, i32 1, !dbg !92 + store i32 24, ptr %c52, align 4, !dbg !92 + %main_ret = load i32, ptr %main, align 4, !dbg !93 ret i32 %main_ret, !dbg !93 } - ; Function Attrs: nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #2 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init___vtable_grandchild(%__vtable_grandchild* %0) { + define void @__init___vtable_grandchild(ptr %0) { entry: - %self = alloca %__vtable_grandchild*, align 8 - store %__vtable_grandchild* %0, %__vtable_grandchild** %self, align 8 - %deref = load %__vtable_grandchild*, %__vtable_grandchild** %self, align 8 - %__body = getelementptr inbounds %__vtable_grandchild, %__vtable_grandchild* %deref, i32 0, i32 0 - store void (%grandchild*)* @grandchild, void (%grandchild*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @grandchild, ptr %__body, align 8 ret void } - define void @__init_grandchild(%grandchild* %0) { + define void @__init_grandchild(ptr %0) { entry: - %self = alloca %grandchild*, align 8 - store %grandchild* %0, %grandchild** %self, align 8 - %deref = load %grandchild*, %grandchild** %self, align 8 - %__child = getelementptr inbounds %grandchild, %grandchild* %deref, i32 0, i32 0 - call void @__init_child(%child* %__child) - %deref1 = load %grandchild*, %grandchild** %self, align 8 - %__child2 = getelementptr inbounds %grandchild, %grandchild* %deref1, i32 0, i32 0 - %__parent = getelementptr inbounds %child, %child* %__child2, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 0 - store i32* bitcast (%__vtable_grandchild* @__vtable_grandchild_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__child = getelementptr inbounds %grandchild, ptr %deref, i32 0, i32 0 + call void @__init_child(ptr %__child) + %deref1 = load ptr, ptr %self, align 8 + %__child2 = getelementptr inbounds %grandchild, ptr %deref1, i32 0, i32 0 + %__parent = getelementptr inbounds %child, ptr %__child2, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 + store ptr @__vtable_grandchild_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_grandchild(%__vtable_grandchild* %0) { + define void @__user_init___vtable_grandchild(ptr %0) { entry: - %self = alloca %__vtable_grandchild*, align 8 - store %__vtable_grandchild* %0, %__vtable_grandchild** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_grandchild(%grandchild* %0) { + define void @__user_init_grandchild(ptr %0) { entry: - %self = alloca %grandchild*, align 8 - store %grandchild* %0, %grandchild** %self, align 8 - %deref = load %grandchild*, %grandchild** %self, align 8 - %__child = getelementptr inbounds %grandchild, %grandchild* %deref, i32 0, i32 0 - call void @__user_init_child(%child* %__child) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__child = getelementptr inbounds %grandchild, ptr %deref, i32 0, i32 0 + call void @__user_init_child(ptr %__child) ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__init___vtable_grandchild(%__vtable_grandchild* @__vtable_grandchild_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_grandchild(%__vtable_grandchild* @__vtable_grandchild_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__init___vtable_grandchild(ptr @__vtable_grandchild_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_grandchild(ptr @__vtable_grandchild_instance) ret void } - attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } - attributes #2 = { argmemonly nofree nounwind willreturn } + attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #2 = { argmemonly nocallback nofree nounwind willreturn } !llvm.module.flags = !{!26, !27} !llvm.dbg.cu = !{!28} diff --git a/src/codegen/tests/oop_tests/super_tests.rs b/src/codegen/tests/oop_tests/super_tests.rs index 7ad6926fa82..aff334f152c 100644 --- a/src/codegen/tests/oop_tests/super_tests.rs +++ b/src/codegen/tests/oop_tests/super_tests.rs @@ -23,119 +23,119 @@ fn super_keyword_basic_access() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i16 } - %__vtable_child = type { void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i16 } + %__vtable_child = type { ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 10 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 10 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 10 } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 10 } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - store i16 20, i16* %x, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + store i16 20, ptr %x, align 2 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -166,119 +166,119 @@ fn super_without_deref() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i16 } - %__vtable_child = type { void (%child*)* } - %child = type { %parent, %parent* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i16 } + %__vtable_child = type { ptr } + %child = type { %parent, ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 10 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 10 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 10 }, %parent* null } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 10 }, ptr null } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %p = getelementptr inbounds %child, %child* %0, i32 0, i32 1 - store %parent* %__parent, %parent** %p, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %p = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + store ptr %__parent, ptr %p, align 8 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -316,173 +316,173 @@ fn super_in_method_calls() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)*, i16 (%parent*)* } - %parent = type { i32*, i16 } - %__vtable_child = type { void (%child*)*, i16 (%child*)*, i16 (%child*)* } + %__vtable_parent = type { ptr, ptr } + %parent = type { ptr, i16 } + %__vtable_child = type { ptr, ptr, ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 10 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 10 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 10 } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 10 } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void } - define i16 @parent__process(%parent* %0) { + define i16 @parent__process(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 %parent.process = alloca i16, align 2 - store i16 0, i16* %parent.process, align 2 - %load_value = load i16, i16* %value, align 2 + store i16 0, ptr %parent.process, align 2 + %load_value = load i16, ptr %value, align 2 %1 = sext i16 %load_value to i32 %tmpVar = mul i32 %1, 2 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %parent.process, align 2 - %parent__process_ret = load i16, i16* %parent.process, align 2 + store i16 %2, ptr %parent.process, align 2 + %parent__process_ret = load i16, ptr %parent.process, align 2 ret i16 %parent__process_ret } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define i16 @child__process(%child* %0) { + define i16 @child__process(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 %child.process = alloca i16, align 2 - store i16 0, i16* %child.process, align 2 - %value = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_value = load i16, i16* %value, align 2 + store i16 0, ptr %child.process, align 2 + %value = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_value = load i16, ptr %value, align 2 %1 = sext i16 %load_value to i32 %tmpVar = add i32 %1, 5 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %child.process, align 2 - %child__process_ret = load i16, i16* %child.process, align 2 + store i16 %2, ptr %child.process, align 2 + %child__process_ret = load i16, ptr %child.process, align 2 ret i16 %child__process_ret } - define i16 @child__test(%child* %0) { + define i16 @child__test(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 %child.test = alloca i16, align 2 - store i16 0, i16* %child.test, align 2 - %call = call i16 @parent__process(%parent* %__parent) - store i16 %call, i16* %child.test, align 2 - %child__test_ret = load i16, i16* %child.test, align 2 + store i16 0, ptr %child.test, align 2 + %call = call i16 @parent__process(ptr %__parent) + store i16 %call, ptr %child.test, align 2 + %child__test_ret = load i16, ptr %child.test, align 2 ret i16 %child__test_ret } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 - %deref1 = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %process = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref1, i32 0, i32 1 - store i16 (%parent*)* @parent__process, i16 (%parent*)** %process, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %process = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + store ptr @parent__process, ptr %process, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %process = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store i16 (%child*)* @child__process, i16 (%child*)** %process, align 8 - %deref2 = load %__vtable_child*, %__vtable_child** %self, align 8 - %test = getelementptr inbounds %__vtable_child, %__vtable_child* %deref2, i32 0, i32 2 - store i16 (%child*)* @child__test, i16 (%child*)** %test, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %process = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + store ptr @child__process, ptr %process, align 8 + %deref2 = load ptr, ptr %self, align 8 + %test = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + store ptr @child__test, ptr %test, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -514,129 +514,129 @@ fn super_in_complex_expressions() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i16, i16 } - %__vtable_child = type { void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i16, i16 } + %__vtable_child = type { ptr } %child = type { %parent, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 10, i16 20 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 10, i16 20 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 10, i16 20 }, i16 30 } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 10, i16 20 }, i16 30 } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %y = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %z = getelementptr inbounds %child, %child* %0, i32 0, i32 1 - %x = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 - %y = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %load_y = load i16, i16* %y, align 2 + %y = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %load_y = load i16, ptr %y, align 2 %2 = sext i16 %load_y to i32 %tmpVar = mul i32 %2, 2 %tmpVar1 = add i32 %1, %tmpVar %3 = trunc i32 %tmpVar1 to i16 - store i16 %3, i16* %z, align 2 + store i16 %3, ptr %z, align 2 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -667,126 +667,126 @@ fn super_with_array_access() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, [6 x i16] } - %__vtable_child = type { void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, [6 x i16] } + %__vtable_child = type { ptr } %child = type { %parent, i16 } @__parent.arr__init = unnamed_addr constant [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] } + @__parent__init = unnamed_addr constant %parent { ptr null, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] }, i16 3 } + @__child__init = unnamed_addr constant %child { %parent { ptr null, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] }, i16 3 } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %arr = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %arr = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %index = getelementptr inbounds %child, %child* %0, i32 0, i32 1 - %arr = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_index = load i16, i16* %index, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %index = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_index = load i16, ptr %index, align 2 %1 = sext i16 %load_index to i32 %tmpVar = mul i32 1, %1 %tmpVar1 = add i32 %tmpVar, 0 - %tmpVar2 = getelementptr inbounds [6 x i16], [6 x i16]* %arr, i32 0, i32 %tmpVar1 - store i16 42, i16* %tmpVar2, align 2 + %tmpVar2 = getelementptr inbounds [6 x i16], ptr %arr, i32 0, i32 %tmpVar1 + store i16 42, ptr %tmpVar2, align 2 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -834,241 +834,241 @@ fn super_in_multi_level_inheritance() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_grandparent = type { void (%grandparent*)*, i16 (%grandparent*)* } - %grandparent = type { i32*, i16 } - %__vtable_parent = type { void (%parent*)*, i16 (%grandparent*)*, i16 (%parent*)* } + %__vtable_grandparent = type { ptr, ptr } + %grandparent = type { ptr, i16 } + %__vtable_parent = type { ptr, ptr, ptr } %parent = type { %grandparent, i16 } - %__vtable_child = type { void (%child*)*, i16 (%grandparent*)*, i16 (%parent*)*, i16 (%child*)* } + %__vtable_child = type { ptr, ptr, ptr, ptr } %child = type { %parent, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_grandparent__init = unnamed_addr constant %__vtable_grandparent zeroinitializer - @__grandparent__init = unnamed_addr constant %grandparent { i32* null, i16 10 } + @__grandparent__init = unnamed_addr constant %grandparent { ptr null, i16 10 } @__vtable_grandparent_instance = global %__vtable_grandparent zeroinitializer @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { %grandparent { i32* null, i16 10 }, i16 20 } + @__parent__init = unnamed_addr constant %parent { %grandparent { ptr null, i16 10 }, i16 20 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { %grandparent { i32* null, i16 10 }, i16 20 }, i16 30 } + @__child__init = unnamed_addr constant %child { %parent { %grandparent { ptr null, i16 10 }, i16 20 }, i16 30 } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @grandparent(%grandparent* %0) { + define void @grandparent(ptr %0) { entry: - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 - %g_val = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %g_val = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 ret void } - define i16 @grandparent__gp_method(%grandparent* %0) { + define i16 @grandparent__gp_method(ptr %0) { entry: - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 - %g_val = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %g_val = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 %grandparent.gp_method = alloca i16, align 2 - store i16 0, i16* %grandparent.gp_method, align 2 - %load_g_val = load i16, i16* %g_val, align 2 - store i16 %load_g_val, i16* %grandparent.gp_method, align 2 - %grandparent__gp_method_ret = load i16, i16* %grandparent.gp_method, align 2 + store i16 0, ptr %grandparent.gp_method, align 2 + %load_g_val = load i16, ptr %g_val, align 2 + store i16 %load_g_val, ptr %grandparent.gp_method, align 2 + %grandparent__gp_method_ret = load i16, ptr %grandparent.gp_method, align 2 ret i16 %grandparent__gp_method_ret } - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %p_val = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %p_val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void } - define i16 @parent__p_method(%parent* %0) { + define i16 @parent__p_method(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %p_val = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %p_val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 %parent.p_method = alloca i16, align 2 - store i16 0, i16* %parent.p_method, align 2 - %load_p_val = load i16, i16* %p_val, align 2 + store i16 0, ptr %parent.p_method, align 2 + %load_p_val = load i16, ptr %p_val, align 2 %1 = sext i16 %load_p_val to i32 - %call = call i16 @grandparent__gp_method(%grandparent* %__grandparent) + %call = call i16 @grandparent__gp_method(ptr %__grandparent) %2 = sext i16 %call to i32 %tmpVar = add i32 %1, %2 %3 = trunc i32 %tmpVar to i16 - store i16 %3, i16* %parent.p_method, align 2 - %parent__p_method_ret = load i16, i16* %parent.p_method, align 2 + store i16 %3, ptr %parent.p_method, align 2 + %parent__p_method_ret = load i16, ptr %parent.p_method, align 2 ret i16 %parent__p_method_ret } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %c_val = getelementptr inbounds %child, %child* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %c_val = getelementptr inbounds %child, ptr %0, i32 0, i32 1 ret void } - define i16 @child__test(%child* %0) { + define i16 @child__test(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %c_val = getelementptr inbounds %child, %child* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %c_val = getelementptr inbounds %child, ptr %0, i32 0, i32 1 %child.test = alloca i16, align 2 - store i16 0, i16* %child.test, align 2 - %call = call i16 @parent__p_method(%parent* %__parent) - store i16 %call, i16* %child.test, align 2 - %child__test_ret = load i16, i16* %child.test, align 2 + store i16 0, ptr %child.test, align 2 + %call = call i16 @parent__p_method(ptr %__parent) + store i16 %call, ptr %child.test, align 2 + %child__test_ret = load i16, ptr %child.test, align 2 ret i16 %child__test_ret } - define void @__init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 - %deref = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref, i32 0, i32 0 - store void (%grandparent*)* @grandparent, void (%grandparent*)** %__body, align 8 - %deref1 = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %gp_method = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref1, i32 0, i32 1 - store i16 (%grandparent*)* @grandparent__gp_method, i16 (%grandparent*)** %gp_method, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @grandparent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %gp_method = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + store ptr @grandparent__gp_method, ptr %gp_method, align 8 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 - %deref1 = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %gp_method = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref1, i32 0, i32 1 - store i16 (%grandparent*)* @grandparent__gp_method, i16 (%grandparent*)** %gp_method, align 8 - %deref2 = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %p_method = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref2, i32 0, i32 2 - store i16 (%parent*)* @parent__p_method, i16 (%parent*)** %p_method, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %gp_method = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + store ptr @grandparent__gp_method, ptr %gp_method, align 8 + %deref2 = load ptr, ptr %self, align 8 + %p_method = getelementptr inbounds %__vtable_parent, ptr %deref2, i32 0, i32 2 + store ptr @parent__p_method, ptr %p_method, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %gp_method = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store i16 (%grandparent*)* @grandparent__gp_method, i16 (%grandparent*)** %gp_method, align 8 - %deref2 = load %__vtable_child*, %__vtable_child** %self, align 8 - %p_method = getelementptr inbounds %__vtable_child, %__vtable_child* %deref2, i32 0, i32 2 - store i16 (%parent*)* @parent__p_method, i16 (%parent*)** %p_method, align 8 - %deref3 = load %__vtable_child*, %__vtable_child** %self, align 8 - %test = getelementptr inbounds %__vtable_child, %__vtable_child* %deref3, i32 0, i32 3 - store i16 (%child*)* @child__test, i16 (%child*)** %test, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %gp_method = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + store ptr @grandparent__gp_method, ptr %gp_method, align 8 + %deref2 = load ptr, ptr %self, align 8 + %p_method = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + store ptr @parent__p_method, ptr %p_method, align 8 + %deref3 = load ptr, ptr %self, align 8 + %test = getelementptr inbounds %__vtable_child, ptr %deref3, i32 0, i32 3 + store ptr @child__test, ptr %test, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__init_grandparent(%grandparent* %__grandparent) - %deref1 = load %parent*, %parent** %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, %parent* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent2, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__init_grandparent(ptr %__grandparent) + %deref1 = load ptr, ptr %self, align 8 + %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_grandparent(%grandparent* %0) { + define void @__init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 - %deref = load %grandparent*, %grandparent** %self, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_grandparent* @__vtable_grandparent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_grandparent(%grandparent* %0) { + define void @__user_init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__user_init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__user_init_grandparent(%grandparent* %__grandparent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__user_init_grandparent(ptr %__grandparent) ret void } define void @__init___Test() { entry: - call void @__init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -1099,129 +1099,129 @@ fn super_with_pointer_operations() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i16, i16* } - %__vtable_child = type { void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i16, ptr } + %__vtable_child = type { ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 10, i16* null } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 10, ptr null } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 10, i16* null } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 10, ptr null } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %val = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %ptr = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %ptr = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %ptr = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %val = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - store i16* %val, i16** %ptr, align 8 - %val1 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %ptr2 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %deref = load i16*, i16** %ptr2, align 8 - %load_tmpVar = load i16, i16* %deref, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %ptr = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %val = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + store ptr %val, ptr %ptr, align 8 + %val1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %ptr2 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %deref = load ptr, ptr %ptr2, align 8 + %load_tmpVar = load i16, ptr %deref, align 2 %1 = sext i16 %load_tmpVar to i32 %tmpVar = add i32 %1, 5 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %val1, align 2 + store i16 %2, ptr %val1, align 2 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -1262,47 +1262,47 @@ fn super_in_conditionals() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i16, i16 } - %__vtable_child = type { void (%child*)*, void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i16, i16 } + %__vtable_child = type { ptr, ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 50, i16 10 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 50, i16 10 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 50, i16 10 } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 50, i16 10 } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %threshold = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %value = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %threshold = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define void @child__test(%child* %0) { + define void @child__test(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %load_value = load i16, i16* %value, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %load_value = load i16, ptr %value, align 2 %1 = sext i16 %load_value to i32 - %threshold = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_threshold = load i16, i16* %threshold, align 2 + %threshold = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_threshold = load i16, ptr %threshold, align 2 %2 = sext i16 %load_threshold to i32 %tmpVar = icmp sgt i32 %1, %2 %3 = zext i1 %tmpVar to i8 @@ -1310,31 +1310,31 @@ fn super_in_conditionals() { br i1 %4, label %condition_body, label %else condition_body: ; preds = %entry - %value1 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - store i16 0, i16* %value1, align 2 + %value1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + store i16 0, ptr %value1, align 2 br label %continue else: ; preds = %entry - %value2 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - store i16 100, i16* %value2, align 2 + %value2 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + store i16 100, ptr %value2, align 2 br label %continue continue: ; preds = %else, %condition_body - %value4 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %load_value5 = load i16, i16* %value4, align 2 + %value4 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %load_value5 = load i16, ptr %value4, align 2 switch i16 %load_value5, label %else6 [ i16 10, label %case i16 20, label %case8 ] case: ; preds = %continue - %threshold7 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - store i16 40, i16* %threshold7, align 2 + %threshold7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + store i16 40, ptr %threshold7, align 2 br label %continue3 case8: ; preds = %continue - %threshold9 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - store i16 60, i16* %threshold9, align 2 + %threshold9 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + store i16 60, ptr %threshold9, align 2 br label %continue3 else6: ; preds = %continue @@ -1344,90 +1344,90 @@ fn super_in_conditionals() { ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %test = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store void (%child*)* @child__test, void (%child*)** %test, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %test = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + store ptr @child__test, ptr %test, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -1458,120 +1458,120 @@ fn super_with_const_variables() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i16, i16 } - %__vtable_child = type { void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i16, i16 } + %__vtable_child = type { ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 100, i16 50 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 100, i16 50 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 100, i16 50 } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 100, i16 50 } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %MAX_VALUE = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %current = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %MAX_VALUE = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %current = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %current = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - store i16 50, i16* %current, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %current = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + store i16 50, ptr %current, align 2 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -1616,164 +1616,162 @@ fn super_as_function_parameter() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, i16 } - %__vtable_child = type { void (%child*)*, void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, i16 } + %__vtable_child = type { ptr, ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 10 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 10 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 10 } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 10 } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %val = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define void @child__test(%child* %0) { + define void @child__test(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %call = call i16 @process_ref(%parent* %__parent) - %call1 = call i16 @process_val(%parent* %__parent) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %call = call i16 @process_ref(ptr %__parent) + %call1 = call i16 @process_val(ptr %__parent) ret void } - define i16 @process_ref(%parent* %0) { + define i16 @process_ref(ptr %0) { entry: %process_ref = alloca i16, align 2 - %ref = alloca %parent*, align 8 - store %parent* %0, %parent** %ref, align 8 - store i16 0, i16* %process_ref, align 2 - %deref = load %parent*, %parent** %ref, align 8 - %val = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 1 - store i16 20, i16* %val, align 2 - %process_ref_ret = load i16, i16* %process_ref, align 2 + %ref = alloca ptr, align 8 + store ptr %0, ptr %ref, align 8 + store i16 0, ptr %process_ref, align 2 + %deref = load ptr, ptr %ref, align 8 + %val = getelementptr inbounds %parent, ptr %deref, i32 0, i32 1 + store i16 20, ptr %val, align 2 + %process_ref_ret = load i16, ptr %process_ref, align 2 ret i16 %process_ref_ret } - define i16 @process_val(%parent* %0) { + define i16 @process_val(ptr %0) { entry: %process_val = alloca i16, align 2 %val = alloca %parent, align 8 - %1 = bitcast %parent* %val to i8* - %2 = bitcast %parent* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%parent* getelementptr (%parent, %parent* null, i32 1) to i64), i1 false) - store i16 0, i16* %process_val, align 2 - %val1 = getelementptr inbounds %parent, %parent* %val, i32 0, i32 1 - store i16 30, i16* %val1, align 2 - %process_val_ret = load i16, i16* %process_val, align 2 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %val, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%parent, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %process_val, align 2 + %val1 = getelementptr inbounds %parent, ptr %val, i32 0, i32 1 + store i16 30, ptr %val1, align 2 + %process_val_ret = load i16, ptr %process_val, align 2 ret i16 %process_val_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %test = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store void (%child*)* @child__test, void (%child*)** %test, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %test = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + store ptr @child__test, ptr %test, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -1807,184 +1805,184 @@ fn super_with_deeply_nested_expressions() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)*, i16 (%parent*)* } - %parent = type { i32*, i16, i16, i16 } - %__vtable_child = type { void (%child*)*, i16 (%parent*)*, i16 (%child*)* } + %__vtable_parent = type { ptr, ptr } + %parent = type { ptr, i16, i16, i16 } + %__vtable_child = type { ptr, ptr, ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 1, i16 2, i16 3 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 1, i16 2, i16 3 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 1, i16 2, i16 3 } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 1, i16 2, i16 3 } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %a = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 - %c = getelementptr inbounds %parent, %parent* %0, i32 0, i32 3 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds %parent, ptr %0, i32 0, i32 3 ret void } - define i16 @parent__calc(%parent* %0) { + define i16 @parent__calc(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %a = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 - %c = getelementptr inbounds %parent, %parent* %0, i32 0, i32 3 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds %parent, ptr %0, i32 0, i32 3 %parent.calc = alloca i16, align 2 - store i16 0, i16* %parent.calc, align 2 - %load_a = load i16, i16* %a, align 2 + store i16 0, ptr %parent.calc, align 2 + %load_a = load i16, ptr %a, align 2 %1 = sext i16 %load_a to i32 - %load_b = load i16, i16* %b, align 2 + %load_b = load i16, ptr %b, align 2 %2 = sext i16 %load_b to i32 - %load_c = load i16, i16* %c, align 2 + %load_c = load i16, ptr %c, align 2 %3 = sext i16 %load_c to i32 %tmpVar = mul i32 %2, %3 %tmpVar1 = add i32 %1, %tmpVar %4 = trunc i32 %tmpVar1 to i16 - store i16 %4, i16* %parent.calc, align 2 - %parent__calc_ret = load i16, i16* %parent.calc, align 2 + store i16 %4, ptr %parent.calc, align 2 + %parent__calc_ret = load i16, ptr %parent.calc, align 2 ret i16 %parent__calc_ret } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define i16 @child__test(%child* %0) { + define i16 @child__test(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 %child.test = alloca i16, align 2 - store i16 0, i16* %child.test, align 2 - %a = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_a = load i16, i16* %a, align 2 + store i16 0, ptr %child.test, align 2 + %a = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_a = load i16, ptr %a, align 2 %1 = sext i16 %load_a to i32 - %b = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %load_b = load i16, i16* %b, align 2 + %b = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %load_b = load i16, ptr %b, align 2 %2 = sext i16 %load_b to i32 %tmpVar = add i32 %1, %2 - %c = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 3 - %load_c = load i16, i16* %c, align 2 + %c = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 3 + %load_c = load i16, ptr %c, align 2 %3 = sext i16 %load_c to i32 %tmpVar1 = mul i32 %tmpVar, %3 - %call = call i16 @parent__calc(%parent* %__parent) + %call = call i16 @parent__calc(ptr %__parent) %4 = sext i16 %call to i32 %tmpVar2 = add i32 %tmpVar1, %4 - %a3 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_a4 = load i16, i16* %a3, align 2 + %a3 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_a4 = load i16, ptr %a3, align 2 %5 = sext i16 %load_a4 to i32 %tmpVar5 = add i32 %5, 1 %tmpVar6 = sdiv i32 %tmpVar2, %tmpVar5 %6 = trunc i32 %tmpVar6 to i16 - store i16 %6, i16* %child.test, align 2 - %child__test_ret = load i16, i16* %child.test, align 2 + store i16 %6, ptr %child.test, align 2 + %child__test_ret = load i16, ptr %child.test, align 2 ret i16 %child__test_ret } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 - %deref1 = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %calc = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref1, i32 0, i32 1 - store i16 (%parent*)* @parent__calc, i16 (%parent*)** %calc, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %calc = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + store ptr @parent__calc, ptr %calc, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %calc = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store i16 (%parent*)* @parent__calc, i16 (%parent*)** %calc, align 8 - %deref2 = load %__vtable_child*, %__vtable_child** %self, align 8 - %test = getelementptr inbounds %__vtable_child, %__vtable_child* %deref2, i32 0, i32 2 - store i16 (%child*)* @child__test, i16 (%child*)** %test, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %calc = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + store ptr @parent__calc, ptr %calc, align 8 + %deref2 = load ptr, ptr %self, align 8 + %test = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + store ptr @child__test, ptr %test, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -2038,100 +2036,100 @@ fn super_in_loop_constructs() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)*, void (%parent*)* } - %parent = type { i32*, i16, [6 x i16] } - %__vtable_child = type { void (%child*)*, void (%parent*)*, void (%child*)* } + %__vtable_parent = type { ptr, ptr } + %parent = type { ptr, i16, [6 x i16] } + %__vtable_child = type { ptr, ptr, ptr } %child = type { %parent } @__parent.arr__init = unnamed_addr constant [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 0, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 0, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 0, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 0, [6 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6] } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %counter = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %arr = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %counter = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @parent__increment(%parent* %0) { + define void @parent__increment(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %counter = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %arr = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 - %load_counter = load i16, i16* %counter, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %counter = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %load_counter = load i16, ptr %counter, align 2 %1 = sext i16 %load_counter to i32 %tmpVar = add i32 %1, 1 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %counter, align 2 + store i16 %2, ptr %counter, align 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define void @child__process(%child* %0) { + define void @child__process(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 %i = alloca i16, align 2 %sum = alloca i16, align 2 - store i16 0, i16* %i, align 2 - store i16 0, i16* %sum, align 2 - store i16 0, i16* %i, align 2 + store i16 0, ptr %i, align 2 + store i16 0, ptr %sum, align 2 + store i16 0, ptr %i, align 2 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i16, i16* %i, align 2 + %1 = load i16, ptr %i, align 2 %2 = sext i16 %1 to i32 %condition = icmp sle i32 %2, 5 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %3 = load i16, i16* %i, align 2 + %3 = load i16, ptr %i, align 2 %4 = sext i16 %3 to i32 %condition1 = icmp sge i32 %4, 5 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_sum = load i16, i16* %sum, align 2 + %load_sum = load i16, ptr %sum, align 2 %5 = sext i16 %load_sum to i32 - %arr = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %load_i = load i16, i16* %i, align 2 + %arr = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %load_i = load i16, ptr %i, align 2 %6 = sext i16 %load_i to i32 %tmpVar = mul i32 1, %6 %tmpVar2 = add i32 %tmpVar, 0 - %tmpVar3 = getelementptr inbounds [6 x i16], [6 x i16]* %arr, i32 0, i32 %tmpVar2 - %load_tmpVar = load i16, i16* %tmpVar3, align 2 + %tmpVar3 = getelementptr inbounds [6 x i16], ptr %arr, i32 0, i32 %tmpVar2 + %load_tmpVar = load i16, ptr %tmpVar3, align 2 %7 = sext i16 %load_tmpVar to i32 %tmpVar4 = add i32 %5, %7 %8 = trunc i32 %tmpVar4 to i16 - store i16 %8, i16* %sum, align 2 - call void @parent__increment(%parent* %__parent) + store i16 %8, ptr %sum, align 2 + call void @parent__increment(ptr %__parent) br label %increment increment: ; preds = %loop - %9 = load i16, i16* %i, align 2 + %9 = load i16, ptr %i, align 2 %10 = sext i16 %9 to i32 %next = add i32 1, %10 %11 = trunc i32 %next to i16 - store i16 %11, i16* %i, align 2 + store i16 %11, ptr %i, align 2 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle @@ -2141,8 +2139,8 @@ fn super_in_loop_constructs() { br i1 true, label %while_body, label %continue5 while_body: ; preds = %condition_check - %counter = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_counter = load i16, i16* %counter, align 2 + %counter = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_counter = load i16, ptr %counter, align 2 %12 = sext i16 %load_counter to i32 %tmpVar7 = icmp slt i32 %12, 10 %13 = zext i1 %tmpVar7 to i8 @@ -2160,22 +2158,22 @@ fn super_in_loop_constructs() { br label %continue6 continue6: ; preds = %buffer_block, %while_body - call void @parent__increment(%parent* %__parent) + call void @parent__increment(ptr %__parent) br label %condition_check condition_check9: ; preds = %continue16, %continue5 br i1 true, label %while_body10, label %continue11 while_body10: ; preds = %condition_check9 - %counter12 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %counter13 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_counter14 = load i16, i16* %counter13, align 2 + %counter12 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %counter13 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_counter14 = load i16, ptr %counter13, align 2 %15 = sext i16 %load_counter14 to i32 %tmpVar15 = sub i32 %15, 1 %16 = trunc i32 %tmpVar15 to i16 - store i16 %16, i16* %counter12, align 2 - %counter17 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_counter18 = load i16, i16* %counter17, align 2 + store i16 %16, ptr %counter12, align 2 + %counter17 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_counter18 = load i16, ptr %counter17, align 2 %17 = sext i16 %load_counter18 to i32 %tmpVar19 = icmp sle i32 %17, 0 %18 = zext i1 %tmpVar19 to i8 @@ -2195,96 +2193,96 @@ fn super_in_loop_constructs() { br label %condition_check9 } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 - %deref1 = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %increment = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref1, i32 0, i32 1 - store void (%parent*)* @parent__increment, void (%parent*)** %increment, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %increment = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + store ptr @parent__increment, ptr %increment, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %increment = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store void (%parent*)* @parent__increment, void (%parent*)** %increment, align 8 - %deref2 = load %__vtable_child*, %__vtable_child** %self, align 8 - %process = getelementptr inbounds %__vtable_child, %__vtable_child* %deref2, i32 0, i32 2 - store void (%child*)* @child__process, void (%child*)** %process, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %increment = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + store ptr @parent__increment, ptr %increment, align 8 + %deref2 = load ptr, ptr %self, align 8 + %process = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + store ptr @child__process, ptr %process, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -2321,14 +2319,14 @@ fn super_with_method_overrides_in_three_levels() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_grandparent = type { void (%grandparent*)*, i16 (%grandparent*)* } - %grandparent = type { i32* } - %__vtable_parent = type { void (%parent*)*, i16 (%parent*)* } + %__vtable_grandparent = type { ptr, ptr } + %grandparent = type { ptr } + %__vtable_parent = type { ptr, ptr } %parent = type { %grandparent } - %__vtable_child = type { void (%child*)*, i16 (%child*)* } + %__vtable_child = type { ptr, ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_grandparent__init = unnamed_addr constant %__vtable_grandparent zeroinitializer @__grandparent__init = unnamed_addr constant %grandparent zeroinitializer @__vtable_grandparent_instance = global %__vtable_grandparent zeroinitializer @@ -2339,208 +2337,208 @@ fn super_with_method_overrides_in_three_levels() { @__child__init = unnamed_addr constant %child zeroinitializer @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @grandparent(%grandparent* %0) { + define void @grandparent(ptr %0) { entry: - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 ret void } - define i16 @grandparent__calculate(%grandparent* %0) { + define i16 @grandparent__calculate(ptr %0) { entry: - %this = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %this, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 %grandparent.calculate = alloca i16, align 2 - store i16 0, i16* %grandparent.calculate, align 2 - store i16 100, i16* %grandparent.calculate, align 2 - %grandparent__calculate_ret = load i16, i16* %grandparent.calculate, align 2 + store i16 0, ptr %grandparent.calculate, align 2 + store i16 100, ptr %grandparent.calculate, align 2 + %grandparent__calculate_ret = load i16, ptr %grandparent.calculate, align 2 ret i16 %grandparent__calculate_ret } - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 ret void } - define i16 @parent__calculate(%parent* %0) { + define i16 @parent__calculate(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 %parent.calculate = alloca i16, align 2 - store i16 0, i16* %parent.calculate, align 2 - %call = call i16 @grandparent__calculate(%grandparent* %__grandparent) + store i16 0, ptr %parent.calculate, align 2 + %call = call i16 @grandparent__calculate(ptr %__grandparent) %1 = sext i16 %call to i32 %tmpVar = add i32 %1, 50 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %parent.calculate, align 2 - %parent__calculate_ret = load i16, i16* %parent.calculate, align 2 + store i16 %2, ptr %parent.calculate, align 2 + %parent__calculate_ret = load i16, ptr %parent.calculate, align 2 ret i16 %parent__calculate_ret } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define i16 @child__calculate(%child* %0) { + define i16 @child__calculate(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 %child.calculate = alloca i16, align 2 - store i16 0, i16* %child.calculate, align 2 - %call = call i16 @parent__calculate(%parent* %__parent) + store i16 0, ptr %child.calculate, align 2 + %call = call i16 @parent__calculate(ptr %__parent) %1 = sext i16 %call to i32 %tmpVar = add i32 %1, 25 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %child.calculate, align 2 - %child__calculate_ret = load i16, i16* %child.calculate, align 2 + store i16 %2, ptr %child.calculate, align 2 + %child__calculate_ret = load i16, ptr %child.calculate, align 2 ret i16 %child__calculate_ret } - define void @__init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 - %deref = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref, i32 0, i32 0 - store void (%grandparent*)* @grandparent, void (%grandparent*)** %__body, align 8 - %deref1 = load %__vtable_grandparent*, %__vtable_grandparent** %self, align 8 - %calculate = getelementptr inbounds %__vtable_grandparent, %__vtable_grandparent* %deref1, i32 0, i32 1 - store i16 (%grandparent*)* @grandparent__calculate, i16 (%grandparent*)** %calculate, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @grandparent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %calculate = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + store ptr @grandparent__calculate, ptr %calculate, align 8 ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 - %deref1 = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %calculate = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref1, i32 0, i32 1 - store i16 (%parent*)* @parent__calculate, i16 (%parent*)** %calculate, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %calculate = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + store ptr @parent__calculate, ptr %calculate, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %calculate = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store i16 (%child*)* @child__calculate, i16 (%child*)** %calculate, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %calculate = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + store ptr @child__calculate, ptr %calculate, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__init_grandparent(%grandparent* %__grandparent) - %deref1 = load %parent*, %parent** %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, %parent* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent2, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__init_grandparent(ptr %__grandparent) + %deref1 = load ptr, ptr %self, align 8 + %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_grandparent(%grandparent* %0) { + define void @__init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 - %deref = load %grandparent*, %grandparent** %self, align 8 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_grandparent* @__vtable_grandparent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, %grandparent* %__grandparent, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_grandparent(%grandparent* %0) { + define void @__user_init_grandparent(ptr %0) { entry: - %self = alloca %grandparent*, align 8 - store %grandparent* %0, %grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_grandparent(%__vtable_grandparent* %0) { + define void @__user_init___vtable_grandparent(ptr %0) { entry: - %self = alloca %__vtable_grandparent*, align 8 - store %__vtable_grandparent* %0, %__vtable_grandparent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__grandparent = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - call void @__user_init_grandparent(%grandparent* %__grandparent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + call void @__user_init_grandparent(ptr %__grandparent) ret void } define void @__init___Test() { entry: - call void @__init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_grandparent(%__vtable_grandparent* @__vtable_grandparent_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_grandparent(ptr @__vtable_grandparent_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); @@ -2632,194 +2630,193 @@ fn super_with_structured_types() { target triple = "[filtered]" %Complex_Type = type { i16, i16, float } - %__vtable_parent = type { void (%parent*)* } - %parent = type { i32*, %Complex_Type, [2 x %Complex_Type] } - %__vtable_child = type { void (%child*)*, void (%child*)* } + %__vtable_parent = type { ptr } + %parent = type { ptr, %Complex_Type, [2 x %Complex_Type] } + %__vtable_child = type { ptr, ptr } %child = type { %parent } @__parent.data__init = unnamed_addr constant %Complex_Type { i16 10, i16 20, float 3.050000e+01 } @__parent.arr_data__init = unnamed_addr constant [2 x %Complex_Type] [%Complex_Type { i16 1, i16 2, float 3.500000e+00 }, %Complex_Type { i16 4, i16 5, float 6.500000e+00 }] - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, %Complex_Type { i16 10, i16 20, float 3.050000e+01 }, [2 x %Complex_Type] [%Complex_Type { i16 1, i16 2, float 3.500000e+00 }, %Complex_Type { i16 4, i16 5, float 6.500000e+00 }] } + @__parent__init = unnamed_addr constant %parent { ptr null, %Complex_Type { i16 10, i16 20, float 3.050000e+01 }, [2 x %Complex_Type] [%Complex_Type { i16 1, i16 2, float 3.500000e+00 }, %Complex_Type { i16 4, i16 5, float 6.500000e+00 }] } @__Complex_Type__init = unnamed_addr constant %Complex_Type zeroinitializer @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, %Complex_Type { i16 10, i16 20, float 3.050000e+01 }, [2 x %Complex_Type] [%Complex_Type { i16 1, i16 2, float 3.500000e+00 }, %Complex_Type { i16 4, i16 5, float 6.500000e+00 }] } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, %Complex_Type { i16 10, i16 20, float 3.050000e+01 }, [2 x %Complex_Type] [%Complex_Type { i16 1, i16 2, float 3.500000e+00 }, %Complex_Type { i16 4, i16 5, float 6.500000e+00 }] } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %data = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %arr_data = getelementptr inbounds %parent, %parent* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %data = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %arr_data = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define void @child__test(%child* %0) { + define void @child__test(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 %local_data = alloca %Complex_Type, align 8 - %1 = bitcast %Complex_Type* %local_data to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%Complex_Type* @__Complex_Type__init to i8*), i64 ptrtoint (%Complex_Type* getelementptr (%Complex_Type, %Complex_Type* null, i32 1) to i64), i1 false) - call void @__init_complex_type(%Complex_Type* %local_data) - call void @__user_init_Complex_Type(%Complex_Type* %local_data) - %x = getelementptr inbounds %Complex_Type, %Complex_Type* %local_data, i32 0, i32 0 - %data = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %x1 = getelementptr inbounds %Complex_Type, %Complex_Type* %data, i32 0, i32 0 - %load_x = load i16, i16* %x1, align 2 - store i16 %load_x, i16* %x, align 2 - %y = getelementptr inbounds %Complex_Type, %Complex_Type* %local_data, i32 0, i32 1 - %data2 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %y3 = getelementptr inbounds %Complex_Type, %Complex_Type* %data2, i32 0, i32 1 - %load_y = load i16, i16* %y3, align 2 - store i16 %load_y, i16* %y, align 2 - %z = getelementptr inbounds %Complex_Type, %Complex_Type* %local_data, i32 0, i32 2 - %data4 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %z5 = getelementptr inbounds %Complex_Type, %Complex_Type* %data4, i32 0, i32 2 - %load_z = load float, float* %z5, align 4 - store float %load_z, float* %z, align 4 - %arr_data = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %tmpVar = getelementptr inbounds [2 x %Complex_Type], [2 x %Complex_Type]* %arr_data, i32 0, i32 0 - %x6 = getelementptr inbounds %Complex_Type, %Complex_Type* %tmpVar, i32 0, i32 0 - %arr_data7 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %tmpVar8 = getelementptr inbounds [2 x %Complex_Type], [2 x %Complex_Type]* %arr_data7, i32 0, i32 1 - %x9 = getelementptr inbounds %Complex_Type, %Complex_Type* %tmpVar8, i32 0, i32 0 - %load_x10 = load i16, i16* %x9, align 2 - store i16 %load_x10, i16* %x6, align 2 - %arr_data11 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 2 - %tmpVar12 = getelementptr inbounds [2 x %Complex_Type], [2 x %Complex_Type]* %arr_data11, i32 0, i32 0 - %z13 = getelementptr inbounds %Complex_Type, %Complex_Type* %tmpVar12, i32 0, i32 2 - %data14 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %z15 = getelementptr inbounds %Complex_Type, %Complex_Type* %data14, i32 0, i32 2 - %load_z16 = load float, float* %z15, align 4 - store float %load_z16, float* %z13, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %local_data, ptr align 1 @__Complex_Type__init, i64 ptrtoint (ptr getelementptr (%Complex_Type, ptr null, i32 1) to i64), i1 false) + call void @__init_complex_type(ptr %local_data) + call void @__user_init_Complex_Type(ptr %local_data) + %x = getelementptr inbounds %Complex_Type, ptr %local_data, i32 0, i32 0 + %data = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %x1 = getelementptr inbounds %Complex_Type, ptr %data, i32 0, i32 0 + %load_x = load i16, ptr %x1, align 2 + store i16 %load_x, ptr %x, align 2 + %y = getelementptr inbounds %Complex_Type, ptr %local_data, i32 0, i32 1 + %data2 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %y3 = getelementptr inbounds %Complex_Type, ptr %data2, i32 0, i32 1 + %load_y = load i16, ptr %y3, align 2 + store i16 %load_y, ptr %y, align 2 + %z = getelementptr inbounds %Complex_Type, ptr %local_data, i32 0, i32 2 + %data4 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %z5 = getelementptr inbounds %Complex_Type, ptr %data4, i32 0, i32 2 + %load_z = load float, ptr %z5, align 4 + store float %load_z, ptr %z, align 4 + %arr_data = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %tmpVar = getelementptr inbounds [2 x %Complex_Type], ptr %arr_data, i32 0, i32 0 + %x6 = getelementptr inbounds %Complex_Type, ptr %tmpVar, i32 0, i32 0 + %arr_data7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %tmpVar8 = getelementptr inbounds [2 x %Complex_Type], ptr %arr_data7, i32 0, i32 1 + %x9 = getelementptr inbounds %Complex_Type, ptr %tmpVar8, i32 0, i32 0 + %load_x10 = load i16, ptr %x9, align 2 + store i16 %load_x10, ptr %x6, align 2 + %arr_data11 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %tmpVar12 = getelementptr inbounds [2 x %Complex_Type], ptr %arr_data11, i32 0, i32 0 + %z13 = getelementptr inbounds %Complex_Type, ptr %tmpVar12, i32 0, i32 2 + %data14 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %z15 = getelementptr inbounds %Complex_Type, ptr %data14, i32 0, i32 2 + %load_z16 = load float, ptr %z15, align 4 + store float %load_z16, ptr %z13, align 4 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %test = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store void (%child*)* @child__test, void (%child*)** %test, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %test = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + store ptr @child__test, ptr %test, align 8 ret void } - define void @__init_complex_type(%Complex_Type* %0) { + define void @__init_complex_type(ptr %0) { entry: - %self = alloca %Complex_Type*, align 8 - store %Complex_Type* %0, %Complex_Type** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %data = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 1 - call void @__init_complex_type(%Complex_Type* %data) - %deref1 = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref1, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %data = getelementptr inbounds %parent, ptr %deref, i32 0, i32 1 + call void @__init_complex_type(ptr %data) + %deref1 = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_Complex_Type(%Complex_Type* %0) { + define void @__user_init_Complex_Type(ptr %0) { entry: - %self = alloca %Complex_Type*, align 8 - store %Complex_Type* %0, %Complex_Type** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %data = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 1 - call void @__user_init_Complex_Type(%Complex_Type* %data) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %data = getelementptr inbounds %parent, ptr %deref, i32 0, i32 1 + call void @__user_init_Complex_Type(ptr %data) ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -2853,153 +2850,153 @@ fn super_in_action_blocks() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_parent = type { void (%parent*)*, void (%parent*)* } - %parent = type { i32*, i16 } - %__vtable_child = type { void (%child*)*, void (%parent*)* } + %__vtable_parent = type { ptr, ptr } + %parent = type { ptr, i16 } + %__vtable_child = type { ptr, ptr } %child = type { %parent } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_parent__init = unnamed_addr constant %__vtable_parent zeroinitializer - @__parent__init = unnamed_addr constant %parent { i32* null, i16 10 } + @__parent__init = unnamed_addr constant %parent { ptr null, i16 10 } @__vtable_parent_instance = global %__vtable_parent zeroinitializer @____vtable_child__init = unnamed_addr constant %__vtable_child zeroinitializer - @__child__init = unnamed_addr constant %child { %parent { i32* null, i16 10 } } + @__child__init = unnamed_addr constant %child { %parent { ptr null, i16 10 } } @__vtable_child_instance = global %__vtable_child zeroinitializer - define void @parent(%parent* %0) { + define void @parent(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 ret void } - define void @parent__increment(%parent* %0) { + define void @parent__increment(ptr %0) { entry: - %this = alloca %parent*, align 8 - store %parent* %0, %parent** %this, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, %parent* %0, i32 0, i32 1 - %load_value = load i16, i16* %value, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %load_value = load i16, ptr %value, align 2 %1 = sext i16 %load_value to i32 %tmpVar = add i32 %1, 1 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %value, align 2 + store i16 %2, ptr %value, align 2 ret void } - define void @child(%child* %0) { + define void @child(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 ret void } - define void @child__increase(%child* %0) { + define void @child__increase(ptr %0) { entry: - %this = alloca %child*, align 8 - store %child* %0, %child** %this, align 8 - %__parent = getelementptr inbounds %child, %child* %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %value1 = getelementptr inbounds %parent, %parent* %__parent, i32 0, i32 1 - %load_value = load i16, i16* %value1, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %value1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %load_value = load i16, ptr %value1, align 2 %1 = sext i16 %load_value to i32 %tmpVar = add i32 %1, 5 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %value, align 2 - call void @parent__increment(%parent* %__parent) + store i16 %2, ptr %value, align 2 + call void @parent__increment(ptr %__parent) ret void } - define void @__init___vtable_parent(%__vtable_parent* %0) { + define void @__init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 - %deref = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref, i32 0, i32 0 - store void (%parent*)* @parent, void (%parent*)** %__body, align 8 - %deref1 = load %__vtable_parent*, %__vtable_parent** %self, align 8 - %increment = getelementptr inbounds %__vtable_parent, %__vtable_parent* %deref1, i32 0, i32 1 - store void (%parent*)* @parent__increment, void (%parent*)** %increment, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @parent, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %increment = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + store ptr @parent__increment, ptr %increment, align 8 ret void } - define void @__init___vtable_child(%__vtable_child* %0) { + define void @__init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 - %deref = load %__vtable_child*, %__vtable_child** %self, align 8 - %__body = getelementptr inbounds %__vtable_child, %__vtable_child* %deref, i32 0, i32 0 - store void (%child*)* @child, void (%child*)** %__body, align 8 - %deref1 = load %__vtable_child*, %__vtable_child** %self, align 8 - %increment = getelementptr inbounds %__vtable_child, %__vtable_child* %deref1, i32 0, i32 1 - store void (%parent*)* @parent__increment, void (%parent*)** %increment, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + store ptr @child, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %increment = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + store ptr @parent__increment, ptr %increment, align 8 ret void } - define void @__init_parent(%parent* %0) { + define void @__init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 - %deref = load %parent*, %parent** %self, align 8 - %__vtable = getelementptr inbounds %parent, %parent* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_parent* @__vtable_parent_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } - define void @__init_child(%child* %0) { + define void @__init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__init_parent(%parent* %__parent) - %deref1 = load %child*, %child** %self, align 8 - %__parent2 = getelementptr inbounds %child, %child* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, %parent* %__parent2, i32 0, i32 0 - store i32* bitcast (%__vtable_child* @__vtable_child_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__init_parent(ptr %__parent) + %deref1 = load ptr, ptr %self, align 8 + %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_parent(%parent* %0) { + define void @__user_init_parent(ptr %0) { entry: - %self = alloca %parent*, align 8 - store %parent* %0, %parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_child(%__vtable_child* %0) { + define void @__user_init___vtable_child(ptr %0) { entry: - %self = alloca %__vtable_child*, align 8 - store %__vtable_child* %0, %__vtable_child** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_child(%child* %0) { + define void @__user_init_child(ptr %0) { entry: - %self = alloca %child*, align 8 - store %child* %0, %child** %self, align 8 - %deref = load %child*, %child** %self, align 8 - %__parent = getelementptr inbounds %child, %child* %deref, i32 0, i32 0 - call void @__user_init_parent(%parent* %__parent) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + call void @__user_init_parent(ptr %__parent) ret void } - define void @__user_init___vtable_parent(%__vtable_parent* %0) { + define void @__user_init___vtable_parent(ptr %0) { entry: - %self = alloca %__vtable_parent*, align 8 - store %__vtable_parent* %0, %__vtable_parent** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__init___vtable_child(%__vtable_child* @__vtable_child_instance) - call void @__user_init___vtable_parent(%__vtable_parent* @__vtable_parent_instance) - call void @__user_init___vtable_child(%__vtable_child* @__vtable_child_instance) + call void @__init___vtable_parent(ptr @__vtable_parent_instance) + call void @__init___vtable_child(ptr @__vtable_child_instance) + call void @__user_init___vtable_parent(ptr @__vtable_parent_instance) + call void @__user_init___vtable_child(ptr @__vtable_child_instance) ret void } "#); diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index b2639216a09..ba6b10f698d 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -717,35 +717,32 @@ fn by_value_function_arg_builtin_type_strings_are_memcopied() { entry: %main = alloca i32, align 4 %str = alloca [81 x i8], align 1 - %0 = bitcast [81 x i8]* %str to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %1 = bitcast [81 x i8]* %str to i8* - %call = call i32 @foo(i8* %1) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %str, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %call = call i32 @foo(ptr %str) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - define i32 @foo(i8* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 %val = alloca [81 x i8], align 1 - %bitcast = bitcast [81 x i8]* %val to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 81, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 80, i1 false) - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %val, i8 0, i64 81, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %val, ptr align 1 %0, i64 80, i1 false) + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -778,35 +775,32 @@ fn by_value_function_arg_user_type_strings_are_memcopied() { entry: %main = alloca i32, align 4 %str = alloca [65537 x i8], align 1 - %0 = bitcast [65537 x i8]* %str to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([65537 x i8]* getelementptr ([65537 x i8], [65537 x i8]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %1 = bitcast [65537 x i8]* %str to i8* - %call = call i32 @foo(i8* %1) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %str, i8 0, i64 ptrtoint (ptr getelementptr ([65537 x i8], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %call = call i32 @foo(ptr %str) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - define i32 @foo(i8* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 %val = alloca [65537 x i8], align 1 - %bitcast = bitcast [65537 x i8]* %val to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 65537, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 65536, i1 false) - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %val, i8 0, i64 65537, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %val, ptr align 1 %0, i64 65536, i1 false) + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -839,36 +833,31 @@ fn by_value_function_arg_arrays_are_memcopied() { entry: %main = alloca i32, align 4 %arr = alloca [65537 x i32], align 4 - %0 = bitcast [65537 x i32]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([65537 x i32]* getelementptr ([65537 x i32], [65537 x i32]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %1 = bitcast [65537 x i32]* %arr to i32* - %call = call i32 @foo(i32* %1) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([65537 x i32], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %call = call i32 @foo(ptr %arr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - define i32 @foo(i32* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 %val = alloca [65537 x i32], align 4 - %bitcast = bitcast [65537 x i32]* %val to i32* - %1 = bitcast i32* %bitcast to i8* - %2 = bitcast i32* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint ([65537 x i32]* getelementptr ([65537 x i32], [65537 x i32]* null, i32 1) to i64), i1 false) - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %val, ptr align 1 %0, i64 ptrtoint (ptr getelementptr ([65537 x i32], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -907,15 +896,13 @@ fn by_value_function_arg_structs_are_memcopied() { @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer - define i32 @foo(%S_TY* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 %val = alloca %S_TY, align 8 - %1 = bitcast %S_TY* %val to i8* - %2 = bitcast %S_TY* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%S_TY* getelementptr (%S_TY, %S_TY* null, i32 1) to i64), i1 false) - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %val, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%S_TY, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } @@ -923,18 +910,17 @@ fn by_value_function_arg_structs_are_memcopied() { entry: %main = alloca i32, align 4 %s = alloca %S_TY, align 8 - %0 = bitcast %S_TY* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%S_TY, %S_TY* @__S_TY__init, i32 0, i32 0), i64 ptrtoint (%S_TY* getelementptr (%S_TY, %S_TY* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %call = call i32 @foo(%S_TY* %s) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %s, ptr align 1 @__S_TY__init, i64 ptrtoint (ptr getelementptr (%S_TY, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %call = call i32 @foo(ptr %s) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -982,15 +968,13 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { @__AGGREGATE_COLLECTOR_TY__init = unnamed_addr constant %AGGREGATE_COLLECTOR_TY zeroinitializer @__S_TY__init = unnamed_addr constant %S_TY zeroinitializer - define i32 @foo(%AGGREGATE_COLLECTOR_TY* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 %val = alloca %AGGREGATE_COLLECTOR_TY, align 8 - %1 = bitcast %AGGREGATE_COLLECTOR_TY* %val to i8* - %2 = bitcast %AGGREGATE_COLLECTOR_TY* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%AGGREGATE_COLLECTOR_TY* getelementptr (%AGGREGATE_COLLECTOR_TY, %AGGREGATE_COLLECTOR_TY* null, i32 1) to i64), i1 false) - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %val, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%AGGREGATE_COLLECTOR_TY, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } @@ -998,18 +982,17 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { entry: %main = alloca i32, align 4 %s = alloca %AGGREGATE_COLLECTOR_TY, align 8 - %0 = bitcast %AGGREGATE_COLLECTOR_TY* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%AGGREGATE_COLLECTOR_TY* @__AGGREGATE_COLLECTOR_TY__init to i8*), i64 ptrtoint (%AGGREGATE_COLLECTOR_TY* getelementptr (%AGGREGATE_COLLECTOR_TY, %AGGREGATE_COLLECTOR_TY* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %call = call i32 @foo(%AGGREGATE_COLLECTOR_TY* %s) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %s, ptr align 1 @__AGGREGATE_COLLECTOR_TY__init, i64 ptrtoint (ptr getelementptr (%AGGREGATE_COLLECTOR_TY, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %call = call i32 @foo(ptr %s) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -1051,46 +1034,39 @@ fn by_value_fb_arg_aggregates_are_memcopied() { %str = alloca [65537 x i8], align 1 %arr = alloca [1024 x i32], align 4 %fb = alloca %FOO, align 8 - %0 = bitcast [65537 x i8]* %str to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([65537 x i8]* getelementptr ([65537 x i8], [65537 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [1024 x i32]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([1024 x i32]* getelementptr ([1024 x i32], [1024 x i32]* null, i32 1) to i64), i1 false) - %2 = bitcast %FOO* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 getelementptr inbounds (%FOO, %FOO* @__FOO__init, i32 0, i32 0, i32 0), i64 ptrtoint (%FOO* getelementptr (%FOO, %FOO* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %3 = getelementptr inbounds %FOO, %FOO* %fb, i32 0, i32 0 - %4 = bitcast [65537 x i8]* %3 to i8* - %5 = bitcast [65537 x i8]* %str to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %4, i8* align 1 %5, i32 65536, i1 false) - %6 = getelementptr inbounds %FOO, %FOO* %fb, i32 0, i32 1 - %7 = bitcast [1024 x i32]* %6 to i8* - %8 = bitcast [1024 x i32]* %arr to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %7, i8* align 1 %8, i64 ptrtoint ([1024 x i32]* getelementptr ([1024 x i32], [1024 x i32]* null, i32 1) to i64), i1 false) - call void @FOO(%FOO* %fb) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %str, i8 0, i64 ptrtoint (ptr getelementptr ([65537 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([1024 x i32], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %0 = getelementptr inbounds %FOO, ptr %fb, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %str, i32 65536, i1 false) + %1 = getelementptr inbounds %FOO, ptr %fb, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %1, ptr align 1 %arr, i64 ptrtoint (ptr getelementptr ([1024 x i32], ptr null, i32 1) to i64), i1 false) + call void @FOO(ptr %fb) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - define void @FOO(%FOO* %0) { + define void @FOO(ptr %0) { entry: - %this = alloca %FOO*, align 8 - store %FOO* %0, %FOO** %this, align 8 - %val = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 0 - %field = getelementptr inbounds %FOO, %FOO* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %val = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 + %field = getelementptr inbounds %FOO, ptr %0, i32 0, i32 1 ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -1141,57 +1117,47 @@ fn var_output_aggregate_types_are_memcopied() { @__OUT_TYPE__init = unnamed_addr constant %OUT_TYPE zeroinitializer @PRG_instance = global %PRG zeroinitializer - define void @FB(%FB* %0) { + define void @FB(ptr %0) { entry: - %this = alloca %FB*, align 8 - store %FB* %0, %FB** %this, align 8 - %output = getelementptr inbounds %FB, %FB* %0, i32 0, i32 0 - %output2 = getelementptr inbounds %FB, %FB* %0, i32 0, i32 1 - %output3 = getelementptr inbounds %FB, %FB* %0, i32 0, i32 2 - %output4 = getelementptr inbounds %FB, %FB* %0, i32 0, i32 3 - %output5 = getelementptr inbounds %FB, %FB* %0, i32 0, i32 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %output = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 + %output2 = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 + %output3 = getelementptr inbounds %FB, ptr %0, i32 0, i32 2 + %output4 = getelementptr inbounds %FB, ptr %0, i32 0, i32 3 + %output5 = getelementptr inbounds %FB, ptr %0, i32 0, i32 4 ret void } - define void @PRG(%PRG* %0) { + define void @PRG(ptr %0) { entry: - %out = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 0 - %out2 = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 1 - %out3 = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 2 - %out4 = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 3 - %out5 = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 4 - %station = getelementptr inbounds %PRG, %PRG* %0, i32 0, i32 5 - call void @FB(%FB* %station) - %1 = getelementptr inbounds %FB, %FB* %station, i32 0, i32 0 - %2 = bitcast %OUT_TYPE* %out to i8* - %3 = bitcast %OUT_TYPE* %1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 %3, i64 ptrtoint (%OUT_TYPE* getelementptr (%OUT_TYPE, %OUT_TYPE* null, i32 1) to i64), i1 false) - %4 = getelementptr inbounds %FB, %FB* %station, i32 0, i32 1 - %5 = bitcast [11 x i32]* %out2 to i8* - %6 = bitcast [11 x i32]* %4 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %6, i64 ptrtoint ([11 x i32]* getelementptr ([11 x i32], [11 x i32]* null, i32 1) to i64), i1 false) - %7 = getelementptr inbounds %FB, %FB* %station, i32 0, i32 2 - %8 = bitcast [11 x %OUT_TYPE]* %out3 to i8* - %9 = bitcast [11 x %OUT_TYPE]* %7 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %8, i8* align 1 %9, i64 ptrtoint ([11 x %OUT_TYPE]* getelementptr ([11 x %OUT_TYPE], [11 x %OUT_TYPE]* null, i32 1) to i64), i1 false) - %10 = getelementptr inbounds %FB, %FB* %station, i32 0, i32 3 - %11 = bitcast [81 x i8]* %out4 to i8* - %12 = bitcast [81 x i8]* %10 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %11, i8* align 1 %12, i32 80, i1 false) - %13 = getelementptr inbounds %FB, %FB* %station, i32 0, i32 4 - %14 = bitcast [81 x i16]* %out5 to i8* - %15 = bitcast [81 x i16]* %13 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %14, i8* align 2 %15, i32 160, i1 false) + %out = getelementptr inbounds %PRG, ptr %0, i32 0, i32 0 + %out2 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 1 + %out3 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 2 + %out4 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 3 + %out5 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 4 + %station = getelementptr inbounds %PRG, ptr %0, i32 0, i32 5 + call void @FB(ptr %station) + %1 = getelementptr inbounds %FB, ptr %station, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %out, ptr align 1 %1, i64 ptrtoint (ptr getelementptr (%OUT_TYPE, ptr null, i32 1) to i64), i1 false) + %2 = getelementptr inbounds %FB, ptr %station, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %out2, ptr align 1 %2, i64 ptrtoint (ptr getelementptr ([11 x i32], ptr null, i32 1) to i64), i1 false) + %3 = getelementptr inbounds %FB, ptr %station, i32 0, i32 2 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %out3, ptr align 1 %3, i64 ptrtoint (ptr getelementptr ([11 x %OUT_TYPE], ptr null, i32 1) to i64), i1 false) + %4 = getelementptr inbounds %FB, ptr %station, i32 0, i32 3 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %out4, ptr align 1 %4, i32 80, i1 false) + %5 = getelementptr inbounds %FB, ptr %station, i32 0, i32 4 + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %out5, ptr align 2 %5, i32 160, i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -1216,7 +1182,7 @@ fn array_of_string_parameter_with_stride_calculation() { ", ); - filtered_assert_snapshot!(result, @r###" + filtered_assert_snapshot!(result, @r#" ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" @@ -1225,38 +1191,36 @@ fn array_of_string_parameter_with_stride_calculation() { @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"Hello\00" @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"World\00" - define void @foo(i8* %0) { + define void @foo(ptr %0) { entry: - %strings = alloca i8*, align 8 - store i8* %0, i8** %strings, align 8 - %deref = load i8*, i8** %strings, align 8 - %tmpVar = getelementptr inbounds i8, i8* %deref, i32 0 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %deref1 = load i8*, i8** %strings, align 8 - %tmpVar2 = getelementptr inbounds i8, i8* %deref1, i32 81 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar2, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false) + %strings = alloca ptr, align 8 + store ptr %0, ptr %strings, align 8 + %deref = load ptr, ptr %strings, align 8 + %tmpVar = getelementptr inbounds [2 x [81 x i8]], ptr %deref, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 @utf08_literal_0, i32 6, i1 false) + %deref1 = load ptr, ptr %strings, align 8 + %tmpVar2 = getelementptr inbounds [2 x [81 x i8]], ptr %deref1, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar2, ptr align 1 @utf08_literal_1, i32 6, i1 false) ret void } define void @main() { entry: %arr = alloca [2 x [81 x i8]], align 1 - %0 = bitcast [2 x [81 x i8]]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x [81 x i8]]* getelementptr ([2 x [81 x i8]], [2 x [81 x i8]]* null, i32 1) to i64), i1 false) - %1 = bitcast [2 x [81 x i8]]* %arr to i8* - call void @foo(i8* %1) + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [81 x i8]], ptr null, i32 1) to i64), i1 false) + call void @foo(ptr %arr) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } - "###) + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + "#) } #[test] @@ -1288,43 +1252,41 @@ fn array_of_array_integer_parameter_with_stride_calculation() { target datalayout = "[filtered]" target triple = "[filtered]" - define void @foo(i32* %0) { + define void @foo(ptr %0) { entry: - %numbers = alloca i32*, align 8 - store i32* %0, i32** %numbers, align 8 - %deref = load i32*, i32** %numbers, align 8 - %tmpVar = getelementptr inbounds i32, i32* %deref, i32 0 - %tmpVar1 = getelementptr inbounds i32, i32* %tmpVar, i32 0 - store i32 1, i32* %tmpVar1, align 4 - %deref2 = load i32*, i32** %numbers, align 8 - %tmpVar3 = getelementptr inbounds i32, i32* %deref2, i32 0 - %tmpVar4 = getelementptr inbounds i32, i32* %tmpVar3, i32 1 - store i32 2, i32* %tmpVar4, align 4 - %deref5 = load i32*, i32** %numbers, align 8 - %tmpVar6 = getelementptr inbounds i32, i32* %deref5, i32 3 - %tmpVar7 = getelementptr inbounds i32, i32* %tmpVar6, i32 0 - store i32 3, i32* %tmpVar7, align 4 - %deref8 = load i32*, i32** %numbers, align 8 - %tmpVar9 = getelementptr inbounds i32, i32* %deref8, i32 3 - %tmpVar10 = getelementptr inbounds i32, i32* %tmpVar9, i32 1 - store i32 4, i32* %tmpVar10, align 4 + %numbers = alloca ptr, align 8 + store ptr %0, ptr %numbers, align 8 + %deref = load ptr, ptr %numbers, align 8 + %tmpVar = getelementptr inbounds [2 x [3 x i32]], ptr %deref, i32 0, i32 0 + %tmpVar1 = getelementptr inbounds [3 x i32], ptr %tmpVar, i32 0, i32 0 + store i32 1, ptr %tmpVar1, align 4 + %deref2 = load ptr, ptr %numbers, align 8 + %tmpVar3 = getelementptr inbounds [2 x [3 x i32]], ptr %deref2, i32 0, i32 0 + %tmpVar4 = getelementptr inbounds [3 x i32], ptr %tmpVar3, i32 0, i32 1 + store i32 2, ptr %tmpVar4, align 4 + %deref5 = load ptr, ptr %numbers, align 8 + %tmpVar6 = getelementptr inbounds [2 x [3 x i32]], ptr %deref5, i32 0, i32 1 + %tmpVar7 = getelementptr inbounds [3 x i32], ptr %tmpVar6, i32 0, i32 0 + store i32 3, ptr %tmpVar7, align 4 + %deref8 = load ptr, ptr %numbers, align 8 + %tmpVar9 = getelementptr inbounds [2 x [3 x i32]], ptr %deref8, i32 0, i32 1 + %tmpVar10 = getelementptr inbounds [3 x i32], ptr %tmpVar9, i32 0, i32 1 + store i32 4, ptr %tmpVar10, align 4 ret void } define void @main() { entry: %arr = alloca [2 x [3 x i32]], align 4 - %0 = bitcast [2 x [3 x i32]]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x [3 x i32]]* getelementptr ([2 x [3 x i32]], [2 x [3 x i32]]* null, i32 1) to i64), i1 false) - %1 = bitcast [2 x [3 x i32]]* %arr to i32* - call void @foo(i32* %1) + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [3 x i32]], ptr null, i32 1) to i64), i1 false) + call void @foo(ptr %arr) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#) } @@ -1359,37 +1321,35 @@ fn mixed_string_lengths_parameter_compatibility() { @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"Bye\00" @utf08_literal_1 = private unnamed_addr constant [3 x i8] c"Hi\00" - define void @foo(i8* %0) { + define void @foo(ptr %0) { entry: - %short_strings = alloca i8*, align 8 - store i8* %0, i8** %short_strings, align 8 - %deref = load i8*, i8** %short_strings, align 8 - %tmpVar = getelementptr inbounds i8, i8* %deref, i32 0 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar, i8* align 1 getelementptr inbounds ([3 x i8], [3 x i8]* @utf08_literal_1, i32 0, i32 0), i32 3, i1 false) - %deref1 = load i8*, i8** %short_strings, align 8 - %tmpVar2 = getelementptr inbounds i8, i8* %deref1, i32 11 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar2, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_0, i32 0, i32 0), i32 4, i1 false) + %short_strings = alloca ptr, align 8 + store ptr %0, ptr %short_strings, align 8 + %deref = load ptr, ptr %short_strings, align 8 + %tmpVar = getelementptr inbounds [2 x [11 x i8]], ptr %deref, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 @utf08_literal_1, i32 3, i1 false) + %deref1 = load ptr, ptr %short_strings, align 8 + %tmpVar2 = getelementptr inbounds [2 x [11 x i8]], ptr %deref1, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar2, ptr align 1 @utf08_literal_0, i32 4, i1 false) ret void } define void @main() { entry: %long_strings = alloca [2 x [81 x i8]], align 1 - %0 = bitcast [2 x [81 x i8]]* %long_strings to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x [81 x i8]]* getelementptr ([2 x [81 x i8]], [2 x [81 x i8]]* null, i32 1) to i64), i1 false) - %1 = bitcast [2 x [81 x i8]]* %long_strings to i8* - call void @foo(i8* %1) + call void @llvm.memset.p0.i64(ptr align 1 %long_strings, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [81 x i8]], ptr null, i32 1) to i64), i1 false) + call void @foo(ptr %long_strings) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#) } @@ -1421,7 +1381,7 @@ fn program_with_array_of_string_parameter_stride_calculation() { target datalayout = "[filtered]" target triple = "[filtered]" - %StringProcessor = type { [3 x [51 x i8]]* } + %StringProcessor = type { ptr } %main = type { [3 x [51 x i8]] } @StringProcessor_instance = global %StringProcessor zeroinitializer @@ -1430,36 +1390,33 @@ fn program_with_array_of_string_parameter_stride_calculation() { @utf08_literal_1 = private unnamed_addr constant [7 x i8] c"Second\00" @utf08_literal_2 = private unnamed_addr constant [6 x i8] c"Third\00" - define void @StringProcessor(%StringProcessor* %0) { + define void @StringProcessor(ptr %0) { entry: - %messages = getelementptr inbounds %StringProcessor, %StringProcessor* %0, i32 0, i32 0 - %deref = load [3 x [51 x i8]]*, [3 x [51 x i8]]** %messages, align 8 - %tmpVar = getelementptr inbounds [3 x [51 x i8]], [3 x [51 x i8]]* %deref, i32 0, i32 0 - %1 = bitcast [51 x i8]* %tmpVar to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %deref1 = load [3 x [51 x i8]]*, [3 x [51 x i8]]** %messages, align 8 - %tmpVar2 = getelementptr inbounds [3 x [51 x i8]], [3 x [51 x i8]]* %deref1, i32 0, i32 1 - %2 = bitcast [51 x i8]* %tmpVar2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([7 x i8], [7 x i8]* @utf08_literal_1, i32 0, i32 0), i32 7, i1 false) - %deref3 = load [3 x [51 x i8]]*, [3 x [51 x i8]]** %messages, align 8 - %tmpVar4 = getelementptr inbounds [3 x [51 x i8]], [3 x [51 x i8]]* %deref3, i32 0, i32 2 - %3 = bitcast [51 x i8]* %tmpVar4 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_2, i32 0, i32 0), i32 6, i1 false) + %messages = getelementptr inbounds %StringProcessor, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %messages, align 8 + %tmpVar = getelementptr inbounds [3 x [51 x i8]], ptr %deref, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 @utf08_literal_0, i32 6, i1 false) + %deref1 = load ptr, ptr %messages, align 8 + %tmpVar2 = getelementptr inbounds [3 x [51 x i8]], ptr %deref1, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar2, ptr align 1 @utf08_literal_1, i32 7, i1 false) + %deref3 = load ptr, ptr %messages, align 8 + %tmpVar4 = getelementptr inbounds [3 x [51 x i8]], ptr %deref3, i32 0, i32 2 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar4, ptr align 1 @utf08_literal_2, i32 6, i1 false) ret void } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %text_array = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - store [3 x [51 x i8]]* %text_array, [3 x [51 x i8]]** getelementptr inbounds (%StringProcessor, %StringProcessor* @StringProcessor_instance, i32 0, i32 0), align 8 - call void @StringProcessor(%StringProcessor* @StringProcessor_instance) + %text_array = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + store ptr %text_array, ptr @StringProcessor_instance, align 8 + call void @StringProcessor(ptr @StringProcessor_instance) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#) } @@ -1493,43 +1450,43 @@ fn function_block_with_array_of_array_parameter_stride_calculation() { target datalayout = "[filtered]" target triple = "[filtered]" - %MatrixProcessor = type { [2 x [4 x float]]* } + %MatrixProcessor = type { ptr } %main = type { %MatrixProcessor, [2 x [4 x float]] } @__MatrixProcessor__init = unnamed_addr constant %MatrixProcessor zeroinitializer @main_instance = global %main zeroinitializer - define void @MatrixProcessor(%MatrixProcessor* %0) { + define void @MatrixProcessor(ptr %0) { entry: - %this = alloca %MatrixProcessor*, align 8 - store %MatrixProcessor* %0, %MatrixProcessor** %this, align 8 - %matrix = getelementptr inbounds %MatrixProcessor, %MatrixProcessor* %0, i32 0, i32 0 - %deref = load [2 x [4 x float]]*, [2 x [4 x float]]** %matrix, align 8 - %tmpVar = getelementptr inbounds [2 x [4 x float]], [2 x [4 x float]]* %deref, i32 0, i32 0 - %tmpVar1 = getelementptr inbounds [4 x float], [4 x float]* %tmpVar, i32 0, i32 0 - store float 0x3FF19999A0000000, float* %tmpVar1, align 4 - %deref2 = load [2 x [4 x float]]*, [2 x [4 x float]]** %matrix, align 8 - %tmpVar3 = getelementptr inbounds [2 x [4 x float]], [2 x [4 x float]]* %deref2, i32 0, i32 0 - %tmpVar4 = getelementptr inbounds [4 x float], [4 x float]* %tmpVar3, i32 0, i32 1 - store float 0x40019999A0000000, float* %tmpVar4, align 4 - %deref5 = load [2 x [4 x float]]*, [2 x [4 x float]]** %matrix, align 8 - %tmpVar6 = getelementptr inbounds [2 x [4 x float]], [2 x [4 x float]]* %deref5, i32 0, i32 1 - %tmpVar7 = getelementptr inbounds [4 x float], [4 x float]* %tmpVar6, i32 0, i32 0 - store float 0x400A666660000000, float* %tmpVar7, align 4 - %deref8 = load [2 x [4 x float]]*, [2 x [4 x float]]** %matrix, align 8 - %tmpVar9 = getelementptr inbounds [2 x [4 x float]], [2 x [4 x float]]* %deref8, i32 0, i32 1 - %tmpVar10 = getelementptr inbounds [4 x float], [4 x float]* %tmpVar9, i32 0, i32 1 - store float 0x40119999A0000000, float* %tmpVar10, align 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %matrix = getelementptr inbounds %MatrixProcessor, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %matrix, align 8 + %tmpVar = getelementptr inbounds [2 x [4 x float]], ptr %deref, i32 0, i32 0 + %tmpVar1 = getelementptr inbounds [4 x float], ptr %tmpVar, i32 0, i32 0 + store float 0x3FF19999A0000000, ptr %tmpVar1, align 4 + %deref2 = load ptr, ptr %matrix, align 8 + %tmpVar3 = getelementptr inbounds [2 x [4 x float]], ptr %deref2, i32 0, i32 0 + %tmpVar4 = getelementptr inbounds [4 x float], ptr %tmpVar3, i32 0, i32 1 + store float 0x40019999A0000000, ptr %tmpVar4, align 4 + %deref5 = load ptr, ptr %matrix, align 8 + %tmpVar6 = getelementptr inbounds [2 x [4 x float]], ptr %deref5, i32 0, i32 1 + %tmpVar7 = getelementptr inbounds [4 x float], ptr %tmpVar6, i32 0, i32 0 + store float 0x400A666660000000, ptr %tmpVar7, align 4 + %deref8 = load ptr, ptr %matrix, align 8 + %tmpVar9 = getelementptr inbounds [2 x [4 x float]], ptr %deref8, i32 0, i32 1 + %tmpVar10 = getelementptr inbounds [4 x float], ptr %tmpVar9, i32 0, i32 1 + store float 0x40119999A0000000, ptr %tmpVar10, align 4 ret void } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %processor = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %data = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %1 = getelementptr inbounds %MatrixProcessor, %MatrixProcessor* %processor, i32 0, i32 0 - store [2 x [4 x float]]* %data, [2 x [4 x float]]** %1, align 8 - call void @MatrixProcessor(%MatrixProcessor* %processor) + %processor = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %data = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %1 = getelementptr inbounds %MatrixProcessor, ptr %processor, i32 0, i32 0 + store ptr %data, ptr %1, align 8 + call void @MatrixProcessor(ptr %processor) ret void } "#) @@ -1573,37 +1530,36 @@ fn method_with_var_in_out_array_of_strings() { @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"Hello\00" @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"World\00" - define void @StringHandler(%StringHandler* %0) { + define void @StringHandler(ptr %0) { entry: ret void } - define void @StringHandler__process_strings(%StringHandler* %0, i8* %1) { + define void @StringHandler__process_strings(ptr %0, ptr %1) { entry: - %string_list = alloca i8*, align 8 - store i8* %1, i8** %string_list, align 8 - %deref = load i8*, i8** %string_list, align 8 - %tmpVar = getelementptr inbounds i8, i8* %deref, i32 0 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %deref1 = load i8*, i8** %string_list, align 8 - %tmpVar2 = getelementptr inbounds i8, i8* %deref1, i32 31 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar2, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false) + %string_list = alloca ptr, align 8 + store ptr %1, ptr %string_list, align 8 + %deref = load ptr, ptr %string_list, align 8 + %tmpVar = getelementptr inbounds [2 x [31 x i8]], ptr %deref, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 @utf08_literal_0, i32 6, i1 false) + %deref1 = load ptr, ptr %string_list, align 8 + %tmpVar2 = getelementptr inbounds [2 x [31 x i8]], ptr %deref1, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar2, ptr align 1 @utf08_literal_1, i32 6, i1 false) ret void } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %handler = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %my_strings = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %1 = bitcast [2 x [31 x i8]]* %my_strings to i8* - call void @StringHandler__process_strings(%StringHandler* %handler, i8* %1) + %handler = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %my_strings = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + call void @StringHandler__process_strings(ptr %handler, ptr %my_strings) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#) } @@ -1645,44 +1601,43 @@ fn method_with_var_in_out_nested_integer_arrays() { @__DataProcessor__init = unnamed_addr constant %DataProcessor zeroinitializer @main_instance = global %main zeroinitializer - define void @DataProcessor(%DataProcessor* %0) { + define void @DataProcessor(ptr %0) { entry: - %this = alloca %DataProcessor*, align 8 - store %DataProcessor* %0, %DataProcessor** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } - define void @DataProcessor__process_matrix(%DataProcessor* %0, i32* %1) { + define void @DataProcessor__process_matrix(ptr %0, ptr %1) { entry: - %this = alloca %DataProcessor*, align 8 - store %DataProcessor* %0, %DataProcessor** %this, align 8 - %data = alloca i32*, align 8 - store i32* %1, i32** %data, align 8 - %deref = load i32*, i32** %data, align 8 - %tmpVar = getelementptr inbounds i32, i32* %deref, i32 0 - %tmpVar1 = getelementptr inbounds i32, i32* %tmpVar, i32 0 - store i32 10, i32* %tmpVar1, align 4 - %deref2 = load i32*, i32** %data, align 8 - %tmpVar3 = getelementptr inbounds i32, i32* %deref2, i32 0 - %tmpVar4 = getelementptr inbounds i32, i32* %tmpVar3, i32 1 - store i32 20, i32* %tmpVar4, align 4 - %deref5 = load i32*, i32** %data, align 8 - %tmpVar6 = getelementptr inbounds i32, i32* %deref5, i32 2 - %tmpVar7 = getelementptr inbounds i32, i32* %tmpVar6, i32 0 - store i32 30, i32* %tmpVar7, align 4 - %deref8 = load i32*, i32** %data, align 8 - %tmpVar9 = getelementptr inbounds i32, i32* %deref8, i32 2 - %tmpVar10 = getelementptr inbounds i32, i32* %tmpVar9, i32 1 - store i32 40, i32* %tmpVar10, align 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %data = alloca ptr, align 8 + store ptr %1, ptr %data, align 8 + %deref = load ptr, ptr %data, align 8 + %tmpVar = getelementptr inbounds [2 x [2 x i32]], ptr %deref, i32 0, i32 0 + %tmpVar1 = getelementptr inbounds [2 x i32], ptr %tmpVar, i32 0, i32 0 + store i32 10, ptr %tmpVar1, align 4 + %deref2 = load ptr, ptr %data, align 8 + %tmpVar3 = getelementptr inbounds [2 x [2 x i32]], ptr %deref2, i32 0, i32 0 + %tmpVar4 = getelementptr inbounds [2 x i32], ptr %tmpVar3, i32 0, i32 1 + store i32 20, ptr %tmpVar4, align 4 + %deref5 = load ptr, ptr %data, align 8 + %tmpVar6 = getelementptr inbounds [2 x [2 x i32]], ptr %deref5, i32 0, i32 1 + %tmpVar7 = getelementptr inbounds [2 x i32], ptr %tmpVar6, i32 0, i32 0 + store i32 30, ptr %tmpVar7, align 4 + %deref8 = load ptr, ptr %data, align 8 + %tmpVar9 = getelementptr inbounds [2 x [2 x i32]], ptr %deref8, i32 0, i32 1 + %tmpVar10 = getelementptr inbounds [2 x i32], ptr %tmpVar9, i32 0, i32 1 + store i32 40, ptr %tmpVar10, align 4 ret void } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %processor = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %matrix = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %1 = bitcast [2 x [2 x i32]]* %matrix to i32* - call void @DataProcessor__process_matrix(%DataProcessor* %processor, i32* %1) + %processor = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %matrix = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + call void @DataProcessor__process_matrix(ptr %processor, ptr %matrix) ret void } "#) @@ -1730,53 +1685,51 @@ fn method_with_mixed_array_types() { @utf08_literal_0 = private unnamed_addr constant [5 x i8] c"Data\00" @utf08_literal_1 = private unnamed_addr constant [11 x i8] c"Processing\00" - define void @ComplexHandler(%ComplexHandler* %0) { + define void @ComplexHandler(ptr %0) { entry: - %this = alloca %ComplexHandler*, align 8 - store %ComplexHandler* %0, %ComplexHandler** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } - define void @ComplexHandler__handle_data(%ComplexHandler* %0, i8* %1, i16* %2) { + define void @ComplexHandler__handle_data(ptr %0, ptr %1, ptr %2) { entry: - %this = alloca %ComplexHandler*, align 8 - store %ComplexHandler* %0, %ComplexHandler** %this, align 8 - %strings = alloca i8*, align 8 - store i8* %1, i8** %strings, align 8 - %numbers = alloca i16*, align 8 - store i16* %2, i16** %numbers, align 8 - %deref = load i8*, i8** %strings, align 8 - %tmpVar = getelementptr inbounds i8, i8* %deref, i32 0 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar, i8* align 1 getelementptr inbounds ([5 x i8], [5 x i8]* @utf08_literal_0, i32 0, i32 0), i32 5, i1 false) - %deref1 = load i8*, i8** %strings, align 8 - %tmpVar2 = getelementptr inbounds i8, i8* %deref1, i32 21 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %tmpVar2, i8* align 1 getelementptr inbounds ([11 x i8], [11 x i8]* @utf08_literal_1, i32 0, i32 0), i32 11, i1 false) - %deref3 = load i16*, i16** %numbers, align 8 - %tmpVar4 = getelementptr inbounds i16, i16* %deref3, i32 0 - %tmpVar5 = getelementptr inbounds i16, i16* %tmpVar4, i32 0 - store i16 100, i16* %tmpVar5, align 2 - %deref6 = load i16*, i16** %numbers, align 8 - %tmpVar7 = getelementptr inbounds i16, i16* %deref6, i32 2 - %tmpVar8 = getelementptr inbounds i16, i16* %tmpVar7, i32 1 - store i16 200, i16* %tmpVar8, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %strings = alloca ptr, align 8 + store ptr %1, ptr %strings, align 8 + %numbers = alloca ptr, align 8 + store ptr %2, ptr %numbers, align 8 + %deref = load ptr, ptr %strings, align 8 + %tmpVar = getelementptr inbounds [2 x [21 x i8]], ptr %deref, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 @utf08_literal_0, i32 5, i1 false) + %deref1 = load ptr, ptr %strings, align 8 + %tmpVar2 = getelementptr inbounds [2 x [21 x i8]], ptr %deref1, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar2, ptr align 1 @utf08_literal_1, i32 11, i1 false) + %deref3 = load ptr, ptr %numbers, align 8 + %tmpVar4 = getelementptr inbounds [3 x [2 x i16]], ptr %deref3, i32 0, i32 0 + %tmpVar5 = getelementptr inbounds [2 x i16], ptr %tmpVar4, i32 0, i32 0 + store i16 100, ptr %tmpVar5, align 2 + %deref6 = load ptr, ptr %numbers, align 8 + %tmpVar7 = getelementptr inbounds [3 x [2 x i16]], ptr %deref6, i32 0, i32 1 + %tmpVar8 = getelementptr inbounds [2 x i16], ptr %tmpVar7, i32 0, i32 1 + store i16 200, ptr %tmpVar8, align 2 ret void } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %handler = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %text_data = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %num_data = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %1 = bitcast [2 x [21 x i8]]* %text_data to i8* - %2 = bitcast [3 x [2 x i16]]* %num_data to i16* - call void @ComplexHandler__handle_data(%ComplexHandler* %handler, i8* %1, i16* %2) + %handler = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %text_data = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %num_data = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + call void @ComplexHandler__handle_data(ptr %handler, ptr %text_data, ptr %num_data) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#) } @@ -1837,109 +1790,86 @@ fn function_with_array_of_array_return() { @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"Three\00" @utf08_literal_2 = private unnamed_addr constant [4 x i8] c"Two\00" - define void @foo(i16* %0) { + define void @foo(ptr %0) { entry: - %foo = alloca i16*, align 8 - store i16* %0, i16** %foo, align 8 + %foo = alloca ptr, align 8 + store ptr %0, ptr %foo, align 8 %result = alloca [2 x [2 x i16]], align 2 - %1 = bitcast [2 x [2 x i16]]* %result to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) - %tmpVar = getelementptr inbounds [2 x [2 x i16]], [2 x [2 x i16]]* %result, i32 0, i32 0 - %tmpVar1 = getelementptr inbounds [2 x i16], [2 x i16]* %tmpVar, i32 0, i32 0 - store i16 5, i16* %tmpVar1, align 2 - %tmpVar2 = getelementptr inbounds [2 x [2 x i16]], [2 x [2 x i16]]* %result, i32 0, i32 0 - %tmpVar3 = getelementptr inbounds [2 x i16], [2 x i16]* %tmpVar2, i32 0, i32 1 - store i16 10, i16* %tmpVar3, align 2 - %tmpVar4 = getelementptr inbounds [2 x [2 x i16]], [2 x [2 x i16]]* %result, i32 0, i32 1 - %tmpVar5 = getelementptr inbounds [2 x i16], [2 x i16]* %tmpVar4, i32 0, i32 0 - store i16 15, i16* %tmpVar5, align 2 - %tmpVar6 = getelementptr inbounds [2 x [2 x i16]], [2 x [2 x i16]]* %result, i32 0, i32 1 - %tmpVar7 = getelementptr inbounds [2 x i16], [2 x i16]* %tmpVar6, i32 0, i32 1 - store i16 20, i16* %tmpVar7, align 2 - %deref = load i16*, i16** %foo, align 8 - %2 = bitcast i16* %deref to i8* - %3 = bitcast [2 x [2 x i16]]* %result to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 %3, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %result, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) + %tmpVar = getelementptr inbounds [2 x [2 x i16]], ptr %result, i32 0, i32 0 + %tmpVar1 = getelementptr inbounds [2 x i16], ptr %tmpVar, i32 0, i32 0 + store i16 5, ptr %tmpVar1, align 2 + %tmpVar2 = getelementptr inbounds [2 x [2 x i16]], ptr %result, i32 0, i32 0 + %tmpVar3 = getelementptr inbounds [2 x i16], ptr %tmpVar2, i32 0, i32 1 + store i16 10, ptr %tmpVar3, align 2 + %tmpVar4 = getelementptr inbounds [2 x [2 x i16]], ptr %result, i32 0, i32 1 + %tmpVar5 = getelementptr inbounds [2 x i16], ptr %tmpVar4, i32 0, i32 0 + store i16 15, ptr %tmpVar5, align 2 + %tmpVar6 = getelementptr inbounds [2 x [2 x i16]], ptr %result, i32 0, i32 1 + %tmpVar7 = getelementptr inbounds [2 x i16], ptr %tmpVar6, i32 0, i32 1 + store i16 20, ptr %tmpVar7, align 2 + %deref = load ptr, ptr %foo, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %deref, ptr align 1 %result, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) ret void } - define void @bar(i16* %0) { + define void @bar(ptr %0) { entry: - %bar = alloca i16*, align 8 - store i16* %0, i16** %bar, align 8 + %bar = alloca ptr, align 8 + store ptr %0, ptr %bar, align 8 %data = alloca [2 x [2 x i16]], align 2 - %1 = bitcast [2 x [2 x i16]]* %data to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %data, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) %__foo0 = alloca [2 x [2 x i16]], align 2 - %2 = bitcast [2 x [2 x i16]]* %__foo0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) - %3 = bitcast [2 x [2 x i16]]* %__foo0 to i16* - call void @foo(i16* %3) - %4 = bitcast [2 x [2 x i16]]* %data to i8* - %5 = bitcast [2 x [2 x i16]]* %__foo0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %5, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) - %deref = load i16*, i16** %bar, align 8 - %6 = bitcast i16* %deref to i8* - %7 = bitcast [2 x [2 x i16]]* %data to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %7, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__foo0, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) + call void @foo(ptr %__foo0) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %data, ptr align 1 %__foo0, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) + %deref = load ptr, ptr %bar, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %deref, ptr align 1 %data, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) ret void } - define void @baz(i8* %0) { + define void @baz(ptr %0) { entry: - %baz = alloca i8*, align 8 - store i8* %0, i8** %baz, align 8 + %baz = alloca ptr, align 8 + store ptr %0, ptr %baz, align 8 %texts = alloca [3 x [21 x i8]], align 1 - %1 = bitcast [3 x [21 x i8]]* %texts to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([3 x [21 x i8]]* getelementptr ([3 x [21 x i8]], [3 x [21 x i8]]* null, i32 1) to i64), i1 false) - %tmpVar = getelementptr inbounds [3 x [21 x i8]], [3 x [21 x i8]]* %texts, i32 0, i32 0 - %2 = bitcast [21 x i8]* %tmpVar to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_0, i32 0, i32 0), i32 4, i1 false) - %tmpVar1 = getelementptr inbounds [3 x [21 x i8]], [3 x [21 x i8]]* %texts, i32 0, i32 1 - %3 = bitcast [21 x i8]* %tmpVar1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_2, i32 0, i32 0), i32 4, i1 false) - %tmpVar2 = getelementptr inbounds [3 x [21 x i8]], [3 x [21 x i8]]* %texts, i32 0, i32 2 - %4 = bitcast [21 x i8]* %tmpVar2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %4, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false) - %deref = load i8*, i8** %baz, align 8 - %5 = bitcast [3 x [21 x i8]]* %texts to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %deref, i8* align 1 %5, i64 ptrtoint ([3 x [21 x i8]]* getelementptr ([3 x [21 x i8]], [3 x [21 x i8]]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %texts, i8 0, i64 ptrtoint (ptr getelementptr ([3 x [21 x i8]], ptr null, i32 1) to i64), i1 false) + %tmpVar = getelementptr inbounds [3 x [21 x i8]], ptr %texts, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 @utf08_literal_0, i32 4, i1 false) + %tmpVar1 = getelementptr inbounds [3 x [21 x i8]], ptr %texts, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar1, ptr align 1 @utf08_literal_2, i32 4, i1 false) + %tmpVar2 = getelementptr inbounds [3 x [21 x i8]], ptr %texts, i32 0, i32 2 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar2, ptr align 1 @utf08_literal_1, i32 6, i1 false) + %deref = load ptr, ptr %baz, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %deref, ptr align 1 %texts, i64 ptrtoint (ptr getelementptr ([3 x [21 x i8]], ptr null, i32 1) to i64), i1 false) ret void } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %numbers = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %strings = getelementptr inbounds %main, %main* %0, i32 0, i32 1 + %numbers = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %strings = getelementptr inbounds %main, ptr %0, i32 0, i32 1 %__bar1 = alloca [2 x [2 x i16]], align 2 - %1 = bitcast [2 x [2 x i16]]* %__bar1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) - %2 = bitcast [2 x [2 x i16]]* %__bar1 to i16* - call void @bar(i16* %2) - %3 = bitcast [2 x [2 x i16]]* %numbers to i8* - %4 = bitcast [2 x [2 x i16]]* %__bar1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %4, i64 ptrtoint ([2 x [2 x i16]]* getelementptr ([2 x [2 x i16]], [2 x [2 x i16]]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__bar1, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) + call void @bar(ptr %__bar1) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %numbers, ptr align 1 %__bar1, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) %__baz2 = alloca [3 x [21 x i8]], align 1 - %5 = bitcast [3 x [21 x i8]]* %__baz2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %5, i8 0, i64 ptrtoint ([3 x [21 x i8]]* getelementptr ([3 x [21 x i8]], [3 x [21 x i8]]* null, i32 1) to i64), i1 false) - %6 = bitcast [3 x [21 x i8]]* %__baz2 to i8* - call void @baz(i8* %6) - %7 = bitcast [3 x [21 x i8]]* %strings to i8* - %8 = bitcast [3 x [21 x i8]]* %__baz2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %7, i8* align 1 %8, i64 ptrtoint ([3 x [21 x i8]]* getelementptr ([3 x [21 x i8]], [3 x [21 x i8]]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__baz2, i8 0, i64 ptrtoint (ptr getelementptr ([3 x [21 x i8]], ptr null, i32 1) to i64), i1 false) + call void @baz(ptr %__baz2) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %strings, ptr align 1 %__baz2, i64 ptrtoint (ptr getelementptr ([3 x [21 x i8]], ptr null, i32 1) to i64), i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } "#); } diff --git a/src/codegen/tests/polymorphism.rs b/src/codegen/tests/polymorphism.rs index 223b0b810cf..fc2e3d7a057 100644 --- a/src/codegen/tests/polymorphism.rs +++ b/src/codegen/tests/polymorphism.rs @@ -51,12 +51,12 @@ fn simple_overridden_method() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_A = type { void (%A*)*, i16 (%A*, i32)* } - %A = type { i32*, i16, i16 } - %__vtable_B = type { void (%B*)*, i16 (%B*, i32)* } + %__vtable_A = type { ptr, ptr } + %A = type { ptr, i16, i16 } + %__vtable_B = type { ptr, ptr } %B = type { %A, i16, i16 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_A__init = unnamed_addr constant %__vtable_A zeroinitializer @__A__init = unnamed_addr constant %A zeroinitializer @__vtable_A_instance = global %__vtable_A zeroinitializer @@ -64,53 +64,53 @@ fn simple_overridden_method() { @__B__init = unnamed_addr constant %B zeroinitializer @__vtable_B_instance = global %__vtable_B zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 - %one = getelementptr inbounds %A, %A* %0, i32 0, i32 1 - %two = getelementptr inbounds %A, %A* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %one = getelementptr inbounds %A, ptr %0, i32 0, i32 1 + %two = getelementptr inbounds %A, ptr %0, i32 0, i32 2 ret void } - define i16 @A__foo(%A* %0, i32 %1) { + define i16 @A__foo(ptr %0, i32 %1) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 - %one = getelementptr inbounds %A, %A* %0, i32 0, i32 1 - %two = getelementptr inbounds %A, %A* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %one = getelementptr inbounds %A, ptr %0, i32 0, i32 1 + %two = getelementptr inbounds %A, ptr %0, i32 0, i32 2 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - store i16 0, i16* %A.foo, align 2 - %A__foo_ret = load i16, i16* %A.foo, align 2 + store i32 %1, ptr %in, align 4 + store i16 0, ptr %A.foo, align 2 + %A__foo_ret = load i16, ptr %A.foo, align 2 ret i16 %A__foo_ret } - define void @B(%B* %0) { + define void @B(ptr %0) { entry: - %this = alloca %B*, align 8 - store %B* %0, %B** %this, align 8 - %__A = getelementptr inbounds %B, %B* %0, i32 0, i32 0 - %three = getelementptr inbounds %B, %B* %0, i32 0, i32 1 - %four = getelementptr inbounds %B, %B* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %three = getelementptr inbounds %B, ptr %0, i32 0, i32 1 + %four = getelementptr inbounds %B, ptr %0, i32 0, i32 2 ret void } - define i16 @B__foo(%B* %0, i32 %1) { + define i16 @B__foo(ptr %0, i32 %1) { entry: - %this = alloca %B*, align 8 - store %B* %0, %B** %this, align 8 - %__A = getelementptr inbounds %B, %B* %0, i32 0, i32 0 - %three = getelementptr inbounds %B, %B* %0, i32 0, i32 1 - %four = getelementptr inbounds %B, %B* %0, i32 0, i32 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %three = getelementptr inbounds %B, ptr %0, i32 0, i32 1 + %four = getelementptr inbounds %B, ptr %0, i32 0, i32 2 %B.foo = alloca i16, align 2 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - store i16 0, i16* %B.foo, align 2 - %B__foo_ret = load i16, i16* %B.foo, align 2 + store i32 %1, ptr %in, align 4 + store i16 0, ptr %B.foo, align 2 + %B__foo_ret = load i16, ptr %B.foo, align 2 ret i16 %B__foo_ret } @@ -118,132 +118,127 @@ fn simple_overridden_method() { entry: %instanceA = alloca %A, align 8 %instanceB = alloca %B, align 8 - %refInstanceA = alloca %A*, align 8 - %0 = bitcast %A* %instanceA to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%A* @__A__init to i8*), i64 ptrtoint (%A* getelementptr (%A, %A* null, i32 1) to i64), i1 false) - %1 = bitcast %B* %instanceB to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%B* @__B__init to i8*), i64 ptrtoint (%B* getelementptr (%B, %B* null, i32 1) to i64), i1 false) - store %A* null, %A** %refInstanceA, align 8 - call void @__init_a(%A* %instanceA) - call void @__init_b(%B* %instanceB) - call void @__user_init_A(%A* %instanceA) - call void @__user_init_B(%B* %instanceB) - store %A* %instanceA, %A** %refInstanceA, align 8 - %deref = load %A*, %A** %refInstanceA, align 8 - %__vtable = getelementptr inbounds %A, %A* %deref, i32 0, i32 0 - %deref1 = load i32*, i32** %__vtable, align 8 - %cast = bitcast i32* %deref1 to %__vtable_A* - %foo = getelementptr inbounds %__vtable_A, %__vtable_A* %cast, i32 0, i32 1 - %2 = load i16 (%A*, i32)*, i16 (%A*, i32)** %foo, align 8 - %deref2 = load %A*, %A** %refInstanceA, align 8 - %fnptr_call = call i16 %2(%A* %deref2, i32 5) - %3 = bitcast %B* %instanceB to %A* - store %A* %3, %A** %refInstanceA, align 8 - %deref3 = load %A*, %A** %refInstanceA, align 8 - %__vtable4 = getelementptr inbounds %A, %A* %deref3, i32 0, i32 0 - %deref5 = load i32*, i32** %__vtable4, align 8 - %cast6 = bitcast i32* %deref5 to %__vtable_A* - %foo7 = getelementptr inbounds %__vtable_A, %__vtable_A* %cast6, i32 0, i32 1 - %4 = load i16 (%A*, i32)*, i16 (%A*, i32)** %foo7, align 8 - %deref8 = load %A*, %A** %refInstanceA, align 8 - %fnptr_call9 = call i16 %4(%A* %deref8, i32 10) + %refInstanceA = alloca ptr, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %instanceA, ptr align 1 @__A__init, i64 ptrtoint (ptr getelementptr (%A, ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %instanceB, ptr align 1 @__B__init, i64 ptrtoint (ptr getelementptr (%B, ptr null, i32 1) to i64), i1 false) + store ptr null, ptr %refInstanceA, align 8 + call void @__init_a(ptr %instanceA) + call void @__init_b(ptr %instanceB) + call void @__user_init_A(ptr %instanceA) + call void @__user_init_B(ptr %instanceB) + store ptr %instanceA, ptr %refInstanceA, align 8 + %deref = load ptr, ptr %refInstanceA, align 8 + %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %deref1 = load ptr, ptr %__vtable, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %0 = load ptr, ptr %foo, align 8 + %deref2 = load ptr, ptr %refInstanceA, align 8 + %fnptr_call = call i16 %0(ptr %deref2, i32 5) + store ptr %instanceB, ptr %refInstanceA, align 8 + %deref3 = load ptr, ptr %refInstanceA, align 8 + %__vtable4 = getelementptr inbounds %A, ptr %deref3, i32 0, i32 0 + %deref5 = load ptr, ptr %__vtable4, align 8 + %foo6 = getelementptr inbounds %__vtable_A, ptr %deref5, i32 0, i32 1 + %1 = load ptr, ptr %foo6, align 8 + %deref7 = load ptr, ptr %refInstanceA, align 8 + %fnptr_call8 = call i16 %1(ptr %deref7, i32 10) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_a(%__vtable_A* %0) { + define void @__init___vtable_a(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 - %deref = load %__vtable_A*, %__vtable_A** %self, align 8 - %__body = getelementptr inbounds %__vtable_A, %__vtable_A* %deref, i32 0, i32 0 - store void (%A*)* @A, void (%A*)** %__body, align 8 - %deref1 = load %__vtable_A*, %__vtable_A** %self, align 8 - %foo = getelementptr inbounds %__vtable_A, %__vtable_A* %deref1, i32 0, i32 1 - store i16 (%A*, i32)* @A__foo, i16 (%A*, i32)** %foo, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @A, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @A__foo, ptr %foo, align 8 ret void } - define void @__init___vtable_b(%__vtable_B* %0) { + define void @__init___vtable_b(ptr %0) { entry: - %self = alloca %__vtable_B*, align 8 - store %__vtable_B* %0, %__vtable_B** %self, align 8 - %deref = load %__vtable_B*, %__vtable_B** %self, align 8 - %__body = getelementptr inbounds %__vtable_B, %__vtable_B* %deref, i32 0, i32 0 - store void (%B*)* @B, void (%B*)** %__body, align 8 - %deref1 = load %__vtable_B*, %__vtable_B** %self, align 8 - %foo = getelementptr inbounds %__vtable_B, %__vtable_B* %deref1, i32 0, i32 1 - store i16 (%B*, i32)* @B__foo, i16 (%B*, i32)** %foo, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @B, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @B__foo, ptr %foo, align 8 ret void } - define void @__init_b(%B* %0) { + define void @__init_b(ptr %0) { entry: - %self = alloca %B*, align 8 - store %B* %0, %B** %self, align 8 - %deref = load %B*, %B** %self, align 8 - %__A = getelementptr inbounds %B, %B* %deref, i32 0, i32 0 - call void @__init_a(%A* %__A) - %deref1 = load %B*, %B** %self, align 8 - %__A2 = getelementptr inbounds %B, %B* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, %A* %__A2, i32 0, i32 0 - store i32* bitcast (%__vtable_B* @__vtable_B_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__init_a(ptr %__A) + %deref1 = load ptr, ptr %self, align 8 + %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + store ptr @__vtable_B_instance, ptr %__vtable, align 8 ret void } - define void @__init_a(%A* %0) { + define void @__init_a(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 - %deref = load %A*, %A** %self, align 8 - %__vtable = getelementptr inbounds %A, %A* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_A* @__vtable_A_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_A(%__vtable_A* %0) { + define void @__user_init___vtable_A(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_B(%B* %0) { + define void @__user_init_B(ptr %0) { entry: - %self = alloca %B*, align 8 - store %B* %0, %B** %self, align 8 - %deref = load %B*, %B** %self, align 8 - %__A = getelementptr inbounds %B, %B* %deref, i32 0, i32 0 - call void @__user_init_A(%A* %__A) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__user_init_A(ptr %__A) ret void } - define void @__user_init_A(%A* %0) { + define void @__user_init_A(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_B(%__vtable_B* %0) { + define void @__user_init___vtable_B(ptr %0) { entry: - %self = alloca %__vtable_B*, align 8 - store %__vtable_B* %0, %__vtable_B** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_a(%__vtable_A* @__vtable_A_instance) - call void @__init___vtable_b(%__vtable_B* @__vtable_B_instance) - call void @__user_init___vtable_A(%__vtable_A* @__vtable_A_instance) - call void @__user_init___vtable_B(%__vtable_B* @__vtable_B_instance) + call void @__init___vtable_a(ptr @__vtable_A_instance) + call void @__init___vtable_b(ptr @__vtable_B_instance) + call void @__user_init___vtable_A(ptr @__vtable_A_instance) + call void @__user_init___vtable_B(ptr @__vtable_B_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -273,95 +268,94 @@ fn method_call_within_method() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_A = type { void (%A*)*, i16 (%A*, i32)*, void (%A*)* } - %A = type { i32* } + %__vtable_A = type { ptr, ptr, ptr } + %A = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_A__init = unnamed_addr constant %__vtable_A zeroinitializer @__A__init = unnamed_addr constant %A zeroinitializer @__vtable_A_instance = global %__vtable_A zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 ret void } - define i16 @A__foo(%A* %0, i32 %1) { + define i16 @A__foo(ptr %0, i32 %1) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - store i16 0, i16* %A.foo, align 2 - %A__foo_ret = load i16, i16* %A.foo, align 2 + store i32 %1, ptr %in, align 4 + store i16 0, ptr %A.foo, align 2 + %A__foo_ret = load i16, ptr %A.foo, align 2 ret i16 %A__foo_ret } - define void @A__bar(%A* %0) { + define void @A__bar(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 - %deref = load %A*, %A** %this, align 8 - %__vtable1 = getelementptr inbounds %A, %A* %deref, i32 0, i32 0 - %deref2 = load i32*, i32** %__vtable1, align 8 - %cast = bitcast i32* %deref2 to %__vtable_A* - %foo = getelementptr inbounds %__vtable_A, %__vtable_A* %cast, i32 0, i32 1 - %1 = load i16 (%A*, i32)*, i16 (%A*, i32)** %foo, align 8 - %deref3 = load %A*, %A** %this, align 8 - %fnptr_call = call i16 %1(%A* %deref3, i32 5) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %this, align 8 + %__vtable1 = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %deref2 = load ptr, ptr %__vtable1, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 1 + %1 = load ptr, ptr %foo, align 8 + %deref3 = load ptr, ptr %this, align 8 + %fnptr_call = call i16 %1(ptr %deref3, i32 5) ret void } - define void @__init___vtable_a(%__vtable_A* %0) { + define void @__init___vtable_a(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 - %deref = load %__vtable_A*, %__vtable_A** %self, align 8 - %__body = getelementptr inbounds %__vtable_A, %__vtable_A* %deref, i32 0, i32 0 - store void (%A*)* @A, void (%A*)** %__body, align 8 - %deref1 = load %__vtable_A*, %__vtable_A** %self, align 8 - %foo = getelementptr inbounds %__vtable_A, %__vtable_A* %deref1, i32 0, i32 1 - store i16 (%A*, i32)* @A__foo, i16 (%A*, i32)** %foo, align 8 - %deref2 = load %__vtable_A*, %__vtable_A** %self, align 8 - %bar = getelementptr inbounds %__vtable_A, %__vtable_A* %deref2, i32 0, i32 2 - store void (%A*)* @A__bar, void (%A*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @A, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @A__foo, ptr %foo, align 8 + %deref2 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + store ptr @A__bar, ptr %bar, align 8 ret void } - define void @__init_a(%A* %0) { + define void @__init_a(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 - %deref = load %A*, %A** %self, align 8 - %__vtable = getelementptr inbounds %A, %A* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_A* @__vtable_A_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_A(%A* %0) { + define void @__user_init_A(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_A(%__vtable_A* %0) { + define void @__user_init___vtable_A(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_a(%__vtable_A* @__vtable_A_instance) - call void @__user_init___vtable_A(%__vtable_A* @__vtable_A_instance) + call void @__init___vtable_a(ptr @__vtable_A_instance) + call void @__user_init___vtable_A(ptr @__vtable_A_instance) ret void } "#); @@ -412,14 +406,14 @@ fn this_is_untouched() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_A = type { void (%A*)*, i16 (%A*, i32)*, void (%A*)* } - %A = type { i32* } - %__vtable_B = type { void (%B*)*, i16 (%A*, i32)*, void (%B*)* } + %__vtable_A = type { ptr, ptr, ptr } + %A = type { ptr } + %__vtable_B = type { ptr, ptr, ptr } %B = type { %A } - %__vtable_C = type { void (%C*)*, i16 (%C*, i32)*, void (%C*)* } + %__vtable_C = type { ptr, ptr, ptr } %C = type { %A } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_A__init = unnamed_addr constant %__vtable_A zeroinitializer @__A__init = unnamed_addr constant %A zeroinitializer @__vtable_A_instance = global %__vtable_A zeroinitializer @@ -430,229 +424,229 @@ fn this_is_untouched() { @__C__init = unnamed_addr constant %C zeroinitializer @__vtable_C_instance = global %__vtable_C zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 ret void } - define i16 @A__foo(%A* %0, i32 %1) { + define i16 @A__foo(ptr %0, i32 %1) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - store i16 0, i16* %A.foo, align 2 - %A__foo_ret = load i16, i16* %A.foo, align 2 + store i32 %1, ptr %in, align 4 + store i16 0, ptr %A.foo, align 2 + %A__foo_ret = load i16, ptr %A.foo, align 2 ret i16 %A__foo_ret } - define void @A__bar(%A* %0) { + define void @A__bar(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 ret void } - define void @B(%B* %0) { + define void @B(ptr %0) { entry: - %this = alloca %B*, align 8 - store %B* %0, %B** %this, align 8 - %__A = getelementptr inbounds %B, %B* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 ret void } - define void @B__bar(%B* %0) { + define void @B__bar(ptr %0) { entry: - %this = alloca %B*, align 8 - store %B* %0, %B** %this, align 8 - %__A = getelementptr inbounds %B, %B* %0, i32 0, i32 0 - %deref = load %B*, %B** %this, align 8 - %__A1 = getelementptr inbounds %B, %B* %deref, i32 0, i32 0 - %call = call i16 @A__foo(%A* %__A1, i32 5) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %this, align 8 + %__A1 = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %call = call i16 @A__foo(ptr %__A1, i32 5) ret void } - define void @C(%C* %0) { + define void @C(ptr %0) { entry: - %this = alloca %C*, align 8 - store %C* %0, %C** %this, align 8 - %__A = getelementptr inbounds %C, %C* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %C, ptr %0, i32 0, i32 0 ret void } - define i16 @C__foo(%C* %0, i32 %1) { + define i16 @C__foo(ptr %0, i32 %1) { entry: - %this = alloca %C*, align 8 - store %C* %0, %C** %this, align 8 - %__A = getelementptr inbounds %C, %C* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %C, ptr %0, i32 0, i32 0 %C.foo = alloca i16, align 2 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - store i16 0, i16* %C.foo, align 2 - %deref = load %C*, %C** %this, align 8 - call void @C__bar(%C* %deref) - %C__foo_ret = load i16, i16* %C.foo, align 2 + store i32 %1, ptr %in, align 4 + store i16 0, ptr %C.foo, align 2 + %deref = load ptr, ptr %this, align 8 + call void @C__bar(ptr %deref) + %C__foo_ret = load i16, ptr %C.foo, align 2 ret i16 %C__foo_ret } - define void @C__bar(%C* %0) { + define void @C__bar(ptr %0) { entry: - %this = alloca %C*, align 8 - store %C* %0, %C** %this, align 8 - %__A = getelementptr inbounds %C, %C* %0, i32 0, i32 0 - %deref = load %C*, %C** %this, align 8 - %call = call i16 @C__foo(%C* %deref, i32 5) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %C, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %this, align 8 + %call = call i16 @C__foo(ptr %deref, i32 5) ret void } - define void @__init___vtable_a(%__vtable_A* %0) { + define void @__init___vtable_a(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 - %deref = load %__vtable_A*, %__vtable_A** %self, align 8 - %__body = getelementptr inbounds %__vtable_A, %__vtable_A* %deref, i32 0, i32 0 - store void (%A*)* @A, void (%A*)** %__body, align 8 - %deref1 = load %__vtable_A*, %__vtable_A** %self, align 8 - %foo = getelementptr inbounds %__vtable_A, %__vtable_A* %deref1, i32 0, i32 1 - store i16 (%A*, i32)* @A__foo, i16 (%A*, i32)** %foo, align 8 - %deref2 = load %__vtable_A*, %__vtable_A** %self, align 8 - %bar = getelementptr inbounds %__vtable_A, %__vtable_A* %deref2, i32 0, i32 2 - store void (%A*)* @A__bar, void (%A*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @A, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @A__foo, ptr %foo, align 8 + %deref2 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + store ptr @A__bar, ptr %bar, align 8 ret void } - define void @__init___vtable_b(%__vtable_B* %0) { + define void @__init___vtable_b(ptr %0) { entry: - %self = alloca %__vtable_B*, align 8 - store %__vtable_B* %0, %__vtable_B** %self, align 8 - %deref = load %__vtable_B*, %__vtable_B** %self, align 8 - %__body = getelementptr inbounds %__vtable_B, %__vtable_B* %deref, i32 0, i32 0 - store void (%B*)* @B, void (%B*)** %__body, align 8 - %deref1 = load %__vtable_B*, %__vtable_B** %self, align 8 - %foo = getelementptr inbounds %__vtable_B, %__vtable_B* %deref1, i32 0, i32 1 - store i16 (%A*, i32)* @A__foo, i16 (%A*, i32)** %foo, align 8 - %deref2 = load %__vtable_B*, %__vtable_B** %self, align 8 - %bar = getelementptr inbounds %__vtable_B, %__vtable_B* %deref2, i32 0, i32 2 - store void (%B*)* @B__bar, void (%B*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @B, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @A__foo, ptr %foo, align 8 + %deref2 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + store ptr @B__bar, ptr %bar, align 8 ret void } - define void @__init___vtable_c(%__vtable_C* %0) { + define void @__init___vtable_c(ptr %0) { entry: - %self = alloca %__vtable_C*, align 8 - store %__vtable_C* %0, %__vtable_C** %self, align 8 - %deref = load %__vtable_C*, %__vtable_C** %self, align 8 - %__body = getelementptr inbounds %__vtable_C, %__vtable_C* %deref, i32 0, i32 0 - store void (%C*)* @C, void (%C*)** %__body, align 8 - %deref1 = load %__vtable_C*, %__vtable_C** %self, align 8 - %foo = getelementptr inbounds %__vtable_C, %__vtable_C* %deref1, i32 0, i32 1 - store i16 (%C*, i32)* @C__foo, i16 (%C*, i32)** %foo, align 8 - %deref2 = load %__vtable_C*, %__vtable_C** %self, align 8 - %bar = getelementptr inbounds %__vtable_C, %__vtable_C* %deref2, i32 0, i32 2 - store void (%C*)* @C__bar, void (%C*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @C, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @C__foo, ptr %foo, align 8 + %deref2 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + store ptr @C__bar, ptr %bar, align 8 ret void } - define void @__init_a(%A* %0) { + define void @__init_a(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 - %deref = load %A*, %A** %self, align 8 - %__vtable = getelementptr inbounds %A, %A* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_A* @__vtable_A_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } - define void @__init_b(%B* %0) { + define void @__init_b(ptr %0) { entry: - %self = alloca %B*, align 8 - store %B* %0, %B** %self, align 8 - %deref = load %B*, %B** %self, align 8 - %__A = getelementptr inbounds %B, %B* %deref, i32 0, i32 0 - call void @__init_a(%A* %__A) - %deref1 = load %B*, %B** %self, align 8 - %__A2 = getelementptr inbounds %B, %B* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, %A* %__A2, i32 0, i32 0 - store i32* bitcast (%__vtable_B* @__vtable_B_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__init_a(ptr %__A) + %deref1 = load ptr, ptr %self, align 8 + %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + store ptr @__vtable_B_instance, ptr %__vtable, align 8 ret void } - define void @__init_c(%C* %0) { + define void @__init_c(ptr %0) { entry: - %self = alloca %C*, align 8 - store %C* %0, %C** %self, align 8 - %deref = load %C*, %C** %self, align 8 - %__A = getelementptr inbounds %C, %C* %deref, i32 0, i32 0 - call void @__init_a(%A* %__A) - %deref1 = load %C*, %C** %self, align 8 - %__A2 = getelementptr inbounds %C, %C* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, %A* %__A2, i32 0, i32 0 - store i32* bitcast (%__vtable_C* @__vtable_C_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__init_a(ptr %__A) + %deref1 = load ptr, ptr %self, align 8 + %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + store ptr @__vtable_C_instance, ptr %__vtable, align 8 ret void } - define void @__user_init_C(%C* %0) { + define void @__user_init_C(ptr %0) { entry: - %self = alloca %C*, align 8 - store %C* %0, %C** %self, align 8 - %deref = load %C*, %C** %self, align 8 - %__A = getelementptr inbounds %C, %C* %deref, i32 0, i32 0 - call void @__user_init_A(%A* %__A) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__user_init_A(ptr %__A) ret void } - define void @__user_init_A(%A* %0) { + define void @__user_init_A(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_A(%__vtable_A* %0) { + define void @__user_init___vtable_A(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_B(%B* %0) { + define void @__user_init_B(ptr %0) { entry: - %self = alloca %B*, align 8 - store %B* %0, %B** %self, align 8 - %deref = load %B*, %B** %self, align 8 - %__A = getelementptr inbounds %B, %B* %deref, i32 0, i32 0 - call void @__user_init_A(%A* %__A) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__user_init_A(ptr %__A) ret void } - define void @__user_init___vtable_C(%__vtable_C* %0) { + define void @__user_init___vtable_C(ptr %0) { entry: - %self = alloca %__vtable_C*, align 8 - store %__vtable_C* %0, %__vtable_C** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_B(%__vtable_B* %0) { + define void @__user_init___vtable_B(ptr %0) { entry: - %self = alloca %__vtable_B*, align 8 - store %__vtable_B* %0, %__vtable_B** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_a(%__vtable_A* @__vtable_A_instance) - call void @__init___vtable_b(%__vtable_B* @__vtable_B_instance) - call void @__init___vtable_c(%__vtable_C* @__vtable_C_instance) - call void @__user_init___vtable_A(%__vtable_A* @__vtable_A_instance) - call void @__user_init___vtable_B(%__vtable_B* @__vtable_B_instance) - call void @__user_init___vtable_C(%__vtable_C* @__vtable_C_instance) + call void @__init___vtable_a(ptr @__vtable_A_instance) + call void @__init___vtable_b(ptr @__vtable_B_instance) + call void @__init___vtable_c(ptr @__vtable_C_instance) + call void @__user_init___vtable_A(ptr @__vtable_A_instance) + call void @__user_init___vtable_B(ptr @__vtable_B_instance) + call void @__user_init___vtable_C(ptr @__vtable_C_instance) ret void } "#); @@ -698,12 +692,12 @@ fn super_is_untouched() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_A = type { void (%A*)*, i16 (%A*, i32)*, void (%A*)* } - %A = type { i32* } - %__vtable_B = type { void (%B*)*, i16 (%B*, i32)*, void (%B*)* } + %__vtable_A = type { ptr, ptr, ptr } + %A = type { ptr } + %__vtable_B = type { ptr, ptr, ptr } %B = type { %A } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_A__init = unnamed_addr constant %__vtable_A zeroinitializer @__A__init = unnamed_addr constant %A zeroinitializer @__vtable_A_instance = global %__vtable_A zeroinitializer @@ -711,161 +705,161 @@ fn super_is_untouched() { @__B__init = unnamed_addr constant %B zeroinitializer @__vtable_B_instance = global %__vtable_B zeroinitializer - define void @A(%A* %0) { + define void @A(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 ret void } - define i16 @A__foo(%A* %0, i32 %1) { + define i16 @A__foo(ptr %0, i32 %1) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - store i16 0, i16* %A.foo, align 2 - %A__foo_ret = load i16, i16* %A.foo, align 2 + store i32 %1, ptr %in, align 4 + store i16 0, ptr %A.foo, align 2 + %A__foo_ret = load i16, ptr %A.foo, align 2 ret i16 %A__foo_ret } - define void @A__bar(%A* %0) { + define void @A__bar(ptr %0) { entry: - %this = alloca %A*, align 8 - store %A* %0, %A** %this, align 8 - %__vtable = getelementptr inbounds %A, %A* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 ret void } - define void @B(%B* %0) { + define void @B(ptr %0) { entry: - %this = alloca %B*, align 8 - store %B* %0, %B** %this, align 8 - %__A = getelementptr inbounds %B, %B* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 ret void } - define i16 @B__foo(%B* %0, i32 %1) { + define i16 @B__foo(ptr %0, i32 %1) { entry: - %this = alloca %B*, align 8 - store %B* %0, %B** %this, align 8 - %__A = getelementptr inbounds %B, %B* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 %B.foo = alloca i16, align 2 %in = alloca i32, align 4 - store i32 %1, i32* %in, align 4 - store i16 0, i16* %B.foo, align 2 - %call = call i16 @A__foo(%A* %__A, i32 5) - call void @A__bar(%A* %__A) - %B__foo_ret = load i16, i16* %B.foo, align 2 + store i32 %1, ptr %in, align 4 + store i16 0, ptr %B.foo, align 2 + %call = call i16 @A__foo(ptr %__A, i32 5) + call void @A__bar(ptr %__A) + %B__foo_ret = load i16, ptr %B.foo, align 2 ret i16 %B__foo_ret } - define void @B__bar(%B* %0) { + define void @B__bar(ptr %0) { entry: - %this = alloca %B*, align 8 - store %B* %0, %B** %this, align 8 - %__A = getelementptr inbounds %B, %B* %0, i32 0, i32 0 - %call = call i16 @A__foo(%A* %__A, i32 5) - call void @A__bar(%A* %__A) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %call = call i16 @A__foo(ptr %__A, i32 5) + call void @A__bar(ptr %__A) ret void } - define void @__init___vtable_a(%__vtable_A* %0) { + define void @__init___vtable_a(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 - %deref = load %__vtable_A*, %__vtable_A** %self, align 8 - %__body = getelementptr inbounds %__vtable_A, %__vtable_A* %deref, i32 0, i32 0 - store void (%A*)* @A, void (%A*)** %__body, align 8 - %deref1 = load %__vtable_A*, %__vtable_A** %self, align 8 - %foo = getelementptr inbounds %__vtable_A, %__vtable_A* %deref1, i32 0, i32 1 - store i16 (%A*, i32)* @A__foo, i16 (%A*, i32)** %foo, align 8 - %deref2 = load %__vtable_A*, %__vtable_A** %self, align 8 - %bar = getelementptr inbounds %__vtable_A, %__vtable_A* %deref2, i32 0, i32 2 - store void (%A*)* @A__bar, void (%A*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @A, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @A__foo, ptr %foo, align 8 + %deref2 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + store ptr @A__bar, ptr %bar, align 8 ret void } - define void @__init___vtable_b(%__vtable_B* %0) { + define void @__init___vtable_b(ptr %0) { entry: - %self = alloca %__vtable_B*, align 8 - store %__vtable_B* %0, %__vtable_B** %self, align 8 - %deref = load %__vtable_B*, %__vtable_B** %self, align 8 - %__body = getelementptr inbounds %__vtable_B, %__vtable_B* %deref, i32 0, i32 0 - store void (%B*)* @B, void (%B*)** %__body, align 8 - %deref1 = load %__vtable_B*, %__vtable_B** %self, align 8 - %foo = getelementptr inbounds %__vtable_B, %__vtable_B* %deref1, i32 0, i32 1 - store i16 (%B*, i32)* @B__foo, i16 (%B*, i32)** %foo, align 8 - %deref2 = load %__vtable_B*, %__vtable_B** %self, align 8 - %bar = getelementptr inbounds %__vtable_B, %__vtable_B* %deref2, i32 0, i32 2 - store void (%B*)* @B__bar, void (%B*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + store ptr @B, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + store ptr @B__foo, ptr %foo, align 8 + %deref2 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + store ptr @B__bar, ptr %bar, align 8 ret void } - define void @__init_a(%A* %0) { + define void @__init_a(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 - %deref = load %A*, %A** %self, align 8 - %__vtable = getelementptr inbounds %A, %A* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_A* @__vtable_A_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } - define void @__init_b(%B* %0) { + define void @__init_b(ptr %0) { entry: - %self = alloca %B*, align 8 - store %B* %0, %B** %self, align 8 - %deref = load %B*, %B** %self, align 8 - %__A = getelementptr inbounds %B, %B* %deref, i32 0, i32 0 - call void @__init_a(%A* %__A) - %deref1 = load %B*, %B** %self, align 8 - %__A2 = getelementptr inbounds %B, %B* %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, %A* %__A2, i32 0, i32 0 - store i32* bitcast (%__vtable_B* @__vtable_B_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__init_a(ptr %__A) + %deref1 = load ptr, ptr %self, align 8 + %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + store ptr @__vtable_B_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_A(%__vtable_A* %0) { + define void @__user_init___vtable_A(ptr %0) { entry: - %self = alloca %__vtable_A*, align 8 - store %__vtable_A* %0, %__vtable_A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_B(%B* %0) { + define void @__user_init_B(ptr %0) { entry: - %self = alloca %B*, align 8 - store %B* %0, %B** %self, align 8 - %deref = load %B*, %B** %self, align 8 - %__A = getelementptr inbounds %B, %B* %deref, i32 0, i32 0 - call void @__user_init_A(%A* %__A) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + call void @__user_init_A(ptr %__A) ret void } - define void @__user_init_A(%A* %0) { + define void @__user_init_A(ptr %0) { entry: - %self = alloca %A*, align 8 - store %A* %0, %A** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_B(%__vtable_B* %0) { + define void @__user_init___vtable_B(ptr %0) { entry: - %self = alloca %__vtable_B*, align 8 - store %__vtable_B* %0, %__vtable_B** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_a(%__vtable_A* @__vtable_A_instance) - call void @__init___vtable_b(%__vtable_B* @__vtable_B_instance) - call void @__user_init___vtable_A(%__vtable_A* @__vtable_A_instance) - call void @__user_init___vtable_B(%__vtable_B* @__vtable_B_instance) + call void @__init___vtable_a(ptr @__vtable_A_instance) + call void @__init___vtable_b(ptr @__vtable_B_instance) + call void @__user_init___vtable_A(ptr @__vtable_A_instance) + call void @__user_init___vtable_B(ptr @__vtable_B_instance) ret void } "#); diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap index 39012603f24..1b99eef5dab 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__a_global_variables_generates_in_separate_global_variables.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,7 +13,7 @@ target triple = "[filtered]" @gY = global i8 0 @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap index d322e874d59..9629a893488 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,11 +13,11 @@ target triple = "[filtered]" @Main_instance = global %Main zeroinitializer @__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer -define void @Main(%Main* %0) { +define void @Main(ptr %0) { entry: - %m = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 - %field1 = getelementptr inbounds %MyStruct, %MyStruct* %m, i32 0, i32 0 - %tmpVar = getelementptr inbounds [5 x i16], [5 x i16]* %field1, i32 0, i32 3 - store i16 7, i16* %tmpVar, align 2 + %m = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 + %field1 = getelementptr inbounds %MyStruct, ptr %m, i32 0, i32 0 + %tmpVar = getelementptr inbounds [5 x i16], ptr %field1, i32 0, i32 3 + store i16 7, ptr %tmpVar, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap index 4fc4cbccf06..4edc24533e3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,14 +15,14 @@ target triple = "[filtered]" @__OuterStruct__init = unnamed_addr constant %OuterStruct zeroinitializer @__InnerStruct__init = unnamed_addr constant %InnerStruct zeroinitializer -define void @Main(%Main* %0) { +define void @Main(ptr %0) { entry: - %m = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 - %out1 = getelementptr inbounds %OuterStruct, %OuterStruct* %m, i32 0, i32 0 - %inner1 = getelementptr inbounds %InnerStruct, %InnerStruct* %out1, i32 0, i32 0 - store i16 3, i16* %inner1, align 2 - %out2 = getelementptr inbounds %OuterStruct, %OuterStruct* %m, i32 0, i32 1 - %inner2 = getelementptr inbounds %InnerStruct, %InnerStruct* %out2, i32 0, i32 1 - store i16 7, i16* %inner2, align 2 + %m = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 + %out1 = getelementptr inbounds %OuterStruct, ptr %m, i32 0, i32 0 + %inner1 = getelementptr inbounds %InnerStruct, ptr %out1, i32 0, i32 0 + store i16 3, ptr %inner1, align 2 + %out2 = getelementptr inbounds %OuterStruct, ptr %m, i32 0, i32 1 + %inner2 = getelementptr inbounds %InnerStruct, ptr %out2, i32 0, i32 1 + store i16 7, ptr %inner2, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap index b4a1de72867..8129aeba925 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - call void @prg__foo(%prg* %0) + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + call void @prg__foo(ptr %0) ret void } -define void @prg__foo(%prg* %0) { +define void @prg__foo(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 2, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap index 9e4a0ef654d..3b27a486cd6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,8 +11,8 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap index 5b3533a6411..a6e671334e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,8 +11,8 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap index 9e4a0ef654d..3b27a486cd6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,8 +11,8 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap index 9e4a0ef654d..3b27a486cd6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,8 +11,8 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap index 68e5d47ca1b..d41174d7ba3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %tmpVar = getelementptr inbounds [4 x i32], [4 x i32]* %x, i32 0, i32 1 - store i32 3, i32* %tmpVar, align 4 - %tmpVar1 = getelementptr inbounds [4 x i32], [4 x i32]* %x, i32 0, i32 2 - %tmpVar2 = getelementptr inbounds [4 x i32], [4 x i32]* %x, i32 0, i32 3 - %load_tmpVar = load i32, i32* %tmpVar2, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %tmpVar = getelementptr inbounds [4 x i32], ptr %x, i32 0, i32 1 + store i32 3, ptr %tmpVar, align 4 + %tmpVar1 = getelementptr inbounds [4 x i32], ptr %x, i32 0, i32 2 + %tmpVar2 = getelementptr inbounds [4 x i32], ptr %x, i32 0, i32 3 + %load_tmpVar = load i32, ptr %tmpVar2, align 4 %tmpVar3 = add i32 %load_tmpVar, 3 - store i32 %tmpVar3, i32* %tmpVar1, align 4 + store i32 %tmpVar3, ptr %tmpVar1, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap index 016d218b00f..329cd3f7e53 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %tmpVar = getelementptr inbounds [6 x i32], [6 x i32]* %x, i32 0, i32 1 - store i32 3, i32* %tmpVar, align 4 - %tmpVar1 = getelementptr inbounds [6 x i32], [6 x i32]* %x, i32 0, i32 4 - %tmpVar2 = getelementptr inbounds [6 x i32], [6 x i32]* %x, i32 0, i32 5 - %load_tmpVar = load i32, i32* %tmpVar2, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %tmpVar = getelementptr inbounds [6 x i32], ptr %x, i32 0, i32 1 + store i32 3, ptr %tmpVar, align 4 + %tmpVar1 = getelementptr inbounds [6 x i32], ptr %x, i32 0, i32 4 + %tmpVar2 = getelementptr inbounds [6 x i32], ptr %x, i32 0, i32 5 + %load_tmpVar = load i32, ptr %tmpVar2, align 4 %tmpVar3 = add i32 %load_tmpVar, 3 - store i32 %tmpVar3, i32* %tmpVar1, align 4 + store i32 %tmpVar3, ptr %tmpVar1, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap index aa1a2db3869..1878e41ca5c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %tmpVar = getelementptr inbounds [3 x i32], [3 x i32]* %x, i32 0, i32 0 - store i32 3, i32* %tmpVar, align 4 - %tmpVar1 = getelementptr inbounds [3 x i32], [3 x i32]* %x, i32 0, i32 1 - %tmpVar2 = getelementptr inbounds [3 x i32], [3 x i32]* %x, i32 0, i32 2 - %load_tmpVar = load i32, i32* %tmpVar2, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %tmpVar = getelementptr inbounds [3 x i32], ptr %x, i32 0, i32 0 + store i32 3, ptr %tmpVar, align 4 + %tmpVar1 = getelementptr inbounds [3 x i32], ptr %x, i32 0, i32 1 + %tmpVar2 = getelementptr inbounds [3 x i32], ptr %x, i32 0, i32 2 + %load_tmpVar = load i32, ptr %tmpVar2, align 4 %tmpVar3 = add i32 %load_tmpVar, 3 - store i32 %tmpVar3, i32* %tmpVar1, align 4 + store i32 %tmpVar3, ptr %tmpVar1, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap index 3a40df76ba3..5daf39db9d8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,8 +16,8 @@ target triple = "[filtered]" @__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer @__mainProg.var_str1__init = unnamed_addr constant [5 x %STRUCT1] [%STRUCT1 { i16 1, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 { i16 2, [5 x %STRUCT2] [%STRUCT2 { i8 1, i32 256 }, %STRUCT2 { i8 0, i32 2048 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] }, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer, %STRUCT1 zeroinitializer] -define void @mainProg(%mainProg* %0) { +define void @mainProg(ptr %0) { entry: - %var_str1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 + %var_str1 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap index 3d010cae44f..dbdb8398881 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,8 +16,8 @@ target triple = "[filtered]" @__STRUCT2__init = unnamed_addr constant %STRUCT2 zeroinitializer @__mainProg.var_str1__init = unnamed_addr constant %STRUCT1 { i16 10, [11 x %STRUCT2] [%STRUCT2 { i8 1, i32 128 }, %STRUCT2 { i8 0, i32 1024 }, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer, %STRUCT2 zeroinitializer] } -define void @mainProg(%mainProg* %0) { +define void @mainProg(ptr %0) { entry: - %var_str1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 + %var_str1 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap index c3a2b2845fa..dbccff09590 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_constant_expressions_in_case_selectors.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -18,11 +17,11 @@ entry: %input = alloca i32, align 4 %horiz = alloca i32, align 4 %depth = alloca i32, align 4 - store i32 0, i32* %input, align 4 - store i32 0, i32* %horiz, align 4 - store i32 0, i32* %depth, align 4 - store i32 0, i32* %drive, align 4 - %load_input = load i32, i32* %input, align 4 + store i32 0, ptr %input, align 4 + store i32 0, ptr %horiz, align 4 + store i32 0, ptr %depth, align 4 + store i32 0, ptr %drive, align 4 + %load_input = load i32, ptr %input, align 4 switch i32 %load_input, label %else [ i32 7, label %case i32 14, label %case1 @@ -31,33 +30,33 @@ entry: ] case: ; preds = %entry - %load_horiz = load i32, i32* %horiz, align 4 + %load_horiz = load i32, ptr %horiz, align 4 %tmpVar = add i32 %load_horiz, 1 - store i32 %tmpVar, i32* %horiz, align 4 + store i32 %tmpVar, ptr %horiz, align 4 br label %continue case1: ; preds = %entry - %load_horiz2 = load i32, i32* %horiz, align 4 + %load_horiz2 = load i32, ptr %horiz, align 4 %tmpVar3 = add i32 %load_horiz2, 2 - store i32 %tmpVar3, i32* %horiz, align 4 + store i32 %tmpVar3, ptr %horiz, align 4 br label %continue case4: ; preds = %entry - %load_depth = load i32, i32* %depth, align 4 + %load_depth = load i32, ptr %depth, align 4 %tmpVar5 = sub i32 %load_depth, 1 - store i32 %tmpVar5, i32* %depth, align 4 + store i32 %tmpVar5, ptr %depth, align 4 br label %continue case6: ; preds = %entry - %load_depth7 = load i32, i32* %depth, align 4 + %load_depth7 = load i32, ptr %depth, align 4 %tmpVar8 = add i32 %load_depth7, 1 - store i32 %tmpVar8, i32* %depth, align 4 + store i32 %tmpVar8, ptr %depth, align 4 br label %continue else: ; preds = %entry br label %continue continue: ; preds = %else, %case6, %case4, %case1, %case - %drive_ret = load i32, i32* %drive, align 4 + %drive_ret = load i32, ptr %drive, align 4 ret i32 %drive_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap index a44fd34479f..fa89e04d4d3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_enum_expressions_in_case_selectors.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -19,11 +18,11 @@ entry: %input = alloca i32, align 4 %horiz = alloca i32, align 4 %depth = alloca i32, align 4 - store i32 0, i32* %input, align 4 - store i32 0, i32* %horiz, align 4 - store i32 0, i32* %depth, align 4 - store i32 0, i32* %drive, align 4 - %load_input = load i32, i32* %input, align 4 + store i32 0, ptr %input, align 4 + store i32 0, ptr %horiz, align 4 + store i32 0, ptr %depth, align 4 + store i32 0, ptr %drive, align 4 + %load_input = load i32, ptr %input, align 4 switch i32 %load_input, label %else [ i32 7, label %case i32 14, label %case1 @@ -32,33 +31,33 @@ entry: ] case: ; preds = %entry - %load_horiz = load i32, i32* %horiz, align 4 + %load_horiz = load i32, ptr %horiz, align 4 %tmpVar = add i32 %load_horiz, 1 - store i32 %tmpVar, i32* %horiz, align 4 + store i32 %tmpVar, ptr %horiz, align 4 br label %continue case1: ; preds = %entry - %load_horiz2 = load i32, i32* %horiz, align 4 + %load_horiz2 = load i32, ptr %horiz, align 4 %tmpVar3 = add i32 %load_horiz2, 2 - store i32 %tmpVar3, i32* %horiz, align 4 + store i32 %tmpVar3, ptr %horiz, align 4 br label %continue case4: ; preds = %entry - %load_depth = load i32, i32* %depth, align 4 + %load_depth = load i32, ptr %depth, align 4 %tmpVar5 = sub i32 %load_depth, 1 - store i32 %tmpVar5, i32* %depth, align 4 + store i32 %tmpVar5, ptr %depth, align 4 br label %continue case6: ; preds = %entry - %load_depth7 = load i32, i32* %depth, align 4 + %load_depth7 = load i32, ptr %depth, align 4 %tmpVar8 = add i32 %load_depth7, 1 - store i32 %tmpVar8, i32* %depth, align 4 + store i32 %tmpVar8, ptr %depth, align 4 br label %continue else: ; preds = %entry br label %continue continue: ; preds = %else, %case6, %case4, %case1, %case - %drive_ret = load i32, i32* %drive, align 4 + %drive_ret = load i32, ptr %drive, align 4 ret i32 %drive_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap index c9f4edd47f5..51cd3204664 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 switch i32 %load_x, label %else [ i32 1, label %case i32 2, label %case @@ -25,15 +24,15 @@ entry: ] case: ; preds = %entry, %entry - store i32 1, i32* %y, align 4 + store i32 1, ptr %y, align 4 br label %continue case1: ; preds = %entry, %entry - store i32 2, i32* %y, align 4 + store i32 2, ptr %y, align 4 br label %continue else: ; preds = %entry - store i32 -1, i32* %y, align 4 + store i32 -1, ptr %y, align 4 br label %continue continue: ; preds = %else, %case1, %case diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap index f9e3ecae343..f6737fc5532 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,25 +11,25 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 switch i32 %load_x, label %else [ ] case: ; preds = %range_then - store i32 2, i32* %y, align 4 + store i32 2, ptr %y, align 4 br label %continue else: ; preds = %entry - %load_x1 = load i32, i32* %x, align 4 + %load_x1 = load i32, ptr %x, align 4 %tmpVar = icmp sge i32 %load_x1, 2 br i1 %tmpVar, label %range_then, label %range_else range_then: ; preds = %else - %load_x2 = load i32, i32* %x, align 4 + %load_x2 = load i32, ptr %x, align 4 %tmpVar3 = icmp sle i32 %load_x2, 3 br i1 %tmpVar3, label %case, label %range_else diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap index ddda0d7b319..dae2d0395ec 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i8 1, i8* %z, align 1 - store i8 0, i8* %z, align 1 - store i8 1, i8* %z, align 1 - store i8 0, i8* %z, align 1 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i8 1, ptr %z, align 1 + store i8 0, ptr %z, align 1 + store i8 1, ptr %z, align 1 + store i8 0, ptr %z, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap index 1925655b163..38e07f55717 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,14 +11,14 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 %tmpVar = add i32 %1, 7 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %z, align 2 + store i16 %2, ptr %z, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap index 895a6806b35..4c49e144e0f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,14 +11,14 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 %tmpVar = add i32 %1, 13 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %z, align 2 + store i16 %2, ptr %z, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap index 0cb3affb82d..c498459a751 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,10 +11,10 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 -1, i32* %x, align 4 - store i32 65535, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 -1, ptr %x, align 4 + store i32 65535, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap index 6012a2a7c8b..cb31c1145a0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,14 +11,14 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load float, float* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load float, ptr %x, align 4 %1 = fpext float %load_x to double %tmpVar = fadd double %1, 7.700000e+00 %2 = fptrunc double %tmpVar to float - store float %2, float* %z, align 4 + store float %2, ptr %z, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap index 838eecf906d..9ad8c0a8232 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,13 +11,13 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 %1 = sitofp i16 %load_x to float %tmpVar = fdiv float %1, 7.000000e+00 - store float %tmpVar, float* %z, align 4 + store float %tmpVar, ptr %z, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap index eaad2331741..b236ecd6d7c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap @@ -11,28 +11,28 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 ret void } -define void @MyClass__testMethod(%MyClass* %0, i16 %1) { +define void @MyClass__testMethod(ptr %0, i16 %1) { entry: - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 - store i16 %1, i16* %myMethodArg, align 2 + store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 - store i16 0, i16* %myMethodLocalVar, align 2 - %load_myMethodArg = load i16, i16* %myMethodArg, align 2 - store i16 %load_myMethodArg, i16* %x, align 2 - %load_x = load i16, i16* %x, align 2 - store i16 %load_x, i16* %y, align 2 - %load_myMethodLocalVar = load i16, i16* %myMethodLocalVar, align 2 + store i16 0, ptr %myMethodLocalVar, align 2 + %load_myMethodArg = load i16, ptr %myMethodArg, align 2 + store i16 %load_myMethodArg, ptr %x, align 2 + %load_x = load i16, ptr %x, align 2 + store i16 %load_x, ptr %y, align 2 + %load_myMethodLocalVar = load i16, ptr %myMethodLocalVar, align 2 %2 = sext i16 %load_myMethodLocalVar to i32 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %3 = sext i16 %load_y to i32 %tmpVar = icmp eq i32 %2, %3 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap index cd287725b27..c29ee142191 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap @@ -13,43 +13,43 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer @prg_instance = global %prg zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 ret void } -define void @MyClass__testMethod(%MyClass* %0, i16 %1) { +define void @MyClass__testMethod(ptr %0, i16 %1) { entry: - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 - store i16 %1, i16* %myMethodArg, align 2 + store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 - store i16 0, i16* %myMethodLocalVar, align 2 - %load_myMethodArg = load i16, i16* %myMethodArg, align 2 - store i16 %load_myMethodArg, i16* %x, align 2 - %load_x = load i16, i16* %x, align 2 - store i16 %load_x, i16* %y, align 2 - %load_myMethodLocalVar = load i16, i16* %myMethodLocalVar, align 2 + store i16 0, ptr %myMethodLocalVar, align 2 + %load_myMethodArg = load i16, ptr %myMethodArg, align 2 + store i16 %load_myMethodArg, ptr %x, align 2 + %load_x = load i16, ptr %x, align 2 + store i16 %load_x, ptr %y, align 2 + %load_myMethodLocalVar = load i16, ptr %myMethodLocalVar, align 2 %2 = sext i16 %load_myMethodLocalVar to i32 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %3 = sext i16 %load_y to i32 %tmpVar = icmp eq i32 %2, %3 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x1 = getelementptr inbounds %MyClass, %MyClass* %cl, i32 0, i32 0 - %load_x = load i16, i16* %x1, align 2 - store i16 %load_x, i16* %x, align 2 - %load_x2 = load i16, i16* %x, align 2 - call void @MyClass__testMethod(%MyClass* %cl, i16 %load_x2) - %load_x3 = load i16, i16* %x, align 2 - call void @MyClass__testMethod(%MyClass* %cl, i16 %load_x3) + %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x1 = getelementptr inbounds %MyClass, ptr %cl, i32 0, i32 0 + %load_x = load i16, ptr %x1, align 2 + store i16 %load_x, ptr %x, align 2 + %load_x2 = load i16, ptr %x, align 2 + call void @MyClass__testMethod(ptr %cl, i16 %load_x2) + %load_x3 = load i16, ptr %x, align 2 + call void @MyClass__testMethod(ptr %cl, i16 %load_x3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap index 195ed8a2dba..9fd9f6353ec 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap @@ -1,47 +1,46 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%prg = type { i16, [10 x i16], [10 x i16*], [10 x i16]* } +%prg = type { i16, [10 x i16], [10 x ptr], ptr } @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %X = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %arrX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %arrrX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %rarrX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %tmpVar = getelementptr inbounds [10 x i16], [10 x i16]* %arrX, i32 0, i32 0 - %load_X = load i16, i16* %X, align 2 - store i16 %load_X, i16* %tmpVar, align 2 - %tmpVar1 = getelementptr inbounds [10 x i16*], [10 x i16*]* %arrrX, i32 0, i32 1 - %tmpVar2 = getelementptr inbounds [10 x i16], [10 x i16]* %arrX, i32 0, i32 2 - store i16* %tmpVar2, i16** %tmpVar1, align 8 - store [10 x i16]* %arrX, [10 x i16]** %rarrX, align 8 - %tmpVar3 = getelementptr inbounds [10 x i16*], [10 x i16*]* %arrrX, i32 0, i32 3 - %deref = load i16*, i16** %tmpVar3, align 8 - %load_tmpVar = load i16, i16* %deref, align 2 - store i16 %load_tmpVar, i16* %X, align 2 - %deref4 = load [10 x i16]*, [10 x i16]** %rarrX, align 8 - %tmpVar5 = getelementptr inbounds [10 x i16], [10 x i16]* %deref4, i32 0, i32 4 - %load_tmpVar6 = load i16, i16* %tmpVar5, align 2 - store i16 %load_tmpVar6, i16* %X, align 2 - %tmpVar7 = getelementptr inbounds [10 x i16*], [10 x i16*]* %arrrX, i32 0, i32 5 - %deref8 = load i16*, i16** %tmpVar7, align 8 - %load_X9 = load i16, i16* %X, align 2 - store i16 %load_X9, i16* %deref8, align 2 - %deref10 = load [10 x i16]*, [10 x i16]** %rarrX, align 8 - %tmpVar11 = getelementptr inbounds [10 x i16], [10 x i16]* %deref10, i32 0, i32 6 - %tmpVar12 = getelementptr inbounds [10 x i16*], [10 x i16*]* %arrrX, i32 0, i32 7 - %deref13 = load i16*, i16** %tmpVar12, align 8 - %load_tmpVar14 = load i16, i16* %deref13, align 2 - store i16 %load_tmpVar14, i16* %tmpVar11, align 2 + %X = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %arrX = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %arrrX = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %rarrX = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %tmpVar = getelementptr inbounds [10 x i16], ptr %arrX, i32 0, i32 0 + %load_X = load i16, ptr %X, align 2 + store i16 %load_X, ptr %tmpVar, align 2 + %tmpVar1 = getelementptr inbounds [10 x ptr], ptr %arrrX, i32 0, i32 1 + %tmpVar2 = getelementptr inbounds [10 x i16], ptr %arrX, i32 0, i32 2 + store ptr %tmpVar2, ptr %tmpVar1, align 8 + store ptr %arrX, ptr %rarrX, align 8 + %tmpVar3 = getelementptr inbounds [10 x ptr], ptr %arrrX, i32 0, i32 3 + %deref = load ptr, ptr %tmpVar3, align 8 + %load_tmpVar = load i16, ptr %deref, align 2 + store i16 %load_tmpVar, ptr %X, align 2 + %deref4 = load ptr, ptr %rarrX, align 8 + %tmpVar5 = getelementptr inbounds [10 x i16], ptr %deref4, i32 0, i32 4 + %load_tmpVar6 = load i16, ptr %tmpVar5, align 2 + store i16 %load_tmpVar6, ptr %X, align 2 + %tmpVar7 = getelementptr inbounds [10 x ptr], ptr %arrrX, i32 0, i32 5 + %deref8 = load ptr, ptr %tmpVar7, align 8 + %load_X9 = load i16, ptr %X, align 2 + store i16 %load_X9, ptr %deref8, align 2 + %deref10 = load ptr, ptr %rarrX, align 8 + %tmpVar11 = getelementptr inbounds [10 x i16], ptr %deref10, i32 0, i32 6 + %tmpVar12 = getelementptr inbounds [10 x ptr], ptr %arrrX, i32 0, i32 7 + %deref13 = load ptr, ptr %tmpVar12, align 8 + %load_tmpVar14 = load i16, ptr %deref13, align 2 + store i16 %load_tmpVar14, ptr %tmpVar11, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap index e9258fc8939..d1085a25545 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap @@ -11,12 +11,12 @@ target triple = "[filtered]" @__fbWithConstant__init = unnamed_addr constant %fbWithConstant { i16 0, i16 2 } -define void @fbWithConstant(%fbWithConstant* %0) { +define void @fbWithConstant(ptr %0) { entry: - %this = alloca %fbWithConstant*, align 8 - store %fbWithConstant* %0, %fbWithConstant** %this, align 8 - %x = getelementptr inbounds %fbWithConstant, %fbWithConstant* %0, i32 0, i32 0 - %const = getelementptr inbounds %fbWithConstant, %fbWithConstant* %0, i32 0, i32 1 - store i16 2, i16* %x, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %fbWithConstant, ptr %0, i32 0, i32 0 + %const = getelementptr inbounds %fbWithConstant, ptr %0, i32 0, i32 1 + store i16 2, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap index bbfcd2c2b27..ac2090393ba 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,22 +16,22 @@ define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 - store i16 %0, i16* %value, align 2 + store i16 %0, ptr %value, align 2 %lower = alloca i16, align 2 - store i16 %1, i16* %lower, align 2 + store i16 %1, ptr %lower, align 2 %upper = alloca i16, align 2 - store i16 %2, i16* %upper, align 2 - store i16 0, i16* %CheckRangeSigned, align 2 - %load_value = load i16, i16* %value, align 2 - store i16 %load_value, i16* %CheckRangeSigned, align 2 - %CheckRangeSigned_ret = load i16, i16* %CheckRangeSigned, align 2 + store i16 %2, ptr %upper, align 2 + store i16 0, ptr %CheckRangeSigned, align 2 + %load_value = load i16, ptr %value, align 2 + store i16 %load_value, ptr %CheckRangeSigned, align 2 + %CheckRangeSigned_ret = load i16, ptr %CheckRangeSigned, align 2 ret i16 %CheckRangeSigned_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 5, i16 0, i16 8) - store i16 %call, i16* %x, align 2 + store i16 %call, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap index 05ef5080506..ba0ce8959cb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_propagation_of_struct_fields_on_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,10 +16,10 @@ define i32 @main() { entry: %main = alloca i32, align 4 %local_value = alloca i32, align 4 - store i32 0, i32* %local_value, align 4 - store i32 0, i32* %main, align 4 - %load_value = load i32, i32* getelementptr inbounds (%STRUCT1, %STRUCT1* @MyStruct, i32 0, i32 0), align 4 - store i32 %load_value, i32* %local_value, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 0, ptr %local_value, align 4 + store i32 0, ptr %main, align 4 + %load_value = load i32, ptr @MyStruct, align 4 + store i32 %load_value, ptr %local_value, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap index dd70063f19a..deee127e180 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,44 +11,44 @@ target triple = "[filtered]" @main_instance = global %main { i32 0, i32 60 } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %DAYS_IN_MONTH = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %SIXTY = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %load_DAYS_IN_MONTH = load i32, i32* %DAYS_IN_MONTH, align 4 + %DAYS_IN_MONTH = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %SIXTY = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %load_DAYS_IN_MONTH = load i32, ptr %DAYS_IN_MONTH, align 4 switch i32 %load_DAYS_IN_MONTH, label %else [ ] case: ; preds = %range_then - store i32 29, i32* %DAYS_IN_MONTH, align 4 + store i32 29, ptr %DAYS_IN_MONTH, align 4 br label %continue case4: ; preds = %range_then5 - store i32 30, i32* %DAYS_IN_MONTH, align 4 + store i32 30, ptr %DAYS_IN_MONTH, align 4 br label %continue else: ; preds = %entry - %load_DAYS_IN_MONTH1 = load i32, i32* %DAYS_IN_MONTH, align 4 + %load_DAYS_IN_MONTH1 = load i32, ptr %DAYS_IN_MONTH, align 4 %tmpVar = icmp sge i32 %load_DAYS_IN_MONTH1, 32 br i1 %tmpVar, label %range_then, label %range_else range_then: ; preds = %else - %load_DAYS_IN_MONTH2 = load i32, i32* %DAYS_IN_MONTH, align 4 + %load_DAYS_IN_MONTH2 = load i32, ptr %DAYS_IN_MONTH, align 4 %tmpVar3 = icmp sle i32 %load_DAYS_IN_MONTH2, 60 br i1 %tmpVar3, label %case, label %range_else range_else: ; preds = %range_then, %else - %load_DAYS_IN_MONTH7 = load i32, i32* %DAYS_IN_MONTH, align 4 + %load_DAYS_IN_MONTH7 = load i32, ptr %DAYS_IN_MONTH, align 4 %tmpVar8 = icmp sge i32 %load_DAYS_IN_MONTH7, 62 br i1 %tmpVar8, label %range_then5, label %range_else6 range_then5: ; preds = %range_else - %load_DAYS_IN_MONTH9 = load i32, i32* %DAYS_IN_MONTH, align 4 + %load_DAYS_IN_MONTH9 = load i32, ptr %DAYS_IN_MONTH, align 4 %tmpVar10 = icmp sle i32 %load_DAYS_IN_MONTH9, 70 br i1 %tmpVar10, label %case4, label %range_else6 range_else6: ; preds = %range_then5, %range_else - store i32 31, i32* %DAYS_IN_MONTH, align 4 + store i32 31, ptr %DAYS_IN_MONTH, align 4 br label %continue continue: ; preds = %range_else6, %case4, %case diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap index fc50d9d1cd3..3a9d5d5a230 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_addition_in_var_output.snap @@ -1,28 +1,27 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -define i32 @func(i64* %0, i64* %1) { +define i32 @func(ptr %0, ptr %1) { entry: %func = alloca i32, align 4 - %d_and_t = alloca i64*, align 8 - store i64* %0, i64** %d_and_t, align 8 - %time_var = alloca i64*, align 8 - store i64* %1, i64** %time_var, align 8 - store i32 0, i32* %func, align 4 - %deref = load i64*, i64** %d_and_t, align 8 - %deref1 = load i64*, i64** %d_and_t, align 8 - %load_d_and_t = load i64, i64* %deref1, align 8 - %deref2 = load i64*, i64** %time_var, align 8 - %load_time_var = load i64, i64* %deref2, align 8 + %d_and_t = alloca ptr, align 8 + store ptr %0, ptr %d_and_t, align 8 + %time_var = alloca ptr, align 8 + store ptr %1, ptr %time_var, align 8 + store i32 0, ptr %func, align 4 + %deref = load ptr, ptr %d_and_t, align 8 + %deref1 = load ptr, ptr %d_and_t, align 8 + %load_d_and_t = load i64, ptr %deref1, align 8 + %deref2 = load ptr, ptr %time_var, align 8 + %load_time_var = load i64, ptr %deref2, align 8 %tmpVar = add i64 %load_d_and_t, %load_time_var - store i64 %tmpVar, i64* %deref, align 8 - %func_ret = load i32, i32* %func, align 4 + store i64 %tmpVar, ptr %deref, align 8 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap index 544b86feb71..9487f177f3d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_and_time_global_constants_initialize.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -28,7 +27,7 @@ target triple = "[filtered]" @cLDT_SHORT = unnamed_addr constant i64 172799123000000 @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %t1 = alloca i64, align 8 %t2 = alloca i64, align 8 @@ -46,37 +45,37 @@ entry: %dt2 = alloca i64, align 8 %ldt1 = alloca i64, align 8 %ldt2 = alloca i64, align 8 - store i64 0, i64* %t1, align 8 - store i64 0, i64* %t2, align 8 - store i64 0, i64* %lt1, align 8 - store i64 0, i64* %lt2, align 8 - store i64 0, i64* %d1, align 8 - store i64 0, i64* %d2, align 8 - store i64 0, i64* %ld1, align 8 - store i64 0, i64* %ld2, align 8 - store i64 0, i64* %tod1, align 8 - store i64 0, i64* %tod2, align 8 - store i64 0, i64* %ltod1, align 8 - store i64 0, i64* %ltod2, align 8 - store i64 0, i64* %dt1, align 8 - store i64 0, i64* %dt2, align 8 - store i64 0, i64* %ldt1, align 8 - store i64 0, i64* %ldt2, align 8 - store i64 1000000000, i64* %t1, align 8 - store i64 1000000000, i64* %t2, align 8 - store i64 1000000000000, i64* %lt1, align 8 - store i64 1000000000000, i64* %lt2, align 8 - store i64 0, i64* %d1, align 8 - store i64 161308800000000000, i64* %d2, align 8 - store i64 161308800000000000, i64* %ld1, align 8 - store i64 161308800000000000, i64* %ld2, align 8 - store i64 0, i64* %tod1, align 8 - store i64 0, i64* %tod2, align 8 - store i64 86399999999999, i64* %ltod1, align 8 - store i64 86399999999999, i64* %ltod2, align 8 - store i64 172799000000000, i64* %dt1, align 8 - store i64 172799000000000, i64* %dt2, align 8 - store i64 172799123000000, i64* %ldt1, align 8 - store i64 172799123000000, i64* %ldt2, align 8 + store i64 0, ptr %t1, align 8 + store i64 0, ptr %t2, align 8 + store i64 0, ptr %lt1, align 8 + store i64 0, ptr %lt2, align 8 + store i64 0, ptr %d1, align 8 + store i64 0, ptr %d2, align 8 + store i64 0, ptr %ld1, align 8 + store i64 0, ptr %ld2, align 8 + store i64 0, ptr %tod1, align 8 + store i64 0, ptr %tod2, align 8 + store i64 0, ptr %ltod1, align 8 + store i64 0, ptr %ltod2, align 8 + store i64 0, ptr %dt1, align 8 + store i64 0, ptr %dt2, align 8 + store i64 0, ptr %ldt1, align 8 + store i64 0, ptr %ldt2, align 8 + store i64 1000000000, ptr %t1, align 8 + store i64 1000000000, ptr %t2, align 8 + store i64 1000000000000, ptr %lt1, align 8 + store i64 1000000000000, ptr %lt2, align 8 + store i64 0, ptr %d1, align 8 + store i64 161308800000000000, ptr %d2, align 8 + store i64 161308800000000000, ptr %ld1, align 8 + store i64 161308800000000000, ptr %ld2, align 8 + store i64 0, ptr %tod1, align 8 + store i64 0, ptr %tod2, align 8 + store i64 86399999999999, ptr %ltod1, align 8 + store i64 86399999999999, ptr %ltod2, align 8 + store i64 172799000000000, ptr %dt1, align 8 + store i64 172799000000000, ptr %dt2, align 8 + store i64 172799123000000, ptr %ldt1, align 8 + store i64 172799123000000, ptr %ldt2, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap index c6eae872411..8861eebc1fb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,19 +11,19 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %d = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %load_a = load i64, i64* %a, align 8 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %d = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %load_a = load i64, ptr %a, align 8 %tmpVar = icmp sgt i64 %load_a, 1619827200000000000 - %load_b = load i64, i64* %b, align 8 + %load_b = load i64, ptr %b, align 8 %tmpVar1 = icmp sgt i64 %load_b, 1619897357000000000 - %load_c = load i64, i64* %c, align 8 + %load_c = load i64, ptr %c, align 8 %tmpVar2 = icmp sgt i64 %load_c, 156557000000000 - %load_d = load i64, i64* %d, align 8 + %load_d = load i64, ptr %d, align 8 %tmpVar3 = icmp sgt i64 %load_d, 70157000000000 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap index 664deeea1c7..88494b8f2f6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,19 +12,18 @@ entry: %func = alloca i16, align 2 %int_var = alloca i16, align 2 %arr_var = alloca [3 x i32], align 4 - %ptr_var = alloca i32*, align 8 + %ptr_var = alloca ptr, align 8 %float_var = alloca float, align 4 - store i16 0, i16* %int_var, align 2 - %0 = bitcast [3 x i32]* %arr_var to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([3 x i32]* getelementptr ([3 x i32], [3 x i32]* null, i32 1) to i64), i1 false) - store i32* null, i32** %ptr_var, align 8 - store float 0.000000e+00, float* %float_var, align 4 - store i16 0, i16* %func, align 2 - %func_ret = load i16, i16* %func, align 2 + store i16 0, ptr %int_var, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %arr_var, i8 0, i64 ptrtoint (ptr getelementptr ([3 x i32], ptr null, i32 1) to i64), i1 false) + store ptr null, ptr %ptr_var, align 8 + store float 0.000000e+00, ptr %float_var, align 4 + store i16 0, ptr %func, align 2 + %func_ret = load i16, ptr %func, align 2 ret i16 %func_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap index f842b3ba5f6..4b0a78b0bd7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,10 +11,10 @@ target triple = "[filtered]" @prg_instance = global %prg { i16 0, i16 1, i32 2 } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %zz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %zz = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap index 80b8915ddcb..cf6217219cd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_function_with_name_generates_int_function.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,7 +10,7 @@ target triple = "[filtered]" define i16 @foo() { entry: %foo = alloca i16, align 2 - store i16 0, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + store i16 0, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap index ff7f91f2daf..0fc5e59b1e7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_global_variable_list_generates_nothing.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,7 +11,7 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap index 5a1acf1006e..4ff4f5a8aa4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_program_with_name_generates_void_function.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,7 +11,7 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap index c581c13ce15..f3386184676 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 - %load_y = load i32, i32* %y, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 + %load_y = load i32, ptr %y, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap index c1b5088c34e..2b4e4aa1da8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,11 +14,11 @@ target triple = "[filtered]" @MyEnum.yellow = unnamed_addr constant i32 1 @MyEnum.green = unnamed_addr constant i32 2 -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %color = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - store i32 0, i32* %color, align 4 - store i32 1, i32* %color, align 4 - store i32 2, i32* %color, align 4 + %color = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + store i32 0, ptr %color, align 4 + store i32 1, ptr %color, align 4 + store i32 2, ptr %color, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap index 5ad32fb833f..4a280575fc6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,8 +15,8 @@ target triple = "[filtered]" @TrafficLight.Yellow = unnamed_addr constant i32 2 @TrafficLight.Green = unnamed_addr constant i32 3 -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %tf1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %tf1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap index efdb31739fe..94e39c2f984 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_function_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,7 +13,7 @@ target triple = "[filtered]" declare i32 @foo() -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: %call = call i32 @foo() ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap index 378ebf7addd..9bd4f7f23ef 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_global_variable_generates_as_external.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,7 +13,7 @@ target triple = "[filtered]" @gY = external global i8 @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap index b9db48f6b59..54258b062e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__external_program_global_var_is_external.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,4 +11,4 @@ target triple = "[filtered]" @prg_instance = external global %prg -declare void @prg(%prg*) +declare void @prg(ptr) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap index bf0cfafb7ec..1a24db60449 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap @@ -11,46 +11,46 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 - %call = call i16 @MyClass__testMethod(%MyClass* %0, i16 1) - %call1 = call i16 @MyClass__testMethod(%MyClass* %0, i16 3) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %call = call i16 @MyClass__testMethod(ptr %0, i16 1) + %call1 = call i16 @MyClass__testMethod(ptr %0, i16 3) ret void } -define i16 @MyClass__testMethod(%MyClass* %0, i16 %1) { +define i16 @MyClass__testMethod(ptr %0, i16 %1) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 %MyClass.testMethod = alloca i16, align 2 %myMethodArg = alloca i16, align 2 - store i16 %1, i16* %myMethodArg, align 2 + store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 - store i16 0, i16* %myMethodLocalVar, align 2 - store i16 0, i16* %MyClass.testMethod, align 2 - %load_myMethodArg = load i16, i16* %myMethodArg, align 2 - store i16 %load_myMethodArg, i16* %x, align 2 - %load_x = load i16, i16* %x, align 2 + store i16 0, ptr %myMethodLocalVar, align 2 + store i16 0, ptr %MyClass.testMethod, align 2 + %load_myMethodArg = load i16, ptr %myMethodArg, align 2 + store i16 %load_myMethodArg, ptr %x, align 2 + %load_x = load i16, ptr %x, align 2 %2 = sext i16 %load_x to i32 %tmpVar = add i32 %2, 1 %3 = trunc i32 %tmpVar to i16 - store i16 %3, i16* %y, align 2 - %load_y = load i16, i16* %y, align 2 + store i16 %3, ptr %y, align 2 + %load_y = load i16, ptr %y, align 2 %4 = sext i16 %load_y to i32 %tmpVar1 = add i32 %4, 1 %5 = trunc i32 %tmpVar1 to i16 - store i16 %5, i16* %myMethodLocalVar, align 2 - %load_myMethodLocalVar = load i16, i16* %myMethodLocalVar, align 2 + store i16 %5, ptr %myMethodLocalVar, align 2 + %load_myMethodLocalVar = load i16, ptr %myMethodLocalVar, align 2 %6 = sext i16 %load_myMethodLocalVar to i32 %tmpVar2 = add i32 %6, 1 %7 = trunc i32 %tmpVar2 to i16 - store i16 %7, i16* %MyClass.testMethod, align 2 - %MyClass__testMethod_ret = load i16, i16* %MyClass.testMethod, align 2 + store i16 %7, ptr %MyClass.testMethod, align 2 + %MyClass__testMethod_ret = load i16, ptr %MyClass.testMethod, align 2 ret i16 %MyClass__testMethod_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap index b70e98ff1e0..791c230ab74 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap @@ -13,47 +13,47 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer @prg_instance = global %prg zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 ret void } -define void @MyClass__testMethod(%MyClass* %0, i16 %1) { +define void @MyClass__testMethod(ptr %0, i16 %1) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 - store i16 %1, i16* %myMethodArg, align 2 + store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 - store i16 0, i16* %myMethodLocalVar, align 2 - %load_myMethodArg = load i16, i16* %myMethodArg, align 2 - store i16 %load_myMethodArg, i16* %x, align 2 - %load_x = load i16, i16* %x, align 2 - store i16 %load_x, i16* %y, align 2 - %load_myMethodLocalVar = load i16, i16* %myMethodLocalVar, align 2 + store i16 0, ptr %myMethodLocalVar, align 2 + %load_myMethodArg = load i16, ptr %myMethodArg, align 2 + store i16 %load_myMethodArg, ptr %x, align 2 + %load_x = load i16, ptr %x, align 2 + store i16 %load_x, ptr %y, align 2 + %load_myMethodLocalVar = load i16, ptr %myMethodLocalVar, align 2 %2 = sext i16 %load_myMethodLocalVar to i32 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %3 = sext i16 %load_y to i32 %tmpVar = icmp eq i32 %2, %3 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x1 = getelementptr inbounds %MyClass, %MyClass* %cl, i32 0, i32 0 - %load_x = load i16, i16* %x1, align 2 - store i16 %load_x, i16* %x, align 2 - %load_x2 = load i16, i16* %x, align 2 - call void @MyClass__testMethod(%MyClass* %cl, i16 %load_x2) - %load_x3 = load i16, i16* %x, align 2 - call void @MyClass__testMethod(%MyClass* %cl, i16 %load_x3) + %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x1 = getelementptr inbounds %MyClass, ptr %cl, i32 0, i32 0 + %load_x = load i16, ptr %x1, align 2 + store i16 %load_x, ptr %x, align 2 + %load_x2 = load i16, ptr %x, align 2 + call void @MyClass__testMethod(ptr %cl, i16 %load_x2) + %load_x3 = load i16, ptr %x, align 2 + call void @MyClass__testMethod(ptr %cl, i16 %load_x3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap index fd8a47323ce..05462ad5e75 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap @@ -13,33 +13,33 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer @prg_instance = global %prg zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 ret void } -define void @MyClass__testMethod(%MyClass* %0, i16* %1) { +define void @MyClass__testMethod(ptr %0, ptr %1) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 - %myMethodArg = alloca i16*, align 8 - store i16* %1, i16** %myMethodArg, align 8 - %deref = load i16*, i16** %myMethodArg, align 8 - %load_x = load i16, i16* %x, align 2 - store i16 %load_x, i16* %deref, align 2 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %myMethodArg = alloca ptr, align 8 + store ptr %1, ptr %myMethodArg, align 8 + %deref = load ptr, ptr %myMethodArg, align 8 + %load_x = load i16, ptr %x, align 2 + store i16 %load_x, ptr %deref, align 2 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - call void @MyClass__testMethod(%MyClass* %cl, i16* %x) + %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @MyClass__testMethod(ptr %cl, ptr %x) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap index 311ec5917e8..f0193d8336a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap @@ -13,31 +13,31 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer @prg_instance = global %prg zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 ret void } -define void @MyClass__testMethod(%MyClass* %0, i16 %1) { +define void @MyClass__testMethod(ptr %0, i16 %1) { entry: - %this = alloca %MyClass*, align 8 - store %MyClass* %0, %MyClass** %this, align 8 - %x = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, %MyClass* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 - store i16 %1, i16* %myMethodArg, align 2 - %load_myMethodArg = load i16, i16* %myMethodArg, align 2 - store i16 %load_myMethodArg, i16* %x, align 2 + store i16 %1, ptr %myMethodArg, align 2 + %load_myMethodArg = load i16, ptr %myMethodArg, align 2 + store i16 %load_myMethodArg, ptr %x, align 2 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - call void @MyClass__testMethod(%MyClass* %cl, i16 3) + %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + call void @MyClass__testMethod(ptr %cl, i16 3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap index 02d4fca4109..328eb68c31b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,19 +11,19 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 3, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i32, i32* %x, align 4 + %1 = load i32, ptr %x, align 4 %condition = icmp sle i32 %1, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %2 = load i32, i32* %x, align 4 + %2 = load i32, ptr %x, align 4 %condition1 = icmp sge i32 %2, 10 br i1 %condition1, label %loop, label %continue @@ -32,12 +31,12 @@ loop: ; preds = %predicate_sge, %pre br label %increment increment: ; preds = %loop - %3 = load i32, i32* %x, align 4 + %3 = load i32, ptr %x, align 4 %next = add i32 1, %3 - store i32 %next, i32* %x, align 4 + store i32 %next, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap index ca6110a60bb..6fdc379f7c4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,34 +11,34 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i16 3, i16* %x, align 2 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i16 3, ptr %x, align 2 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i16, i16* %x, align 2 + %1 = load i16, ptr %x, align 2 %2 = sext i16 %1 to i32 %condition = icmp sle i32 %2, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %3 = load i16, i16* %x, align 2 + %3 = load i16, ptr %x, align 2 %4 = sext i16 %3 to i32 %condition1 = icmp sge i32 %4, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i16, i16* %x, align 2 + %load_x = load i16, ptr %x, align 2 br label %increment increment: ; preds = %loop - %5 = load i16, i16* %x, align 2 + %5 = load i16, ptr %x, align 2 %6 = sext i16 %5 to i32 %next = add i32 1, %6 %7 = trunc i32 %next to i16 - store i16 %7, i16* %x, align 2 + store i16 %7, ptr %x, align 2 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap index de600044ea3..4dd3d7b90ef 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,30 +11,30 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i64 3, i64* %x, align 8 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i64 3, ptr %x, align 8 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i64, i64* %x, align 8 + %1 = load i64, ptr %x, align 8 %condition = icmp sle i64 %1, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %2 = load i64, i64* %x, align 8 + %2 = load i64, ptr %x, align 8 %condition1 = icmp sge i64 %2, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i64, i64* %x, align 8 + %load_x = load i64, ptr %x, align 8 br label %increment increment: ; preds = %loop - %3 = load i64, i64* %x, align 8 + %3 = load i64, ptr %x, align 8 %next = add i64 1, %3 - store i64 %next, i64* %x, align 8 + store i64 %next, ptr %x, align 8 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap index e8486f762be..fd7ce7882a3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,34 +11,34 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i8 3, i8* %x, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i8 3, ptr %x, align 1 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i8, i8* %x, align 1 + %1 = load i8, ptr %x, align 1 %2 = sext i8 %1 to i32 %condition = icmp sle i32 %2, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %3 = load i8, i8* %x, align 1 + %3 = load i8, ptr %x, align 1 %4 = sext i8 %3 to i32 %condition1 = icmp sge i32 %4, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i8, i8* %x, align 1 + %load_x = load i8, ptr %x, align 1 br label %increment increment: ; preds = %loop - %5 = load i8, i8* %x, align 1 + %5 = load i8, ptr %x, align 1 %6 = sext i8 %5 to i32 %next = add i32 1, %6 %7 = trunc i32 %next to i8 - store i8 %7, i8* %x, align 1 + store i8 %7, ptr %x, align 1 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap index b3e93af44d0..a13430a13b8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,38 +11,38 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 3, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i32, i32* %x, align 4 + %1 = load i32, ptr %x, align 4 %condition = icmp sle i32 %1, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %2 = load i32, i32* %x, align 4 + %2 = load i32, ptr %x, align 4 %condition1 = icmp sge i32 %2, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 1 - store i32 %tmpVar, i32* %x, align 4 + store i32 %tmpVar, ptr %x, align 4 br label %increment buffer_block: ; No predecessors! - %load_x2 = load i32, i32* %x, align 4 + %load_x2 = load i32, ptr %x, align 4 %tmpVar3 = sub i32 %load_x2, 1 - store i32 %tmpVar3, i32* %x, align 4 + store i32 %tmpVar3, ptr %x, align 4 br label %increment increment: ; preds = %buffer_block, %loop - %3 = load i32, i32* %x, align 4 + %3 = load i32, ptr %x, align 4 %next = add i32 7, %3 - store i32 %next, i32* %x, align 4 + store i32 %next, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap index f5006ef21d5..bf9642578ee 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,38 +11,38 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 3, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i32, i32* %x, align 4 + %1 = load i32, ptr %x, align 4 %condition = icmp sle i32 %1, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %2 = load i32, i32* %x, align 4 + %2 = load i32, ptr %x, align 4 %condition1 = icmp sge i32 %2, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 2 - store i32 %tmpVar, i32* %x, align 4 + store i32 %tmpVar, ptr %x, align 4 br label %continue buffer_block: ; No predecessors! - %load_x2 = load i32, i32* %x, align 4 + %load_x2 = load i32, ptr %x, align 4 %tmpVar3 = add i32 %load_x2, 5 - store i32 %tmpVar3, i32* %x, align 4 + store i32 %tmpVar3, ptr %x, align 4 br label %increment increment: ; preds = %buffer_block - %3 = load i32, i32* %x, align 4 + %3 = load i32, ptr %x, align 4 %next = add i32 7, %3 - store i32 %next, i32* %x, align 4 + store i32 %next, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %loop, %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap index e06586770b6..130582b4cd6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,39 +11,39 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %step = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %load_y = load i32, i32* %y, align 4 - store i32 %load_y, i32* %x, align 4 - %load_step = load i32, i32* %step, align 4 + %step = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %load_y = load i32, ptr %y, align 4 + store i32 %load_y, ptr %x, align 4 + %load_step = load i32, ptr %step, align 4 %is_incrementing = icmp sgt i32 %load_step, 0 br i1 %is_incrementing, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i32, i32* %z, align 4 - %2 = load i32, i32* %x, align 4 + %1 = load i32, ptr %z, align 4 + %2 = load i32, ptr %x, align 4 %condition = icmp sle i32 %2, %1 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %3 = load i32, i32* %z, align 4 - %4 = load i32, i32* %x, align 4 + %3 = load i32, ptr %z, align 4 + %4 = load i32, ptr %x, align 4 %condition1 = icmp sge i32 %4, %3 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 br label %increment increment: ; preds = %loop - %5 = load i32, i32* %x, align 4 - %load_step2 = load i32, i32* %step, align 4 + %5 = load i32, ptr %x, align 4 + %load_step2 = load i32, ptr %step, align 4 %next = add i32 %load_step2, %5 - store i32 %next, i32* %x, align 4 + store i32 %next, ptr %x, align 4 br i1 %is_incrementing, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap index 9e0bbb8727d..f9cd155409b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,30 +11,30 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 3, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i32, i32* %x, align 4 + %1 = load i32, ptr %x, align 4 %condition = icmp sle i32 %1, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %2 = load i32, i32* %x, align 4 + %2 = load i32, ptr %x, align 4 %condition1 = icmp sge i32 %2, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 br label %increment increment: ; preds = %loop - %3 = load i32, i32* %x, align 4 + %3 = load i32, ptr %x, align 4 %next = add i32 7, %3 - store i32 %next, i32* %x, align 4 + store i32 %next, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap index 24453db05ed..f109ea0eb32 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,30 +11,30 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 3, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge predicate_sle: ; preds = %increment, %entry - %1 = load i32, i32* %x, align 4 + %1 = load i32, ptr %x, align 4 %condition = icmp sle i32 %1, 10 br i1 %condition, label %loop, label %continue predicate_sge: ; preds = %increment, %entry - %2 = load i32, i32* %x, align 4 + %2 = load i32, ptr %x, align 4 %condition1 = icmp sge i32 %2, 10 br i1 %condition1, label %loop, label %continue loop: ; preds = %predicate_sge, %predicate_sle - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 br label %increment increment: ; preds = %loop - %3 = load i32, i32* %x, align 4 + %3 = load i32, ptr %x, align 4 %next = add i32 1, %3 - store i32 %next, i32* %x, align 4 + store i32 %next, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge continue: ; preds = %predicate_sge, %predicate_sle diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap index a3135862470..c2c787e4b0d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap @@ -13,18 +13,18 @@ target triple = "[filtered]" @__foo__init = unnamed_addr constant %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %fb_inst = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - call void @foo(%foo* %fb_inst) + %fb_inst = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + call void @foo(ptr %fb_inst) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap index 711bb6736cb..4bf6a0458d1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap @@ -15,25 +15,25 @@ target triple = "[filtered]" @__bar__init = unnamed_addr constant %bar zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %bar_inst = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %bar_inst = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } -define void @bar(%bar* %0) { +define void @bar(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %foo_inst = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %bar_inst = getelementptr inbounds %foo, %foo* %foo_inst, i32 0, i32 0 - call void @bar(%bar* %bar_inst) + %foo_inst = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %bar_inst = getelementptr inbounds %foo, ptr %foo_inst, i32 0, i32 0 + call void @bar(ptr %bar_inst) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap index ab98c69be38..e419a56c47b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_call_with_same_name_as_return_type.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,12 +14,12 @@ target triple = "[filtered]" define i64 @TIME() { entry: %TIME = alloca i64, align 8 - store i64 0, i64* %TIME, align 8 - %TIME_ret = load i64, i64* %TIME, align 8 + store i64 0, ptr %TIME, align 8 + %TIME_ret = load i64, ptr %TIME, align 8 ret i64 %TIME_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: %call = call i64 @TIME() ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap index c6ace5627b6..b3593a280fc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,16 +14,16 @@ target triple = "[filtered]" define i32 @foo() { entry: %foo = alloca i32, align 4 - store i32 0, i32* %foo, align 4 - store i32 1, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 0, ptr %foo, align 4 + store i32 1, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo() - store i32 %call, i32* %x, align 4 + store i32 %call, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap index 0c879f6608c..88dfecdc10c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,16 +14,16 @@ target triple = "[filtered]" define i32 @foo() { entry: %foo = alloca i32, align 4 - store i32 0, i32* %foo, align 4 - store i32 1, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 0, ptr %foo, align 4 + store i32 1, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %froo = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %froo = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo() - store i32 %call, i32* %froo, align 4 + store i32 %call, ptr %froo, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap index 1fe2820215b..3742adbab4a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_temp_var_initialization.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,24 +15,24 @@ define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %in1 = alloca i32, align 4 - store i32 %0, i32* %in1, align 4 + store i32 %0, ptr %in1, align 4 %x = alloca i16, align 2 %y = alloca i16, align 2 %z = alloca i16, align 2 - store i16 7, i16* %x, align 2 - store i16 0, i16* %y, align 2 - store i16 9, i16* %z, align 2 - store i32 0, i32* %foo, align 4 - %load_z = load i16, i16* %z, align 2 + store i16 7, ptr %x, align 2 + store i16 0, ptr %y, align 2 + store i16 9, ptr %z, align 2 + store i32 0, ptr %foo, align 4 + %load_z = load i16, ptr %z, align 2 %1 = sext i16 %load_z to i32 %tmpVar = add i32 %1, 1 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %y, align 2 - %foo_ret = load i32, i32* %foo, align 4 + store i16 %2, ptr %y, align 2 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: %call = call i32 @foo(i32 5) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap index 1ebb89bcb30..544feca54b5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_local_var_initialization_and_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,20 +15,20 @@ define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %in1 = alloca i32, align 4 - store i32 %0, i32* %in1, align 4 + store i32 %0, ptr %in1, align 4 %x = alloca i16, align 2 %y = alloca i16, align 2 %z = alloca i16, align 2 - store i16 7, i16* %x, align 2 - store i16 0, i16* %y, align 2 - store i16 9, i16* %z, align 2 - store i32 0, i32* %foo, align 4 - store i32 1, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i16 7, ptr %x, align 2 + store i16 0, ptr %y, align 2 + store i16 9, ptr %z, align 2 + store i32 0, ptr %foo, align 4 + store i32 1, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: %call = call i32 @foo(i32 5) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap index d007ed4a0c6..bcb11520156 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,17 +15,17 @@ define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %bar = alloca i32, align 4 - store i32 %0, i32* %bar, align 4 - store i32 0, i32* %foo, align 4 - store i32 1, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %bar, align 4 + store i32 0, ptr %foo, align 4 + store i32 1, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo(i32 2) - store i32 %call, i32* %x, align 4 + store i32 %call, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap index 74bf8ecf889..25a8c23e288 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,19 +15,19 @@ define i32 @foo(i32 %0, i8 %1) { entry: %foo = alloca i32, align 4 %bar = alloca i32, align 4 - store i32 %0, i32* %bar, align 4 + store i32 %0, ptr %bar, align 4 %buz = alloca i8, align 1 - store i8 %1, i8* %buz, align 1 - store i32 0, i32* %foo, align 4 - store i32 1, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i8 %1, ptr %buz, align 1 + store i32 0, ptr %foo, align 4 + store i32 1, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo(i32 2, i8 1) - store i32 %call, i32* %x, align 4 + store i32 %call, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap index b7547e46e38..61c40a6ca53 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: function -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,11 +12,11 @@ target triple = "[filtered]" @gX = global i16 0 @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i16 20, i16* @gX, align 2 - %load_gX = load i16, i16* @gX, align 2 - store i16 %load_gX, i16* %x, align 2 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i16 20, ptr @gX, align 2 + %load_gX = load i16, ptr @gX, align 2 + store i16 %load_gX, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap index 2e5bf6202a3..ed5d5fa87d2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,43 +11,43 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %u = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %b1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 4 - %b2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 5 - %b3 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 6 - %load_b1 = load i8, i8* %b1, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %u = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %b1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 4 + %b2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 5 + %b3 = getelementptr inbounds %prg, ptr %0, i32 0, i32 6 + %load_b1 = load i8, ptr %b1, align 1 %1 = icmp ne i8 %load_b1, 0 br i1 %1, label %condition_body, label %branch condition_body: ; preds = %entry - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 br label %continue branch: ; preds = %entry - %load_b2 = load i8, i8* %b2, align 1 + %load_b2 = load i8, ptr %b2, align 1 %2 = icmp ne i8 %load_b2, 0 br i1 %2, label %condition_body2, label %branch1 condition_body2: ; preds = %branch - %load_y = load i32, i32* %y, align 4 + %load_y = load i32, ptr %y, align 4 br label %continue branch1: ; preds = %branch - %load_b3 = load i8, i8* %b3, align 1 + %load_b3 = load i8, ptr %b3, align 1 %3 = icmp ne i8 %load_b3, 0 br i1 %3, label %condition_body3, label %else condition_body3: ; preds = %branch1 - %load_z = load i32, i32* %z, align 4 + %load_z = load i32, ptr %z, align 4 br label %continue else: ; preds = %branch1 - %load_u = load i32, i32* %u, align 4 + %load_u = load i32, ptr %u, align 4 br label %continue continue: ; preds = %else, %condition_body3, %condition_body2, %condition_body diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap index 86eab054f2c..78445fb9f75 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_b1 = load i8, i8* %b1, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_b1 = load i8, ptr %b1, align 1 %1 = icmp ne i8 %load_b1, 0 br i1 %1, label %condition_body, label %continue condition_body: ; preds = %entry - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 br label %continue continue: ; preds = %condition_body, %entry diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap index 4a1e10b1df8..dc39da55a81 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,25 +11,25 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 %tmpVar = icmp sgt i32 %load_x, 1 %1 = zext i1 %tmpVar to i8 %2 = icmp ne i8 %1, 0 br i1 %2, label %5, label %3 condition_body: ; preds = %5 - %load_x1 = load i32, i32* %x, align 4 + %load_x1 = load i32, ptr %x, align 4 br label %continue continue: ; preds = %condition_body, %5 ret void 3: ; preds = %entry - %load_b1 = load i8, i8* %b1, align 1 + %load_b1 = load i8, ptr %b1, align 1 %4 = icmp ne i8 %load_b1, 0 br label %5 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap index e3328a4b8eb..883cb316a9c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,11 +14,11 @@ target triple = "[filtered]" @c = unnamed_addr constant i16 5 @aaa_instance = global %aaa { i16 3, i16 7, [5 x i8] zeroinitializer, [3 x i8] zeroinitializer } -define void @aaa(%aaa* %0) { +define void @aaa(ptr %0) { entry: - %a = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 0 - %b = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 1 - %arr = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 2 - %arr2 = getelementptr inbounds %aaa, %aaa* %0, i32 0, i32 3 + %a = getelementptr inbounds %aaa, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %aaa, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds %aaa, ptr %0, i32 0, i32 2 + %arr2 = getelementptr inbounds %aaa, ptr %0, i32 0, i32 3 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap index 71fa9ba941d..8dd8e3706fc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_return.snap @@ -11,18 +11,18 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: ret void } -define i16 @MyClass__testMethod(%MyClass* %0, i16 %1) { +define i16 @MyClass__testMethod(ptr %0, i16 %1) { entry: %MyClass.testMethod = alloca i16, align 2 %myMethodArg = alloca i16, align 2 - store i16 %1, i16* %myMethodArg, align 2 - store i16 0, i16* %MyClass.testMethod, align 2 - store i16 1, i16* %MyClass.testMethod, align 2 - %MyClass__testMethod_ret = load i16, i16* %MyClass.testMethod, align 2 + store i16 %1, ptr %myMethodArg, align 2 + store i16 0, ptr %MyClass.testMethod, align 2 + store i16 1, ptr %MyClass.testMethod, align 2 + %MyClass__testMethod_ret = load i16, ptr %MyClass.testMethod, align 2 ret i16 %MyClass__testMethod_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap index ed98c5de648..70136979bf3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_void.snap @@ -11,17 +11,17 @@ target triple = "[filtered]" @__MyClass__init = unnamed_addr constant %MyClass zeroinitializer -define void @MyClass(%MyClass* %0) { +define void @MyClass(ptr %0) { entry: ret void } -define void @MyClass__testMethod(%MyClass* %0, i16 %1) { +define void @MyClass__testMethod(ptr %0, i16 %1) { entry: %myMethodArg = alloca i16, align 2 - store i16 %1, i16* %myMethodArg, align 2 + store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 - store i16 0, i16* %myMethodLocalVar, align 2 - store i16 1, i16* %myMethodLocalVar, align 2 + store i16 0, ptr %myMethodLocalVar, align 2 + store i16 1, ptr %myMethodLocalVar, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_initialized_input.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_initialized_input.snap index cbc686079cf..e1e8e06232f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_initialized_input.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_initialized_input.snap @@ -11,31 +11,31 @@ target triple = "[filtered]" @__fb__init = unnamed_addr constant %fb zeroinitializer -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %call = call i32 @fb__meth(%fb* %0, i32 5) - %call1 = call i32 @fb__meth(%fb* %0, i32 4) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %call = call i32 @fb__meth(ptr %0, i32 5) + %call1 = call i32 @fb__meth(ptr %0, i32 4) ret void } -define i32 @fb__meth(%fb* %0, i32 %1) { +define i32 @fb__meth(ptr %0, i32 %1) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 %fb.meth = alloca i32, align 4 %a = alloca i32, align 4 - store i32 %1, i32* %a, align 4 - store i32 0, i32* %fb.meth, align 4 - %fb__meth_ret = load i32, i32* %fb.meth, align 4 + store i32 %1, ptr %a, align 4 + store i32 0, ptr %fb.meth, align 4 + %fb__meth_ret = load i32, ptr %fb.meth, align 4 ret i32 %fb__meth_ret } define i32 @foo() { entry: %foo = alloca i32, align 4 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_multiple_input.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_multiple_input.snap index 692f2745485..4ac1032d74b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_multiple_input.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_codegen_with_multiple_input.snap @@ -11,29 +11,29 @@ target triple = "[filtered]" @__fb__init = unnamed_addr constant %fb zeroinitializer -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %call = call i32 @fb__meth(%fb* %0, i32 1, i32 2, i32 3) - %call1 = call i32 @fb__meth(%fb* %0, i32 5, i32 7, i32 10) - %call2 = call i32 @fb__meth(%fb* %0, i32 3, i32 4, i32 10) - %call3 = call i32 @fb__meth(%fb* %0, i32 6, i32 4, i32 10) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %call = call i32 @fb__meth(ptr %0, i32 1, i32 2, i32 3) + %call1 = call i32 @fb__meth(ptr %0, i32 5, i32 7, i32 10) + %call2 = call i32 @fb__meth(ptr %0, i32 3, i32 4, i32 10) + %call3 = call i32 @fb__meth(ptr %0, i32 6, i32 4, i32 10) ret void } -define i32 @fb__meth(%fb* %0, i32 %1, i32 %2, i32 %3) { +define i32 @fb__meth(ptr %0, i32 %1, i32 %2, i32 %3) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 %fb.meth = alloca i32, align 4 %a = alloca i32, align 4 - store i32 %1, i32* %a, align 4 + store i32 %1, ptr %a, align 4 %b = alloca i32, align 4 - store i32 %2, i32* %b, align 4 + store i32 %2, ptr %b, align 4 %c = alloca i32, align 4 - store i32 %3, i32* %c, align 4 - store i32 0, i32* %fb.meth, align 4 - %fb__meth_ret = load i32, i32* %fb.meth, align 4 + store i32 %3, ptr %c, align 4 + store i32 0, ptr %fb.meth, align 4 + %fb__meth_ret = load i32, ptr %fb.meth, align 4 ret i32 %fb__meth_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap index 04caa3700ac..c38df8c1475 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap @@ -12,49 +12,42 @@ target triple = "[filtered]" @__fb_with_method__init = unnamed_addr constant %fb_with_method zeroinitializer @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"Hello\00" -define void @fb_with_method(%fb_with_method* %0) { +define void @fb_with_method(ptr %0) { entry: - %this = alloca %fb_with_method*, align 8 - store %fb_with_method* %0, %fb_with_method** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 %ret = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %ret to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %ret, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) %__method_with_aggregagte_return0 = alloca [81 x i8], align 1 - %2 = bitcast [81 x i8]* %__method_with_aggregagte_return0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %3 = bitcast [81 x i8]* %__method_with_aggregagte_return0 to i8* - call void @fb_with_method__method_with_aggregagte_return(%fb_with_method* %0, i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0)) - %4 = bitcast [81 x i8]* %ret to i8* - %5 = bitcast [81 x i8]* %__method_with_aggregagte_return0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %4, i8* align 1 %5, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__method_with_aggregagte_return0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @fb_with_method__method_with_aggregagte_return(ptr %0, ptr %__method_with_aggregagte_return0, ptr @utf08_literal_0) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %ret, ptr align 1 %__method_with_aggregagte_return0, i32 80, i1 false) ret void } -define void @fb_with_method__method_with_aggregagte_return(%fb_with_method* %0, i8* %1, i8* %2) { +define void @fb_with_method__method_with_aggregagte_return(ptr %0, ptr %1, ptr %2) { entry: - %this = alloca %fb_with_method*, align 8 - store %fb_with_method* %0, %fb_with_method** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 %ret = alloca [81 x i8], align 1 - %method_with_aggregagte_return = alloca i8*, align 8 - store i8* %1, i8** %method_with_aggregagte_return, align 8 + %method_with_aggregagte_return = alloca ptr, align 8 + store ptr %1, ptr %method_with_aggregagte_return, align 8 %in = alloca [81 x i8], align 1 - %bitcast = bitcast [81 x i8]* %in to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 81, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %2, i64 80, i1 false) - %deref = load i8*, i8** %method_with_aggregagte_return, align 8 - %3 = bitcast [81 x i8]* %in to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 %3, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %in, i8 0, i64 81, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %in, ptr align 1 %2, i64 80, i1 false) + %deref = load ptr, ptr %method_with_aggregagte_return, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 %in, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap index 6aec05b98db..e632a948929 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap @@ -12,22 +12,21 @@ target triple = "[filtered]" @__foo__init = unnamed_addr constant %foo zeroinitializer @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } -define void @foo__baz(%foo* %0, [81 x i8]* %1) { +define void @foo__baz(ptr %0, ptr %1) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %out = alloca [81 x i8]*, align 8 - store [81 x i8]* %1, [81 x i8]** %out, align 8 - %deref = load [81 x i8]*, [81 x i8]** %out, align 8 - %2 = bitcast [81 x i8]* %deref to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %out = alloca ptr, align 8 + store ptr %1, ptr %out, align 8 + %deref = load ptr, ptr %out, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 6, i1 false) ret void } @@ -35,25 +34,21 @@ define void @main() { entry: %s = alloca [81 x i8], align 1 %fb = alloca %foo, align 8 - %0 = bitcast [81 x i8]* %s to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast %foo* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %s to i8* - call void @foo__baz(%foo* %fb, i8* %2) - %3 = bitcast [81 x i8]* %s to i8* - call void @foo__baz(%foo* %fb, i8* %3) + call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) + call void @foo__baz(ptr %fb, ptr %s) + call void @foo__baz(ptr %fb, ptr %s) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap index 7dd08966c8c..6c7bbbe470a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @main_instance = global %main { float 0xC7EFFFFFE0000000, float 0x47EFFFFFE0000000, double 0xFFEFFFFFFFFFFFFF, double 0x7FEFFFFFFFFFFFFF } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %F32_MIN = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %F32_MAX = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %F64_MIN = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %F64_MAX = getelementptr inbounds %main, %main* %0, i32 0, i32 3 + %F32_MIN = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %F32_MAX = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %F64_MIN = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %F64_MAX = getelementptr inbounds %main, ptr %0, i32 0, i32 3 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap index 7de21f74a66..d5d868c40e8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %tmpVar = getelementptr inbounds [8 x i32], [8 x i32]* %x, i32 0, i32 4 - store i32 3, i32* %tmpVar, align 4 - %tmpVar1 = getelementptr inbounds [8 x i32], [8 x i32]* %x, i32 0, i32 7 - %tmpVar2 = getelementptr inbounds [8 x i32], [8 x i32]* %x, i32 0, i32 3 - %load_tmpVar = load i32, i32* %tmpVar2, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %tmpVar = getelementptr inbounds [8 x i32], ptr %x, i32 0, i32 4 + store i32 3, ptr %tmpVar, align 4 + %tmpVar1 = getelementptr inbounds [8 x i32], ptr %x, i32 0, i32 7 + %tmpVar2 = getelementptr inbounds [8 x i32], ptr %x, i32 0, i32 3 + %load_tmpVar = load i32, ptr %tmpVar2, align 4 %tmpVar3 = add i32 %load_tmpVar, 3 - store i32 %tmpVar3, i32* %tmpVar1, align 4 + store i32 %tmpVar3, ptr %tmpVar1, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap index fde9c0c713c..5d39a7d2592 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,8 +11,8 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap index 5389c99652d..89471d1a24f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,18 +11,18 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %tmpVar = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %x, i32 0, i32 2 - %tmpVar1 = getelementptr inbounds [2 x i32], [2 x i32]* %tmpVar, i32 0, i32 0 - store i32 3, i32* %tmpVar1, align 4 - %tmpVar2 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %x, i32 0, i32 3 - %tmpVar3 = getelementptr inbounds [2 x i32], [2 x i32]* %tmpVar2, i32 0, i32 1 - %tmpVar4 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %x, i32 0, i32 1 - %tmpVar5 = getelementptr inbounds [2 x i32], [2 x i32]* %tmpVar4, i32 0, i32 1 - %load_tmpVar = load i32, i32* %tmpVar5, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %tmpVar = getelementptr inbounds [4 x [2 x i32]], ptr %x, i32 0, i32 2 + %tmpVar1 = getelementptr inbounds [2 x i32], ptr %tmpVar, i32 0, i32 0 + store i32 3, ptr %tmpVar1, align 4 + %tmpVar2 = getelementptr inbounds [4 x [2 x i32]], ptr %x, i32 0, i32 3 + %tmpVar3 = getelementptr inbounds [2 x i32], ptr %tmpVar2, i32 0, i32 1 + %tmpVar4 = getelementptr inbounds [4 x [2 x i32]], ptr %x, i32 0, i32 1 + %tmpVar5 = getelementptr inbounds [2 x i32], ptr %tmpVar4, i32 0, i32 1 + %load_tmpVar = load i32, ptr %tmpVar5, align 4 %tmpVar6 = add i32 %load_tmpVar, 3 - store i32 %tmpVar6, i32* %tmpVar3, align 4 + store i32 %tmpVar6, ptr %tmpVar3, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap index f250f19b24b..58f9a58650d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,33 +11,33 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %z = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %cube = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %load_x = load i16, i16* %x, align 2 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %cube = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 %tmpVar = mul i32 25, %1 %tmpVar1 = add i32 %tmpVar, 0 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %2 = sext i16 %load_y to i32 %tmpVar2 = mul i32 5, %2 %tmpVar3 = add i32 %tmpVar2, %tmpVar1 - %load_z = load i16, i16* %z, align 2 + %load_z = load i16, ptr %z, align 2 %3 = sext i16 %load_z to i32 %tmpVar4 = mul i32 1, %3 %tmpVar5 = add i32 %tmpVar4, %tmpVar3 - %tmpVar6 = getelementptr inbounds [125 x i32], [125 x i32]* %cube, i32 0, i32 %tmpVar5 - %load_x7 = load i16, i16* %x, align 2 + %tmpVar6 = getelementptr inbounds [125 x i32], ptr %cube, i32 0, i32 %tmpVar5 + %load_x7 = load i16, ptr %x, align 2 %4 = sext i16 %load_x7 to i32 - %load_y8 = load i16, i16* %y, align 2 + %load_y8 = load i16, ptr %y, align 2 %5 = sext i16 %load_y8 to i32 %tmpVar9 = mul i32 %4, %5 - %load_z10 = load i16, i16* %z, align 2 + %load_z10 = load i16, ptr %z, align 2 %6 = sext i16 %load_z10 to i32 %tmpVar11 = mul i32 %tmpVar9, %6 - store i32 %tmpVar11, i32* %tmpVar6, align 4 + store i32 %tmpVar11, ptr %tmpVar6, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap index 63e1a12c22f..391289fc717 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,36 +11,36 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %z = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %cube = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %load_x = load i16, i16* %x, align 2 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %cube = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %load_x = load i16, ptr %x, align 2 %1 = sub i16 %load_x, -2 %2 = sext i16 %1 to i32 %tmpVar = mul i32 25, %2 %tmpVar1 = add i32 %tmpVar, 0 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %3 = sub i16 %load_y, -2 %4 = sext i16 %3 to i32 %tmpVar2 = mul i32 5, %4 %tmpVar3 = add i32 %tmpVar2, %tmpVar1 - %load_z = load i16, i16* %z, align 2 + %load_z = load i16, ptr %z, align 2 %5 = sub i16 %load_z, -2 %6 = sext i16 %5 to i32 %tmpVar4 = mul i32 1, %6 %tmpVar5 = add i32 %tmpVar4, %tmpVar3 - %tmpVar6 = getelementptr inbounds [125 x i32], [125 x i32]* %cube, i32 0, i32 %tmpVar5 - %load_x7 = load i16, i16* %x, align 2 + %tmpVar6 = getelementptr inbounds [125 x i32], ptr %cube, i32 0, i32 %tmpVar5 + %load_x7 = load i16, ptr %x, align 2 %7 = sext i16 %load_x7 to i32 - %load_y8 = load i16, i16* %y, align 2 + %load_y8 = load i16, ptr %y, align 2 %8 = sext i16 %load_y8 to i32 %tmpVar9 = mul i32 %7, %8 - %load_z10 = load i16, i16* %z, align 2 + %load_z10 = load i16, ptr %z, align 2 %9 = sext i16 %load_z10 to i32 %tmpVar11 = mul i32 %tmpVar9, %9 - store i32 %tmpVar11, i32* %tmpVar6, align 4 + store i32 %tmpVar11, ptr %tmpVar6, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap index 3700b362589..c1fb70344f4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,8 +11,8 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap index 35adccc8a4a..a5dc66744a0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,9 +14,9 @@ target triple = "[filtered]" define i32 @bar() { entry: %bar = alloca i32, align 4 - store i32 0, i32* %bar, align 4 - store i32 1, i32* %bar, align 4 - %bar_ret = load i32, i32* %bar, align 4 + store i32 0, ptr %bar, align 4 + store i32 1, ptr %bar, align 4 + %bar_ret = load i32, ptr %bar, align 4 ret i32 %bar_ret } @@ -25,18 +24,18 @@ define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %in = alloca i32, align 4 - store i32 %0, i32* %in, align 4 - store i32 0, i32* %foo, align 4 - store i32 1, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %in, align 4 + store i32 0, ptr %foo, align 4 + store i32 1, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %call = call i32 @bar() %call1 = call i32 @foo(i32 %call) - store i32 %call1, i32* %x, align 4 + store i32 %call1, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap index 91c2859d3bf..af52d15565c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,10 +11,10 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %temp = alloca i16, align 2 - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - store i16 0, i16* %temp, align 2 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + store i16 0, ptr %temp, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap index 099458304ee..c6c6f316d57 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap @@ -1,44 +1,43 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%foo2 = type { i32*, i32 } -%foo = type { i32* } +%foo2 = type { ptr, i32 } +%foo = type { ptr } %prg = type { i32 } @foo2_instance = global %foo2 zeroinitializer @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo2(%foo2* %0) { +define void @foo2(ptr %0) { entry: - %inout = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 0 - %in = getelementptr inbounds %foo2, %foo2* %0, i32 0, i32 1 + %inout = getelementptr inbounds %foo2, ptr %0, i32 0, i32 0 + %in = getelementptr inbounds %foo2, ptr %0, i32 0, i32 1 ret void } -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %inout = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %deref = load i32*, i32** %inout, align 8 - store i32* %deref, i32** getelementptr inbounds (%foo2, %foo2* @foo2_instance, i32 0, i32 0), align 8 - %deref1 = load i32*, i32** %inout, align 8 - %load_inout = load i32, i32* %deref1, align 4 - store i32 %load_inout, i32* getelementptr inbounds (%foo2, %foo2* @foo2_instance, i32 0, i32 1), align 4 - call void @foo2(%foo2* @foo2_instance) + %inout = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %inout, align 8 + store ptr %deref, ptr @foo2_instance, align 8 + %deref1 = load ptr, ptr %inout, align 8 + %load_inout = load i32, ptr %deref1, align 4 + store i32 %load_inout, ptr getelementptr inbounds (%foo2, ptr @foo2_instance, i32 0, i32 1), align 4 + call void @foo2(ptr @foo2_instance) ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32* %baz, i32** getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 8 - call void @foo(%foo* @foo_instance) + %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store ptr %baz, ptr @foo_instance, align 8 + call void @foo(ptr @foo_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap index b2cce2ddcd0..76fa52ba486 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointer_and_array_access_to_in_out.snap @@ -1,31 +1,30 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -define i16 @main(i16** %0, i16* %1) { +define i16 @main(ptr %0, ptr %1) { entry: %main = alloca i16, align 2 - %a = alloca i16**, align 8 - store i16** %0, i16*** %a, align 8 - %b = alloca i16*, align 8 - store i16* %1, i16** %b, align 8 + %a = alloca ptr, align 8 + store ptr %0, ptr %a, align 8 + %b = alloca ptr, align 8 + store ptr %1, ptr %b, align 8 %c = alloca i16, align 2 - store i16 0, i16* %c, align 2 - store i16 0, i16* %main, align 2 - %deref = load i16**, i16*** %a, align 8 - %deref1 = load i16*, i16** %deref, align 8 - %load_tmpVar = load i16, i16* %deref1, align 2 - store i16 %load_tmpVar, i16* %c, align 2 - %deref2 = load i16*, i16** %b, align 8 - %tmpVar = getelementptr inbounds i16, i16* %deref2, i32 0 - %load_tmpVar3 = load i16, i16* %tmpVar, align 2 - store i16 %load_tmpVar3, i16* %c, align 2 - %main_ret = load i16, i16* %main, align 2 + store i16 0, ptr %c, align 2 + store i16 0, ptr %main, align 2 + %deref = load ptr, ptr %a, align 8 + %deref1 = load ptr, ptr %deref, align 8 + %load_tmpVar = load i16, ptr %deref1, align 2 + store i16 %load_tmpVar, ptr %c, align 2 + %deref2 = load ptr, ptr %b, align 8 + %tmpVar = getelementptr inbounds [2 x i16], ptr %deref2, i32 0, i32 0 + %load_tmpVar3 = load i16, ptr %tmpVar, align 2 + store i16 %load_tmpVar3, ptr %c, align 2 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap index c34eb17bb60..6496e35790e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap @@ -1,37 +1,36 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%prg = type { i8, i8*, i8* } +%prg = type { i8, ptr, ptr } @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %X = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %pX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %rX = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - store i8* null, i8** %pX, align 8 - store i8* null, i8** %rX, align 8 - store i8* %X, i8** %pX, align 8 - store i8* %X, i8** %rX, align 8 - %deref = load i8*, i8** %pX, align 8 - %load_tmpVar = load i8, i8* %deref, align 1 - store i8 %load_tmpVar, i8* %X, align 1 - %deref1 = load i8*, i8** %rX, align 8 - %load_tmpVar2 = load i8, i8* %deref1, align 1 - store i8 %load_tmpVar2, i8* %X, align 1 - %deref3 = load i8*, i8** %pX, align 8 - %load_X = load i8, i8* %X, align 1 - store i8 %load_X, i8* %deref3, align 1 - %deref4 = load i8*, i8** %rX, align 8 - %load_X5 = load i8, i8* %X, align 1 - store i8 %load_X5, i8* %deref4, align 1 + %X = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %pX = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %rX = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + store ptr null, ptr %pX, align 8 + store ptr null, ptr %rX, align 8 + store ptr %X, ptr %pX, align 8 + store ptr %X, ptr %rX, align 8 + %deref = load ptr, ptr %pX, align 8 + %load_tmpVar = load i8, ptr %deref, align 1 + store i8 %load_tmpVar, ptr %X, align 1 + %deref1 = load ptr, ptr %rX, align 8 + %load_tmpVar2 = load i8, ptr %deref1, align 1 + store i8 %load_tmpVar2, ptr %X, align 1 + %deref3 = load ptr, ptr %pX, align 8 + %load_X = load i8, ptr %X, align 1 + store i8 %load_X, ptr %deref3, align 1 + %deref4 = load ptr, ptr %rX, align 8 + %load_X5 = load i8, ptr %X, align 1 + store i8 %load_X5, ptr %deref4, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap index 13026672f1b..69970eaf146 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,13 +13,13 @@ target triple = "[filtered]" @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - call void @foo(%foo* @foo_instance) + call void @foo(ptr @foo_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap index 63e46e7312f..d691fe0d0c7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i8, i8* %x, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 br i1 %1, label %2, label %4 2: ; preds = %entry - %load_y = load i8, i8* %y, align 1 + %load_y = load i8, ptr %y, align 1 %3 = icmp ne i8 %load_y, 0 br label %4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap index 6ce4e9dbbcb..f2092185fb0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i8, i8* %x, align 1 - %load_y = load i8, i8* %y, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i8, ptr %x, align 1 + %load_y = load i8, ptr %y, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap index 3a4df173975..0c19be33366 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,10 +11,10 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i8 1, i8* %y, align 1 - store i8 0, i8* %y, align 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i8 1, ptr %y, align 1 + store i8 0, ptr %y, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap index 04ab9a30cef..4b4f690205e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,11 +13,11 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"B\00" @utf16_literal_0 = private unnamed_addr constant [2 x i16] [i16 65, i16 0] -define void @mainPROG(%mainPROG* %0) { +define void @mainPROG(ptr %0) { entry: - %x = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 0 - %y = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 1 - store i8 65, i8* %x, align 1 - store i16 66, i16* %y, align 2 + %x = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 1 + store i8 65, ptr %x, align 1 + store i16 66, ptr %y, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap index 9f69a89967f..9d5740aed27 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -18,15 +17,15 @@ target triple = "[filtered]" @utf16_literal_2 = private unnamed_addr constant [2 x i16] [i16 39, i16 0] @utf16_literal_3 = private unnamed_addr constant [2 x i16] [i16 65, i16 0] -define void @mainPROG(%mainPROG* %0) { +define void @mainPROG(ptr %0) { entry: - %x = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 0 - %y = getelementptr inbounds %mainPROG, %mainPROG* %0, i32 0, i32 1 - store i8 97, i8* %x, align 1 - store i8 32, i8* %x, align 1 - store i16 65, i16* %y, align 2 - store i16 32, i16* %y, align 2 - store i16 39, i16* %y, align 2 - store i16 34, i16* %y, align 2 + %x = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 1 + store i8 97, ptr %x, align 1 + store i8 32, ptr %x, align 1 + store i16 65, ptr %y, align 2 + store i16 32, ptr %y, align 2 + store i16 39, ptr %y, align 2 + store i16 34, ptr %y, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap index 4bfac75e8bb..2b61a450bb4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,23 +11,23 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - store i64 56190123000000, i64* %w, align 8 - store i64 56190123000000, i64* %w, align 8 - store i64 100012000000, i64* %x, align 8 - store i64 100012000000, i64* %x, align 8 - store i64 465436800000000000, i64* %y, align 8 - store i64 0, i64* %y, align 8 - store i64 465509714000000000, i64* %z, align 8 - store i64 58804123000000, i64* %z, align 8 - store i64 58804123456789, i64* %z, align 8 - store i64 946757700000000000, i64* %z, align 8 - store i64 946757700000000000, i64* %z, align 8 - store i64 946757708123000000, i64* %z, align 8 + %w = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + store i64 56190123000000, ptr %w, align 8 + store i64 56190123000000, ptr %w, align 8 + store i64 100012000000, ptr %x, align 8 + store i64 100012000000, ptr %x, align 8 + store i64 465436800000000000, ptr %y, align 8 + store i64 0, ptr %y, align 8 + store i64 465509714000000000, ptr %z, align 8 + store i64 58804123000000, ptr %z, align 8 + store i64 58804123456789, ptr %z, align 8 + store i64 946757700000000000, ptr %z, align 8 + store i64 946757700000000000, ptr %z, align 8 + store i64 946757708123000000, ptr %z, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap index 98c6860b9e3..8636a68e53b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,20 +11,20 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - store i64 56190123000000, i64* %w, align 8 - store i64 56190123000000, i64* %w, align 8 - store i64 100012000000, i64* %x, align 8 - store i64 100012000000, i64* %x, align 8 - store i64 465436800000000000, i64* %y, align 8 - store i64 0, i64* %y, align 8 - store i64 465509700000000000, i64* %z, align 8 - store i64 58808123000000, i64* %z, align 8 - store i64 58804123456789, i64* %z, align 8 + %w = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + store i64 56190123000000, ptr %w, align 8 + store i64 56190123000000, ptr %w, align 8 + store i64 100012000000, ptr %x, align 8 + store i64 100012000000, ptr %x, align 8 + store i64 465436800000000000, ptr %y, align 8 + store i64 0, ptr %y, align 8 + store i64 465509700000000000, ptr %z, align 8 + store i64 58808123000000, ptr %z, align 8 + store i64 58804123456789, ptr %z, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap index def45d32d06..3a9c7325724 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,33 +11,33 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load float, float* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load float, ptr %x, align 4 %tmpVar = fcmp oeq float %load_x, 1.000000e+00 %1 = zext i1 %tmpVar to i8 - store i8 %1, i8* %y, align 1 - %load_x1 = load float, float* %x, align 4 + store i8 %1, ptr %y, align 1 + %load_x1 = load float, ptr %x, align 4 %tmpVar2 = fcmp ogt float %load_x1, 2.000000e+00 %2 = zext i1 %tmpVar2 to i8 - store i8 %2, i8* %y, align 1 - %load_x3 = load float, float* %x, align 4 + store i8 %2, ptr %y, align 1 + %load_x3 = load float, ptr %x, align 4 %tmpVar4 = fcmp olt float %load_x3, 3.000000e+00 %3 = zext i1 %tmpVar4 to i8 - store i8 %3, i8* %y, align 1 - %load_x5 = load float, float* %x, align 4 + store i8 %3, ptr %y, align 1 + %load_x5 = load float, ptr %x, align 4 %tmpVar6 = fcmp one float %load_x5, 4.000000e+00 %4 = zext i1 %tmpVar6 to i8 - store i8 %4, i8* %y, align 1 - %load_x7 = load float, float* %x, align 4 + store i8 %4, ptr %y, align 1 + %load_x7 = load float, ptr %x, align 4 %tmpVar8 = fcmp oge float %load_x7, 5.000000e+00 %5 = zext i1 %tmpVar8 to i8 - store i8 %5, i8* %y, align 1 - %load_x9 = load float, float* %x, align 4 + store i8 %5, ptr %y, align 1 + %load_x9 = load float, ptr %x, align 4 %tmpVar10 = fcmp ole float %load_x9, 6.000000e+00 %6 = zext i1 %tmpVar10 to i8 - store i8 %6, i8* %y, align 1 + store i8 %6, ptr %y, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap index f544c8a8882..97260be549b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,23 +13,23 @@ target triple = "[filtered]" @foo_instance = global %foo { i16 7 } @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %y = alloca i16, align 2 %z = alloca i16, align 2 - store i16 0, i16* %y, align 2 - store i16 9, i16* %z, align 2 - %load_z = load i16, i16* %z, align 2 + store i16 0, ptr %y, align 2 + store i16 9, ptr %z, align 2 + %load_z = load i16, ptr %z, align 2 %1 = sext i16 %load_z to i32 %tmpVar = add i32 %1, 1 %2 = trunc i32 %tmpVar to i16 - store i16 %2, i16* %y, align 2 + store i16 %2, ptr %y, align 2 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - call void @foo(%foo* @foo_instance) + call void @foo(ptr @foo_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap index f2fcbf7e1f7..37a215ca85b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,19 +11,19 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %w = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - store i64 100012006003, i64* %w, align 8 - store i64 100012006003, i64* %w, align 8 - store i64 465436800000000000, i64* %x, align 8 - store i64 0, i64* %x, align 8 - store i64 465509714000000000, i64* %y, align 8 - store i64 58804123456789, i64* %y, align 8 - store i64 56190999999999, i64* %z, align 8 - store i64 56190123456000, i64* %z, align 8 + %w = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + store i64 100012006003, ptr %w, align 8 + store i64 100012006003, ptr %w, align 8 + store i64 465436800000000000, ptr %x, align 8 + store i64 0, ptr %x, align 8 + store i64 465509714000000000, ptr %y, align 8 + store i64 58804123456789, ptr %y, align 8 + store i64 56190999999999, ptr %z, align 8 + store i64 56190123456000, ptr %z, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap index a9a5d11a9e4..e1935962b00 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,28 +11,28 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_y = load i8, i8* %y, align 1 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_y = load i8, ptr %y, align 1 %1 = icmp ne i8 %load_y, 0 br i1 %1, label %2, label %3 2: ; preds = %entry - %load_z = load i32, i32* %z, align 4 + %load_z = load i32, ptr %z, align 4 %tmpVar = icmp sge i32 %load_z, 5 br label %3 3: ; preds = %2, %entry %4 = phi i1 [ %1, %entry ], [ %tmpVar, %2 ] - %load_z1 = load i32, i32* %z, align 4 + %load_z1 = load i32, ptr %z, align 4 %tmpVar2 = icmp sle i32 %load_z1, 6 %tmpVar3 = xor i1 %tmpVar2, true br i1 %tmpVar3, label %7, label %5 5: ; preds = %3 - %load_y4 = load i8, i8* %y, align 1 + %load_y4 = load i8, ptr %y, align 1 %6 = icmp ne i8 %load_y4, 0 br label %7 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap index 6a541e8e96d..d3de0f00aae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,19 +11,19 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i8, i8* %x, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 %tmpVar = xor i1 %1, true - %load_x1 = load i8, i8* %x, align 1 + %load_x1 = load i8, ptr %x, align 1 %2 = icmp ne i8 %load_x1, 0 br i1 %2, label %3, label %5 3: ; preds = %entry - %load_y = load i8, i8* %y, align 1 + %load_y = load i8, ptr %y, align 1 %4 = icmp ne i8 %load_y, 0 %tmpVar2 = xor i1 %4, true br label %5 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap index 014e146ab7a..34d030a6240 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i8, i8* %x, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 br i1 %1, label %4, label %2 2: ; preds = %entry - %load_y = load i8, i8* %y, align 1 + %load_y = load i8, ptr %y, align 1 %3 = icmp ne i8 %load_y, 0 br label %4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap index c40b5c61aab..e29598e0058 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - store float 1.237500e+01, float* %x, align 4 - store float 2.500000e-01, float* %y, align 4 - %load_x = load float, float* %x, align 4 - %load_y = load float, float* %y, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + store float 1.237500e+01, ptr %x, align 4 + store float 2.500000e-01, ptr %y, align 4 + %load_x = load float, ptr %x, align 4 + %load_y = load float, ptr %y, align 4 %tmpVar = fadd float %load_x, %load_y - store float %tmpVar, float* %z, align 4 + store float %tmpVar, ptr %z, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap index 5591466b756..90887be96a3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store float 1.562500e-01, float* %y, align 4 - store float 1.000000e+02, float* %y, align 4 - store float 1.000000e+03, float* %y, align 4 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store float 1.562500e-01, ptr %y, align 4 + store float 1.000000e+02, ptr %y, align 4 + store float 1.000000e+03, ptr %y, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap index 793006bdf45..9a449f3795c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 %1 = sitofp i16 %load_x to float - store float %1, float* %y, align 4 + store float %1, ptr %y, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap index 0f1ac9daf0c..a08bb8d2c53 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_z = load i32, i32* %z, align 4 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_z = load i32, ptr %z, align 4 %tmpVar = add i32 -1, %load_z - %load_z1 = load i32, i32* %z, align 4 + %load_z1 = load i32, ptr %z, align 4 %tmpVar2 = sub i32 0, %load_z1 %tmpVar3 = add i32 2, %tmpVar2 - %load_y = load i32, i32* %y, align 4 + %load_y = load i32, ptr %y, align 4 %tmpVar4 = sub i32 0, %load_y %tmpVar5 = add i32 %tmpVar4, 3 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap index 62fb521e51e..c4f3214c17c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,24 +15,20 @@ target triple = "[filtered]" @utf16_literal_0 = private unnamed_addr constant [19 x i16] [i16 36, i16 52, i16 51, i16 32, i16 36, i16 39, i16 110, i16 111, i16 32, i16 114, i16 101, i16 112, i16 108, i16 97, i16 99, i16 101, i16 36, i16 39, i16 0] @utf16_literal_1 = private unnamed_addr constant [41 x i16] [i16 97, i16 10, i16 10, i16 32, i16 98, i16 10, i16 10, i16 32, i16 99, i16 12, i16 12, i16 32, i16 100, i16 13, i16 13, i16 32, i16 101, i16 9, i16 9, i16 32, i16 36, i16 32, i16 34, i16 100, i16 111, i16 117, i16 98, i16 108, i16 101, i16 34, i16 32, i16 87, i16 -10179, i16 -9066, i16 -10179, i16 -9066, i16 0, i16 0, i16 0, i16 0, i16 0] -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %should_replace_s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %should_not_replace_s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %should_replace_ws = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %should_not_replace_ws = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %1 = bitcast [81 x i8]* %should_replace_s to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([41 x i8], [41 x i8]* @utf08_literal_1, i32 0, i32 0), i32 41, i1 false) - %2 = bitcast [81 x i8]* %should_not_replace_s to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([19 x i8], [19 x i8]* @utf08_literal_0, i32 0, i32 0), i32 19, i1 false) - %3 = bitcast [81 x i16]* %should_replace_ws to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %3, i8* align 2 bitcast ([41 x i16]* @utf16_literal_1 to i8*), i32 82, i1 false) - %4 = bitcast [81 x i16]* %should_not_replace_ws to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %4, i8* align 2 bitcast ([19 x i16]* @utf16_literal_0 to i8*), i32 38, i1 false) + %should_replace_s = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %should_not_replace_s = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %should_replace_ws = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %should_not_replace_ws = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %should_replace_s, ptr align 1 @utf08_literal_1, i32 41, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %should_not_replace_s, ptr align 1 @utf08_literal_0, i32 19, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %should_replace_ws, ptr align 2 @utf16_literal_1, i32 82, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %should_not_replace_ws, ptr align 2 @utf16_literal_0, i32 38, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap index 65c413ffe7e..532ea6ba044 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,18 +13,16 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" @utf16_literal_0 = private unnamed_addr constant [18 x i16] [i16 105, i16 109, i16 32, i16 97, i16 32, i16 117, i16 116, i16 102, i16 49, i16 54, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([12 x i8], [12 x i8]* @utf08_literal_0, i32 0, i32 0), i32 12, i1 false) - %2 = bitcast [81 x i16]* %z to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %2, i8* align 2 bitcast ([18 x i16]* @utf16_literal_0 to i8*), i32 36, i1 false) + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %z, ptr align 2 @utf16_literal_0, i32 36, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap index 985138e91d5..5a24b567e50 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,17 +11,17 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i64 0, i64* %y, align 8 - store i64 43200000000000, i64* %y, align 8 - store i64 100000000, i64* %y, align 8 - store i64 100000000, i64* %y, align 8 - store i64 1000000, i64* %y, align 8 - store i64 -1000, i64* %y, align 8 - store i64 1, i64* %y, align 8 - store i64 -86400001000000, i64* %y, align 8 - store i64 8640000001000000, i64* %y, align 8 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i64 0, ptr %y, align 8 + store i64 43200000000000, ptr %y, align 8 + store i64 100000000, ptr %y, align 8 + store i64 100000000, ptr %y, align 8 + store i64 1000000, ptr %y, align 8 + store i64 -1000, ptr %y, align 8 + store i64 1, ptr %y, align 8 + store i64 -86400001000000, ptr %y, align 8 + store i64 8640000001000000, ptr %y, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap index 3b832ddc391..2f229ebb390 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i64 0, i64* %y, align 8 - store i64 3600000000000, i64* %y, align 8 - store i64 3600001000000, i64* %y, align 8 - store i64 3661000000000, i64* %y, align 8 - store i64 72900000000000, i64* %y, align 8 - store i64 72900000000000, i64* %y, align 8 - store i64 40260000000000, i64* %y, align 8 - store i64 40260000000000, i64* %y, align 8 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i64 0, ptr %y, align 8 + store i64 3600000000000, ptr %y, align 8 + store i64 3600001000000, ptr %y, align 8 + store i64 3661000000000, ptr %y, align 8 + store i64 72900000000000, ptr %y, align 8 + store i64 72900000000000, ptr %y, align 8 + store i64 40260000000000, ptr %y, align 8 + store i64 40260000000000, ptr %y, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap index 5a4ff5bc649..3e6a9387023 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,17 +13,17 @@ target triple = "[filtered]" @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - store i8 1, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 - store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 - call void @foo(%foo* @foo_instance) + store i8 1, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + store i32 2, ptr @foo_instance, align 4 + call void @foo(ptr @foo_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap index 87014b1019a..7348f4e1eae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,17 +13,17 @@ target triple = "[filtered]" @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 - store i8 1, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 - call void @foo(%foo* @foo_instance) + store i32 2, ptr @foo_instance, align 4 + store i8 1, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + call void @foo(ptr @foo_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap index 13ec1ddeea2..0d7417f4686 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap @@ -1,35 +1,34 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%foo = type { i32* } +%foo = type { ptr } %prg = type { i32 } @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %inout = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %deref = load i32*, i32** %inout, align 8 - %deref1 = load i32*, i32** %inout, align 8 - %load_inout = load i32, i32* %deref1, align 4 + %inout = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %deref = load ptr, ptr %inout, align 8 + %deref1 = load ptr, ptr %inout, align 8 + %load_inout = load i32, ptr %deref1, align 4 %tmpVar = add i32 %load_inout, 1 - store i32 %tmpVar, i32* %deref, align 4 + store i32 %tmpVar, ptr %deref, align 4 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 7, i32* %baz, align 4 - store i32* %baz, i32** getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 8 - call void @foo(%foo* @foo_instance) + %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 7, ptr %baz, align 4 + store ptr %baz, ptr @foo_instance, align 8 + call void @foo(ptr @foo_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap index c297d79ecd5..9f58b9a932d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,19 +13,19 @@ target triple = "[filtered]" @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 - call void @foo(%foo* @foo_instance) - %1 = load i8, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 - store i8 %1, i8* %baz, align 1 + %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 2, ptr @foo_instance, align 4 + call void @foo(ptr @foo_instance) + %1 = load i8, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + store i8 %1, ptr %baz, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap index c297d79ecd5..9f58b9a932d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,19 +13,19 @@ target triple = "[filtered]" @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 2, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 - call void @foo(%foo* @foo_instance) - %1 = load i8, i8* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 1 - store i8 %1, i8* %baz, align 1 + %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 2, ptr @foo_instance, align 4 + call void @foo(ptr @foo_instance) + %1 = load i8, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + store i8 %1, ptr %baz, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap index 2bc0788d257..2c1027ef66c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,10 +11,10 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 7 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap index 578c4abbad0..323ea9237ef 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,24 +11,24 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 1 - store i32 %tmpVar, i32* %y, align 4 - %load_x1 = load i32, i32* %x, align 4 + store i32 %tmpVar, ptr %y, align 4 + %load_x1 = load i32, ptr %x, align 4 %tmpVar2 = sub i32 %load_x1, 2 - store i32 %tmpVar2, i32* %y, align 4 - %load_x3 = load i32, i32* %x, align 4 + store i32 %tmpVar2, ptr %y, align 4 + %load_x3 = load i32, ptr %x, align 4 %tmpVar4 = mul i32 %load_x3, 3 - store i32 %tmpVar4, i32* %y, align 4 - %load_x5 = load i32, i32* %x, align 4 + store i32 %tmpVar4, ptr %y, align 4 + %load_x5 = load i32, ptr %x, align 4 %tmpVar6 = sdiv i32 %load_x5, 4 - store i32 %tmpVar6, i32* %y, align 4 - %load_x7 = load i32, i32* %x, align 4 + store i32 %tmpVar6, ptr %y, align 4 + %load_x7 = load i32, ptr %x, align 4 %tmpVar8 = srem i32 %load_x7, 5 - store i32 %tmpVar8, i32* %y, align 4 + store i32 %tmpVar8, ptr %y, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap index 1a76e97c33e..11b48f6d9cc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,33 +11,33 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 %tmpVar = icmp eq i32 %load_x, 1 %1 = zext i1 %tmpVar to i8 - store i8 %1, i8* %y, align 1 - %load_x1 = load i32, i32* %x, align 4 + store i8 %1, ptr %y, align 1 + %load_x1 = load i32, ptr %x, align 4 %tmpVar2 = icmp sgt i32 %load_x1, 2 %2 = zext i1 %tmpVar2 to i8 - store i8 %2, i8* %y, align 1 - %load_x3 = load i32, i32* %x, align 4 + store i8 %2, ptr %y, align 1 + %load_x3 = load i32, ptr %x, align 4 %tmpVar4 = icmp slt i32 %load_x3, 3 %3 = zext i1 %tmpVar4 to i8 - store i8 %3, i8* %y, align 1 - %load_x5 = load i32, i32* %x, align 4 + store i8 %3, ptr %y, align 1 + %load_x5 = load i32, ptr %x, align 4 %tmpVar6 = icmp ne i32 %load_x5, 4 %4 = zext i1 %tmpVar6 to i8 - store i8 %4, i8* %y, align 1 - %load_x7 = load i32, i32* %x, align 4 + store i8 %4, ptr %y, align 1 + %load_x7 = load i32, ptr %x, align 4 %tmpVar8 = icmp sge i32 %load_x7, 5 %5 = zext i1 %tmpVar8 to i8 - store i8 %5, i8* %y, align 1 - %load_x9 = load i32, i32* %x, align 4 + store i8 %5, ptr %y, align 1 + %load_x9 = load i32, ptr %x, align 4 %tmpVar10 = icmp sle i32 %load_x9, 6 %6 = zext i1 %tmpVar10 to i8 - store i8 %6, i8* %y, align 1 + store i8 %6, ptr %y, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap index 6a424f10d49..592f0ac5087 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,9 +11,9 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 7, i32* %y, align 4 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 7, ptr %y, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap index 699e99e7f52..790db336029 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 - %load_y = load i32, i32* %y, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 + %load_y = load i32, ptr %y, align 4 %tmpVar = add i32 %load_x, %load_y ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap index c581c13ce15..f3386184676 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 - %load_y = load i32, i32* %y, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 + %load_y = load i32, ptr %y, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap index aa77ac371ae..4e35a472e67 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,9 +11,9 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap index bb6472a7d36..e9468544cf2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,17 +11,17 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_x = load i8, i8* %x, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 - %load_y = load i8, i8* %y, align 1 + %load_y = load i8, ptr %y, align 1 %2 = icmp ne i8 %load_y, 0 %3 = xor i1 %1, %2 %4 = zext i1 %3 to i8 - store i8 %4, i8* %z, align 1 + store i8 %4, ptr %z, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap index dba4041c475..02e9cd51139 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap @@ -13,26 +13,26 @@ target triple = "[filtered]" @bar_instance = global %bar zeroinitializer @__fb__init = unnamed_addr constant %fb zeroinitializer -define void @bar(%bar* %0) { +define void @bar(ptr %0) { entry: - %fb_inst = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 - call void @fb__foo(%fb* %fb_inst) + %fb_inst = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + call void @fb__foo(ptr %fb_inst) ret void } -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void } -define void @fb__foo(%fb* %0) { +define void @fb__foo(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 - store i32 2, i32* %x, align 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap index 7a8417bc545..15be5909d73 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,21 +13,21 @@ target triple = "[filtered]" @bar_instance = global %bar zeroinitializer @prg_instance = global %prg zeroinitializer -define void @bar(%bar* %0) { +define void @bar(ptr %0) { entry: - call void @prg__foo(%prg* @prg_instance) + call void @prg__foo(ptr @prg_instance) ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } -define void @prg__foo(%prg* %0) { +define void @prg__foo(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 2, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap index fd348dbeca4..bb6397a71b9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - call void @prg__foo(%prg* @prg_instance) + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + call void @prg__foo(ptr @prg_instance) ret void } -define void @prg__foo(%prg* %0) { +define void @prg__foo(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 2, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap index d037f5d808d..712befc8988 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,17 +14,17 @@ target triple = "[filtered]" define float @foo() { entry: %foo = alloca float, align 4 - store float 0.000000e+00, float* %foo, align 4 - store float 1.000000e+00, float* %foo, align 4 - %foo_ret = load float, float* %foo, align 4 + store float 0.000000e+00, ptr %foo, align 4 + store float 1.000000e+00, ptr %foo, align 4 + %foo_ret = load float, ptr %foo, align 4 ret float %foo_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %call = call float @foo() %1 = fptosi float %call to i32 - store i32 %1, i32* %x, align 4 + store i32 %1, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap index 9e0745f30ae..7bd6141bf26 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap @@ -15,30 +15,30 @@ target triple = "[filtered]" @foo_instance = global %foo zeroinitializer @prg_instance = global %prg zeroinitializer -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void } -define void @foo(%foo* %0) { +define void @foo(ptr %0) { entry: - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %baz = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %baz = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 ret void } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %load_x = load i32, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 0), align 4 - store i32 %load_x, i32* %x, align 4 - %load_y = load i32, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 1), align 4 - store i32 %load_y, i32* %x, align 4 - %load_x1 = load i32, i32* getelementptr inbounds (%foo, %foo* @foo_instance, i32 0, i32 2, i32 0), align 4 - store i32 %load_x1, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %load_x = load i32, ptr @foo_instance, align 4 + store i32 %load_x, ptr %x, align 4 + %load_y = load i32, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 4 + store i32 %load_y, ptr %x, align 4 + %load_x1 = load i32, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 2), align 4 + store i32 %load_x1, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap index 5479ae3fafd..1f79cbdabc7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -9,7 +8,7 @@ target datalayout = "[filtered]" target triple = "[filtered]" %STRUCT_params = type { i8, i8, i8 } -%prog = type { %STRUCT_params*, %STRUCT_params* } +%prog = type { ptr, ptr } %main = type {} @global1 = global %STRUCT_params zeroinitializer @@ -22,20 +21,20 @@ target triple = "[filtered]" @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %input2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 + %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %input2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - store %STRUCT_params* @global1, %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 8 - store %STRUCT_params* @global2, %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 8 - call void @prog(%prog* @prog_instance) - store %STRUCT_params* bitcast (i32* @global4 to %STRUCT_params*), %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 8 - store %STRUCT_params* bitcast ([81 x i8]* @global5 to %STRUCT_params*), %STRUCT_params** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 8 - call void @prog(%prog* @prog_instance) + store ptr @global1, ptr @prog_instance, align 8 + store ptr @global2, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 8 + call void @prog(ptr @prog_instance) + store ptr @global4, ptr @prog_instance, align 8 + store ptr @global5, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 8 + call void @prog(ptr @prog_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap index d2fe88fc4b9..13f4d6ff2dd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,17 +11,17 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue1 br i1 true, label %while_body, label %continue while_body: ; preds = %condition_check - %load_x = load i8, i8* %x, align 1 - %load_x2 = load i8, i8* %x, align 1 + %load_x = load i8, ptr %x, align 1 + %load_x2 = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x2, 0 br i1 %1, label %condition_body, label %continue1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap index 96a323b1f3b..72f820d478b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,9 +11,9 @@ define i16 @smaller_than_ten(i8 %0) { entry: %smaller_than_ten = alloca i16, align 2 %n = alloca i8, align 1 - store i8 %0, i8* %n, align 1 - store i16 0, i16* %smaller_than_ten, align 2 - %load_n = load i8, i8* %n, align 1 + store i8 %0, ptr %n, align 1 + store i16 0, ptr %smaller_than_ten, align 2 + %load_n = load i8, ptr %n, align 1 %1 = sext i8 %load_n to i32 %tmpVar = icmp slt i32 %1, 10 %2 = zext i1 %tmpVar to i8 @@ -22,13 +21,13 @@ entry: br i1 %3, label %condition_body, label %continue condition_body: ; preds = %entry - %smaller_than_ten_ret = load i16, i16* %smaller_than_ten, align 2 + %smaller_than_ten_ret = load i16, ptr %smaller_than_ten, align 2 ret i16 %smaller_than_ten_ret buffer_block: ; No predecessors! br label %continue continue: ; preds = %buffer_block, %entry - %smaller_than_ten_ret1 = load i16, i16* %smaller_than_ten, align 2 + %smaller_than_ten_ret1 = load i16, ptr %smaller_than_ten, align 2 ret i16 %smaller_than_ten_ret1 } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap index 8dd4a9326e7..00be307a76e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap @@ -11,12 +11,12 @@ target triple = "[filtered]" @__abcdef__init = unnamed_addr constant %abcdef zeroinitializer -define void @abcdef(%abcdef* %0) { +define void @abcdef(ptr %0) { entry: - %this = alloca %abcdef*, align 8 - store %abcdef* %0, %abcdef** %this, align 8 - %n = getelementptr inbounds %abcdef, %abcdef* %0, i32 0, i32 0 - %load_n = load i8, i8* %n, align 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %n = getelementptr inbounds %abcdef, ptr %0, i32 0, i32 0 + %load_n = load i8, ptr %n, align 1 %1 = sext i8 %load_n to i32 %tmpVar = icmp slt i32 %1, 10 %2 = zext i1 %tmpVar to i8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap index dd1dbba306b..c3fdfa53609 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i8, i8* %x, align 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i8, ptr %x, align 1 switch i8 %load_x, label %else [ i8 1, label %case i8 2, label %case1 @@ -24,19 +23,19 @@ entry: ] case: ; preds = %entry - store i8 1, i8* %y, align 1 + store i8 1, ptr %y, align 1 br label %continue case1: ; preds = %entry - store i8 2, i8* %y, align 1 + store i8 2, ptr %y, align 1 br label %continue case2: ; preds = %entry - store i8 3, i8* %y, align 1 + store i8 3, ptr %y, align 1 br label %continue else: ; preds = %entry - store i8 0, i8* %y, align 1 + store i8 0, ptr %y, align 1 br label %continue continue: ; preds = %else, %case2, %case1, %case diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap index bda1c655a18..af2c70caea5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i32, ptr %x, align 4 switch i32 %load_x, label %else [ i32 1, label %case i32 2, label %case1 @@ -24,19 +23,19 @@ entry: ] case: ; preds = %entry - store i32 1, i32* %y, align 4 + store i32 1, ptr %y, align 4 br label %continue case1: ; preds = %entry - store i32 2, i32* %y, align 4 + store i32 2, ptr %y, align 4 br label %continue case2: ; preds = %entry - store i32 3, i32* %y, align 4 + store i32 3, ptr %y, align 4 br label %continue else: ; preds = %entry - store i32 -1, i32* %y, align 4 + store i32 -1, ptr %y, align 4 br label %continue continue: ; preds = %else, %case2, %case1, %case diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap index 29dffaf5d9f..886d2add759 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sizeof_works_in_binary_expression_with_different_size.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,16 +12,16 @@ entry: %main = alloca i32, align 4 %i = alloca i32, align 4 %j = alloca i16, align 2 - %arr_ptr = alloca [3 x float]*, align 8 - store i32 0, i32* %i, align 4 - store i16 0, i16* %j, align 2 - store [3 x float]* null, [3 x float]** %arr_ptr, align 8 - store i32 0, i32* %main, align 4 - %load_j = load i16, i16* %j, align 2 + %arr_ptr = alloca ptr, align 8 + store i32 0, ptr %i, align 4 + store i16 0, ptr %j, align 2 + store ptr null, ptr %arr_ptr, align 8 + store i32 0, ptr %main, align 4 + %load_j = load i16, ptr %j, align 2 %0 = zext i16 %load_j to i64 - %tmpVar = sub i64 %0, ptrtoint ([3 x float]** getelementptr ([3 x float]*, [3 x float]** null, i32 1) to i64) + %tmpVar = sub i64 %0, ptrtoint (ptr getelementptr (ptr, ptr null, i32 1) to i64) %1 = trunc i64 %tmpVar to i32 - store i32 %1, i32* %i, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 %1, ptr %i, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap index 748b21e483b..fb0151b3f1c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,10 +13,10 @@ target triple = "[filtered]" @MainProg_instance = global %MainProg zeroinitializer @__MyStruct__init = unnamed_addr constant %MyStruct zeroinitializer -define void @MainProg(%MainProg* %0) { +define void @MainProg(ptr %0) { entry: - %Cord = getelementptr inbounds %MainProg, %MainProg* %0, i32 0, i32 0 - %a = getelementptr inbounds %MyStruct, %MyStruct* %Cord, i32 0, i32 0 - store i32 0, i32* %a, align 4 + %Cord = getelementptr inbounds %MainProg, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %MyStruct, ptr %Cord, i32 0, i32 0 + store i32 0, ptr %a, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap index 2c489f4f792..4ad404f970b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap @@ -15,14 +15,14 @@ define i32 @CheckRangeSigned(i32 %0, i32 %1, i32 %2) { entry: %CheckRangeSigned = alloca i32, align 4 %v = alloca i32, align 4 - store i32 %0, i32* %v, align 4 + store i32 %0, ptr %v, align 4 %low = alloca i32, align 4 - store i32 %1, i32* %low, align 4 + store i32 %1, ptr %low, align 4 %up = alloca i32, align 4 - store i32 %2, i32* %up, align 4 - store i32 0, i32* %CheckRangeSigned, align 4 - store i32 -7, i32* %CheckRangeSigned, align 4 - %CheckRangeSigned_ret = load i32, i32* %CheckRangeSigned, align 4 + store i32 %2, ptr %up, align 4 + store i32 0, ptr %CheckRangeSigned, align 4 + store i32 -7, ptr %CheckRangeSigned, align 4 + %CheckRangeSigned_ret = load i32, ptr %CheckRangeSigned, align 4 ret i32 %CheckRangeSigned_ret } @@ -30,14 +30,14 @@ define i32 @CheckRangeUnsigned(i32 %0, i32 %1, i32 %2) { entry: %CheckRangeUnsigned = alloca i32, align 4 %v = alloca i32, align 4 - store i32 %0, i32* %v, align 4 + store i32 %0, ptr %v, align 4 %low = alloca i32, align 4 - store i32 %1, i32* %low, align 4 + store i32 %1, ptr %low, align 4 %up = alloca i32, align 4 - store i32 %2, i32* %up, align 4 - store i32 0, i32* %CheckRangeUnsigned, align 4 - store i32 7, i32* %CheckRangeUnsigned, align 4 - %CheckRangeUnsigned_ret = load i32, i32* %CheckRangeUnsigned, align 4 + store i32 %2, ptr %up, align 4 + store i32 0, ptr %CheckRangeUnsigned, align 4 + store i32 7, ptr %CheckRangeUnsigned, align 4 + %CheckRangeUnsigned_ret = load i32, ptr %CheckRangeUnsigned, align 4 ret i32 %CheckRangeUnsigned_ret } @@ -45,14 +45,14 @@ define i64 @CheckLRangeSigned(i64 %0, i64 %1, i64 %2) { entry: %CheckLRangeSigned = alloca i64, align 8 %v = alloca i64, align 8 - store i64 %0, i64* %v, align 8 + store i64 %0, ptr %v, align 8 %low = alloca i64, align 8 - store i64 %1, i64* %low, align 8 + store i64 %1, ptr %low, align 8 %up = alloca i64, align 8 - store i64 %2, i64* %up, align 8 - store i64 0, i64* %CheckLRangeSigned, align 8 - store i64 -77, i64* %CheckLRangeSigned, align 8 - %CheckLRangeSigned_ret = load i64, i64* %CheckLRangeSigned, align 8 + store i64 %2, ptr %up, align 8 + store i64 0, ptr %CheckLRangeSigned, align 8 + store i64 -77, ptr %CheckLRangeSigned, align 8 + %CheckLRangeSigned_ret = load i64, ptr %CheckLRangeSigned, align 8 ret i64 %CheckLRangeSigned_ret } @@ -60,54 +60,54 @@ define i64 @CheckLRangeUnsigned(i64 %0, i64 %1, i64 %2) { entry: %CheckLRangeUnsigned = alloca i64, align 8 %v = alloca i64, align 8 - store i64 %0, i64* %v, align 8 + store i64 %0, ptr %v, align 8 %low = alloca i64, align 8 - store i64 %1, i64* %low, align 8 + store i64 %1, ptr %low, align 8 %up = alloca i64, align 8 - store i64 %2, i64* %up, align 8 - store i64 0, i64* %CheckLRangeUnsigned, align 8 - store i64 77, i64* %CheckLRangeUnsigned, align 8 - %CheckLRangeUnsigned_ret = load i64, i64* %CheckLRangeUnsigned, align 8 + store i64 %2, ptr %up, align 8 + store i64 0, ptr %CheckLRangeUnsigned, align 8 + store i64 77, ptr %CheckLRangeUnsigned, align 8 + %CheckLRangeUnsigned_ret = load i64, ptr %CheckLRangeUnsigned, align 8 ret i64 %CheckLRangeUnsigned_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %c = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %d = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %e = getelementptr inbounds %main, %main* %0, i32 0, i32 4 - %f = getelementptr inbounds %main, %main* %0, i32 0, i32 5 - %g = getelementptr inbounds %main, %main* %0, i32 0, i32 6 - %h = getelementptr inbounds %main, %main* %0, i32 0, i32 7 - %i = getelementptr inbounds %main, %main* %0, i32 0, i32 8 - %j = getelementptr inbounds %main, %main* %0, i32 0, i32 9 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %d = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %e = getelementptr inbounds %main, ptr %0, i32 0, i32 4 + %f = getelementptr inbounds %main, ptr %0, i32 0, i32 5 + %g = getelementptr inbounds %main, ptr %0, i32 0, i32 6 + %h = getelementptr inbounds %main, ptr %0, i32 0, i32 7 + %i = getelementptr inbounds %main, ptr %0, i32 0, i32 8 + %j = getelementptr inbounds %main, ptr %0, i32 0, i32 9 %call = call i32 @CheckRangeUnsigned(i32 1, i32 0, i32 100) %1 = trunc i32 %call to i8 - store i8 %1, i8* %a, align 1 + store i8 %1, ptr %a, align 1 %call1 = call i32 @CheckRangeSigned(i32 1, i32 -100, i32 100) %2 = trunc i32 %call1 to i8 - store i8 %2, i8* %b, align 1 + store i8 %2, ptr %b, align 1 %call2 = call i32 @CheckRangeUnsigned(i32 1, i32 0, i32 100) %3 = trunc i32 %call2 to i8 - store i8 %3, i8* %c, align 1 + store i8 %3, ptr %c, align 1 %call3 = call i32 @CheckRangeUnsigned(i32 1, i32 0, i32 100) %4 = trunc i32 %call3 to i16 - store i16 %4, i16* %d, align 2 + store i16 %4, ptr %d, align 2 %call4 = call i32 @CheckRangeSigned(i32 1, i32 -100, i32 100) %5 = trunc i32 %call4 to i16 - store i16 %5, i16* %e, align 2 + store i16 %5, ptr %e, align 2 %call5 = call i32 @CheckRangeUnsigned(i32 1, i32 0, i32 100) %6 = trunc i32 %call5 to i16 - store i16 %6, i16* %f, align 2 + store i16 %6, ptr %f, align 2 %call6 = call i32 @CheckRangeSigned(i32 1, i32 -100, i32 100) - store i32 %call6, i32* %g, align 4 + store i32 %call6, ptr %g, align 4 %call7 = call i32 @CheckRangeUnsigned(i32 1, i32 0, i32 100) - store i32 %call7, i32* %h, align 4 + store i32 %call7, ptr %h, align 4 %call8 = call i64 @CheckLRangeSigned(i64 1, i64 -100, i64 100) - store i64 %call8, i64* %i, align 8 + store i64 %call8, ptr %i, align 8 %call9 = call i64 @CheckLRangeUnsigned(i64 1, i64 0, i64 100) - store i64 %call9, i64* %j, align 8 + store i64 %call9, ptr %j, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap index c24c891f747..1e084a41fe0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,21 +15,21 @@ define i16 @Check_XX_RangeSigned(i16 %0, i16 %1, i16 %2) { entry: %Check_XX_RangeSigned = alloca i16, align 2 %value = alloca i16, align 2 - store i16 %0, i16* %value, align 2 + store i16 %0, ptr %value, align 2 %lower = alloca i16, align 2 - store i16 %1, i16* %lower, align 2 + store i16 %1, ptr %lower, align 2 %upper = alloca i16, align 2 - store i16 %2, i16* %upper, align 2 - store i16 0, i16* %Check_XX_RangeSigned, align 2 - %load_value = load i16, i16* %value, align 2 - store i16 %load_value, i16* %Check_XX_RangeSigned, align 2 - %Check_XX_RangeSigned_ret = load i16, i16* %Check_XX_RangeSigned, align 2 + store i16 %2, ptr %upper, align 2 + store i16 0, ptr %Check_XX_RangeSigned, align 2 + %load_value = load i16, ptr %value, align 2 + store i16 %load_value, ptr %Check_XX_RangeSigned, align 2 + %Check_XX_RangeSigned_ret = load i16, ptr %Check_XX_RangeSigned, align 2 ret i16 %Check_XX_RangeSigned_ret } -define void @Main(%Main* %0) { +define void @Main(ptr %0) { entry: - %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 - store i16 7, i16* %x, align 2 + %x = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 + store i16 7, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap index d29b80e3bac..f6c66f16bf6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,22 +15,22 @@ define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 - store i16 %0, i16* %value, align 2 + store i16 %0, ptr %value, align 2 %lower = alloca i16, align 2 - store i16 %1, i16* %lower, align 2 + store i16 %1, ptr %lower, align 2 %upper = alloca i16, align 2 - store i16 %2, i16* %upper, align 2 - store i16 0, i16* %CheckRangeSigned, align 2 - %load_value = load i16, i16* %value, align 2 - store i16 %load_value, i16* %CheckRangeSigned, align 2 - %CheckRangeSigned_ret = load i16, i16* %CheckRangeSigned, align 2 + store i16 %2, ptr %upper, align 2 + store i16 0, ptr %CheckRangeSigned, align 2 + %load_value = load i16, ptr %value, align 2 + store i16 %load_value, ptr %CheckRangeSigned, align 2 + %CheckRangeSigned_ret = load i16, ptr %CheckRangeSigned, align 2 ret i16 %CheckRangeSigned_ret } -define void @Main(%Main* %0) { +define void @Main(ptr %0) { entry: - %x = getelementptr inbounds %Main, %Main* %0, i32 0, i32 0 + %x = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 7, i16 0, i16 100) - store i16 %call, i16* %x, align 2 + store i16 %call, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap index 6a058af9ab5..3e8d5b6bcc9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i64 1000000, i64* %y, align 8 - store i64 1000, i64* %y, align 8 - store i64 100, i64* %y, align 8 - store i64 8640000001125000, i64* %y, align 8 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i64 1000000, ptr %y, align 8 + store i64 1000, ptr %y, align 8 + store i64 100, ptr %y, align 8 + store i64 8640000001125000, ptr %y, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap index cbfd7cdd5a7..6a0c4228906 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__two_global_variables_generates_in_separate_global_variables.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,7 +14,7 @@ target triple = "[filtered]" @gA = global i16 0 @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap index 480e6f1d723..7549c18fe39 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -21,13 +20,13 @@ target triple = "[filtered]" @MyEnum3.yellow = unnamed_addr constant i32 26 @MyEnum3.green = unnamed_addr constant i32 27 -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - store i8 6, i8* %x, align 1 - store i16 16, i16* %y, align 2 - store i32 26, i32* %z, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + store i8 6, ptr %x, align 1 + store i16 16, ptr %y, align 2 + store i32 26, ptr %z, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap index 433758ba012..1444a3bea2a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,8 +11,8 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap index a83b17e002c..a65bf5c4f69 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -18,26 +17,26 @@ define i16 @CheckRangeSigned(i16 %0, i16 %1, i16 %2) { entry: %CheckRangeSigned = alloca i16, align 2 %value = alloca i16, align 2 - store i16 %0, i16* %value, align 2 + store i16 %0, ptr %value, align 2 %lower = alloca i16, align 2 - store i16 %1, i16* %lower, align 2 + store i16 %1, ptr %lower, align 2 %upper = alloca i16, align 2 - store i16 %2, i16* %upper, align 2 - store i16 0, i16* %CheckRangeSigned, align 2 - %load_value = load i16, i16* %value, align 2 - store i16 %load_value, i16* %CheckRangeSigned, align 2 - %CheckRangeSigned_ret = load i16, i16* %CheckRangeSigned, align 2 + store i16 %2, ptr %upper, align 2 + store i16 0, ptr %CheckRangeSigned, align 2 + %load_value = load i16, ptr %value, align 2 + store i16 %load_value, ptr %CheckRangeSigned, align 2 + %CheckRangeSigned_ret = load i16, ptr %CheckRangeSigned, align 2 ret i16 %CheckRangeSigned_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %load_MIN = load i16, i16* @MIN, align 2 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %load_MIN = load i16, ptr @MIN, align 2 %1 = sext i16 %load_MIN to i32 %tmpVar = add i32 %1, 1 %2 = trunc i32 %tmpVar to i16 %call = call i16 @CheckRangeSigned(i16 5, i16 0, i16 %2) - store i16 %call, i16* %x, align 2 + store i16 %call, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap index e27b700ecc0..82bc133ae37 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,9 +14,9 @@ target triple = "[filtered]" @cC = unnamed_addr constant i16 3 @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - store i32 6, i32* %z, align 4 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + store i32 6, ptr %z, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap index ce3be26b632..48a354b3796 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,14 +15,14 @@ define i64 @func() { entry: %func = alloca i64, align 8 %TIME = alloca i64, align 8 - store i64 0, i64* %TIME, align 8 - store i64 0, i64* %func, align 8 - %func_ret = load i64, i64* %func, align 8 + store i64 0, ptr %TIME, align 8 + store i64 0, ptr %func, align 8 + %func_ret = load i64, ptr %func, align 8 ret i64 %func_ret } -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %TIME = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 + %TIME = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap index b8f56c206f2..a925cc40b5a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue5 br i1 true, label %while_body, label %continue while_body: ; preds = %condition_check - %load_x = load i32, i32* %x, align 4 + %load_x = load i32, ptr %x, align 4 %tmpVar = icmp slt i32 %load_x, 20 %1 = zext i1 %tmpVar to i8 %2 = icmp ne i8 %1, 0 @@ -38,10 +37,10 @@ buffer_block: ; No predecessors! br label %continue1 continue1: ; preds = %buffer_block, %while_body - %load_x3 = load i32, i32* %x, align 4 + %load_x3 = load i32, ptr %x, align 4 %tmpVar4 = add i32 %load_x3, 1 - store i32 %tmpVar4, i32* %x, align 4 - %load_x6 = load i32, i32* %x, align 4 + store i32 %tmpVar4, ptr %x, align 4 + %load_x6 = load i32, ptr %x, align 4 %tmpVar7 = icmp sge i32 %load_x6, 10 %3 = zext i1 %tmpVar7 to i8 %4 = icmp ne i8 %3, 0 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap index 0022bddeca4..7279cb33bc5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue1 br i1 true, label %while_body, label %continue while_body: ; preds = %condition_check - %load_x = load i8, i8* %x, align 1 + %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 %tmpVar = xor i1 %1, true br i1 %tmpVar, label %condition_body, label %continue1 @@ -36,6 +35,6 @@ buffer_block: ; No predecessors! br label %continue1 continue1: ; preds = %buffer_block, %while_body - %load_x2 = load i8, i8* %x, align 1 + %load_x2 = load i8, ptr %x, align 1 br label %condition_check } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap index 603410b9b0f..83ef67930af 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/code_gen_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue1 br i1 true, label %while_body, label %continue while_body: ; preds = %condition_check - %load_x = load i8, i8* %x, align 1 + %load_x = load i8, ptr %x, align 1 %1 = zext i8 %load_x to i32 %tmpVar = icmp eq i32 %1, 0 %2 = zext i1 %tmpVar to i8 @@ -39,6 +38,6 @@ buffer_block: ; No predecessors! br label %continue1 continue1: ; preds = %buffer_block, %while_body - %load_x3 = load i8, i8* %x, align 1 + %load_x3 = load i8, ptr %x, align 1 br label %condition_check } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap index ebead1266b3..396dc5485ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_number_type_comparing_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,20 +12,20 @@ entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 %y = alloca i16, align 2 - store i16 0, i16* %x, align 2 - store i16 0, i16* %y, align 2 - store i16 0, i16* %baz, align 2 - %load_x = load i16, i16* %x, align 2 + store i16 0, ptr %x, align 2 + store i16 0, ptr %y, align 2 + store i16 0, ptr %baz, align 2 + %load_x = load i16, ptr %x, align 2 %0 = sext i16 %load_x to i32 %tmpVar = icmp eq i32 %0, 3 - %load_x1 = load i16, i16* %x, align 2 + %load_x1 = load i16, ptr %x, align 2 %1 = sext i16 %load_x1 to i32 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %2 = sext i16 %load_y to i32 %tmpVar2 = icmp slt i32 %1, %2 - %load_y3 = load i16, i16* %y, align 2 + %load_y3 = load i16, ptr %y, align 2 %3 = sext i16 %load_y3 to i32 %tmpVar4 = icmp sle i32 %3, 0 - %baz_ret = load i16, i16* %baz, align 2 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap index ebead1266b3..396dc5485ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__aliased_ranged_number_type_comparing_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,20 +12,20 @@ entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 %y = alloca i16, align 2 - store i16 0, i16* %x, align 2 - store i16 0, i16* %y, align 2 - store i16 0, i16* %baz, align 2 - %load_x = load i16, i16* %x, align 2 + store i16 0, ptr %x, align 2 + store i16 0, ptr %y, align 2 + store i16 0, ptr %baz, align 2 + %load_x = load i16, ptr %x, align 2 %0 = sext i16 %load_x to i32 %tmpVar = icmp eq i32 %0, 3 - %load_x1 = load i16, i16* %x, align 2 + %load_x1 = load i16, ptr %x, align 2 %1 = sext i16 %load_x1 to i32 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %2 = sext i16 %load_y to i32 %tmpVar2 = icmp slt i32 %1, %2 - %load_y3 = load i16, i16* %y, align 2 + %load_y3 = load i16, ptr %y, align 2 %3 = sext i16 %load_y3 to i32 %tmpVar4 = icmp sle i32 %3, 0 - %baz_ret = load i16, i16* %baz, align 2 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap index 975f1335adb..123412af205 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,20 +11,20 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var_time = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var_time_of_day = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var_date = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %var_date_and_time = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %load_var_time = load i64, i64* %var_time, align 8 - %load_var_time_of_day = load i64, i64* %var_time_of_day, align 8 + %var_time = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var_time_of_day = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var_date = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var_date_and_time = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %load_var_time = load i64, ptr %var_time, align 8 + %load_var_time_of_day = load i64, ptr %var_time_of_day, align 8 %tmpVar = icmp sgt i64 %load_var_time, %load_var_time_of_day br i1 %tmpVar, label %1, label %2 1: ; preds = %entry - %load_var_time_of_day1 = load i64, i64* %var_time_of_day, align 8 - %load_var_date = load i64, i64* %var_date, align 8 + %load_var_time_of_day1 = load i64, ptr %var_time_of_day, align 8 + %load_var_date = load i64, ptr %var_date, align 8 %tmpVar2 = icmp sgt i64 %load_var_time_of_day1, %load_var_date br label %2 @@ -34,8 +33,8 @@ entry: br i1 %3, label %4, label %5 4: ; preds = %2 - %load_var_date3 = load i64, i64* %var_date, align 8 - %load_var_date_and_time = load i64, i64* %var_date_and_time, align 8 + %load_var_date3 = load i64, ptr %var_date, align 8 + %load_var_date_and_time = load i64, ptr %var_date_and_time, align 8 %tmpVar4 = icmp sgt i64 %load_var_date3, %load_var_date_and_time br label %5 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap index 98e6587af7e..1d701af4abf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap @@ -1,128 +1,127 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { float*, i16, i32, float, double, i8, i16, i32, i64, i8, i16, i32, i64 } +%main = type { ptr, i16, i32, float, double, i8, i16, i32, i64, i8, i16, i32, i64 } @main_instance = global %main zeroinitializer define float @foo() { entry: %foo = alloca float, align 4 - store float 0.000000e+00, float* %foo, align 4 - %foo_ret = load float, float* %foo, align 4 + store float 0.000000e+00, ptr %foo, align 4 + %foo_ret = load float, ptr %foo, align 4 ret float %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %ptr_float = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %var_real = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %var_lreal = getelementptr inbounds %main, %main* %0, i32 0, i32 4 - %var_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 5 - %var_int = getelementptr inbounds %main, %main* %0, i32 0, i32 6 - %var_dint = getelementptr inbounds %main, %main* %0, i32 0, i32 7 - %var_lint = getelementptr inbounds %main, %main* %0, i32 0, i32 8 - %var_usint = getelementptr inbounds %main, %main* %0, i32 0, i32 9 - %var_uint = getelementptr inbounds %main, %main* %0, i32 0, i32 10 - %var_udint = getelementptr inbounds %main, %main* %0, i32 0, i32 11 - %var_ulint = getelementptr inbounds %main, %main* %0, i32 0, i32 12 - store float* %var_real, float** %ptr_float, align 8 - %load_var_sint = load i8, i8* %var_sint, align 1 + %ptr_float = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var_real = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %var_lreal = getelementptr inbounds %main, ptr %0, i32 0, i32 4 + %var_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 5 + %var_int = getelementptr inbounds %main, ptr %0, i32 0, i32 6 + %var_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 7 + %var_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 8 + %var_usint = getelementptr inbounds %main, ptr %0, i32 0, i32 9 + %var_uint = getelementptr inbounds %main, ptr %0, i32 0, i32 10 + %var_udint = getelementptr inbounds %main, ptr %0, i32 0, i32 11 + %var_ulint = getelementptr inbounds %main, ptr %0, i32 0, i32 12 + store ptr %var_real, ptr %ptr_float, align 8 + %load_var_sint = load i8, ptr %var_sint, align 1 %1 = sext i8 %load_var_sint to i32 - %load_var_dint = load i32, i32* %var_dint, align 4 + %load_var_dint = load i32, ptr %var_dint, align 4 %tmpVar = icmp eq i32 %1, %load_var_dint %2 = zext i1 %tmpVar to i8 - %load_var_lreal = load double, double* %var_lreal, align 8 + %load_var_lreal = load double, ptr %var_lreal, align 8 %tmpVar1 = fcmp ogt double 1.050000e+01, %load_var_lreal %3 = zext i1 %tmpVar1 to i8 - %load_var_usint = load i8, i8* %var_usint, align 1 + %load_var_usint = load i8, ptr %var_usint, align 1 %4 = zext i8 %load_var_usint to i32 - %load_var_udint = load i32, i32* %var_udint, align 4 + %load_var_udint = load i32, ptr %var_udint, align 4 %tmpVar2 = icmp ne i32 %4, %load_var_udint %5 = zext i1 %tmpVar2 to i8 - %load_var_uint = load i16, i16* %var_uint, align 2 + %load_var_uint = load i16, ptr %var_uint, align 2 %6 = zext i16 %load_var_uint to i32 %tmpVar3 = icmp sle i32 %6, 40 %7 = zext i1 %tmpVar3 to i8 - %load_var_ulint = load i64, i64* %var_ulint, align 8 + %load_var_ulint = load i64, ptr %var_ulint, align 8 %tmpVar4 = icmp sge i64 10, %load_var_ulint %8 = zext i1 %tmpVar4 to i8 - %load_var_sint5 = load i8, i8* %var_sint, align 1 + %load_var_sint5 = load i8, ptr %var_sint, align 1 %9 = sext i8 %load_var_sint5 to i32 - %load_var_usint6 = load i8, i8* %var_usint, align 1 + %load_var_usint6 = load i8, ptr %var_usint, align 1 %10 = zext i8 %load_var_usint6 to i32 %tmpVar7 = icmp eq i32 %9, %10 %11 = zext i1 %tmpVar7 to i8 - %load_var_uint8 = load i16, i16* %var_uint, align 2 + %load_var_uint8 = load i16, ptr %var_uint, align 2 %12 = zext i16 %load_var_uint8 to i64 - %load_var_lint = load i64, i64* %var_lint, align 8 + %load_var_lint = load i64, ptr %var_lint, align 8 %tmpVar9 = icmp sle i64 %12, %load_var_lint %13 = zext i1 %tmpVar9 to i8 - %load_var_dint10 = load i32, i32* %var_dint, align 4 + %load_var_dint10 = load i32, ptr %var_dint, align 4 %14 = sext i32 %load_var_dint10 to i64 - %load_var_ulint11 = load i64, i64* %var_ulint, align 8 + %load_var_ulint11 = load i64, ptr %var_ulint, align 8 %tmpVar12 = icmp sge i64 %14, %load_var_ulint11 %15 = zext i1 %tmpVar12 to i8 - %load_var_lint13 = load i64, i64* %var_lint, align 8 - %load_a = load i16, i16* %a, align 2 + %load_var_lint13 = load i64, ptr %var_lint, align 8 + %load_a = load i16, ptr %a, align 2 %16 = sext i16 %load_a to i64 %tmpVar14 = icmp slt i64 %load_var_lint13, %16 %17 = zext i1 %tmpVar14 to i8 - %load_a15 = load i16, i16* %a, align 2 + %load_a15 = load i16, ptr %a, align 2 %18 = sext i16 %load_a15 to i32 - %load_var_sint16 = load i8, i8* %var_sint, align 1 + %load_var_sint16 = load i8, ptr %var_sint, align 1 %19 = sext i8 %load_var_sint16 to i32 %tmpVar17 = icmp sgt i32 %18, %19 %20 = zext i1 %tmpVar17 to i8 - %load_b = load i32, i32* %b, align 4 + %load_b = load i32, ptr %b, align 4 %21 = sext i32 %load_b to i64 - %load_var_lint18 = load i64, i64* %var_lint, align 8 + %load_var_lint18 = load i64, ptr %var_lint, align 8 %tmpVar19 = icmp slt i64 %21, %load_var_lint18 %22 = zext i1 %tmpVar19 to i8 - %load_b20 = load i32, i32* %b, align 4 + %load_b20 = load i32, ptr %b, align 4 %tmpVar21 = icmp ne i32 5, %load_b20 br i1 %tmpVar21, label %23, label %24 23: ; preds = %entry - %load_b22 = load i32, i32* %b, align 4 + %load_b22 = load i32, ptr %b, align 4 %tmpVar23 = icmp ne i32 %load_b22, 17 br label %24 24: ; preds = %23, %entry %25 = phi i1 [ %tmpVar21, %entry ], [ %tmpVar23, %23 ] %26 = zext i1 %25 to i8 - %load_ptr_float = load float*, float** %ptr_float, align 8 - %load_var_usint24 = load i8, i8* %var_usint, align 1 + %load_ptr_float = load ptr, ptr %ptr_float, align 8 + %load_var_usint24 = load i8, ptr %var_usint, align 1 %27 = zext i8 %load_var_usint24 to i64 - %28 = ptrtoint float* %load_ptr_float to i64 + %28 = ptrtoint ptr %load_ptr_float to i64 %tmpVar25 = icmp sle i64 %28, %27 %29 = zext i1 %tmpVar25 to i8 - %load_a26 = load i16, i16* %a, align 2 + %load_a26 = load i16, ptr %a, align 2 %30 = sext i16 %load_a26 to i64 - %load_ptr_float27 = load float*, float** %ptr_float, align 8 - %31 = ptrtoint float* %load_ptr_float27 to i64 + %load_ptr_float27 = load ptr, ptr %ptr_float, align 8 + %31 = ptrtoint ptr %load_ptr_float27 to i64 %tmpVar28 = icmp eq i64 %30, %31 %32 = zext i1 %tmpVar28 to i8 %call = call float @foo() %tmpVar29 = fcmp one float %call, 4.050000e+01 %33 = zext i1 %tmpVar29 to i8 - %load_var_udint30 = load i32, i32* %var_udint, align 4 + %load_var_udint30 = load i32, ptr %var_udint, align 4 %34 = uitofp i32 %load_var_udint30 to float %call31 = call float @foo() %tmpVar32 = fcmp ole float %34, %call31 %35 = zext i1 %tmpVar32 to i8 %call33 = call float @foo() %36 = fpext float %call33 to double - %load_var_lint34 = load i64, i64* %var_lint, align 8 + %load_var_lint34 = load i64, ptr %var_lint, align 8 %37 = sitofp i64 %load_var_lint34 to double %tmpVar35 = fcmp oeq double %36, %37 %38 = zext i1 %tmpVar35 to i8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap index 84315f7b567..c96ed8e2b89 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap @@ -1,103 +1,102 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { i16*, i16, i32, i8, i16, i32, i64, i8, i16, i32, i64 } +%main = type { ptr, i16, i32, i8, i16, i32, i64, i8, i16, i32, i64 } @main_instance = global %main zeroinitializer define i64 @foo() { entry: %foo = alloca i64, align 8 - store i64 0, i64* %foo, align 8 - %foo_ret = load i64, i64* %foo, align 8 + store i64 0, ptr %foo, align 8 + %foo_ret = load i64, ptr %foo, align 8 ret i64 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %ptr_int = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %var_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %var_int = getelementptr inbounds %main, %main* %0, i32 0, i32 4 - %var_dint = getelementptr inbounds %main, %main* %0, i32 0, i32 5 - %var_lint = getelementptr inbounds %main, %main* %0, i32 0, i32 6 - %var_usint = getelementptr inbounds %main, %main* %0, i32 0, i32 7 - %var_uint = getelementptr inbounds %main, %main* %0, i32 0, i32 8 - %var_udint = getelementptr inbounds %main, %main* %0, i32 0, i32 9 - %var_ulint = getelementptr inbounds %main, %main* %0, i32 0, i32 10 - store i16* %var_int, i16** %ptr_int, align 8 - %load_var_sint = load i8, i8* %var_sint, align 1 + %ptr_int = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %var_int = getelementptr inbounds %main, ptr %0, i32 0, i32 4 + %var_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 5 + %var_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 6 + %var_usint = getelementptr inbounds %main, ptr %0, i32 0, i32 7 + %var_uint = getelementptr inbounds %main, ptr %0, i32 0, i32 8 + %var_udint = getelementptr inbounds %main, ptr %0, i32 0, i32 9 + %var_ulint = getelementptr inbounds %main, ptr %0, i32 0, i32 10 + store ptr %var_int, ptr %ptr_int, align 8 + %load_var_sint = load i8, ptr %var_sint, align 1 %1 = sext i8 %load_var_sint to i32 - %load_var_dint = load i32, i32* %var_dint, align 4 + %load_var_dint = load i32, ptr %var_dint, align 4 %tmpVar = icmp eq i32 %1, %load_var_dint - %load_var_int = load i16, i16* %var_int, align 2 + %load_var_int = load i16, ptr %var_int, align 2 %2 = sext i16 %load_var_int to i32 %tmpVar1 = icmp slt i32 %2, 30 - %load_var_lint = load i64, i64* %var_lint, align 8 + %load_var_lint = load i64, ptr %var_lint, align 8 %tmpVar2 = icmp sgt i64 10, %load_var_lint - %load_var_usint = load i8, i8* %var_usint, align 1 + %load_var_usint = load i8, ptr %var_usint, align 1 %3 = zext i8 %load_var_usint to i32 - %load_var_udint = load i32, i32* %var_udint, align 4 + %load_var_udint = load i32, ptr %var_udint, align 4 %tmpVar3 = icmp ne i32 %3, %load_var_udint - %load_var_uint = load i16, i16* %var_uint, align 2 + %load_var_uint = load i16, ptr %var_uint, align 2 %4 = zext i16 %load_var_uint to i32 %tmpVar4 = icmp sle i32 %4, 40 - %load_var_ulint = load i64, i64* %var_ulint, align 8 + %load_var_ulint = load i64, ptr %var_ulint, align 8 %tmpVar5 = icmp sge i64 10, %load_var_ulint - %load_var_sint6 = load i8, i8* %var_sint, align 1 + %load_var_sint6 = load i8, ptr %var_sint, align 1 %5 = sext i8 %load_var_sint6 to i32 - %load_var_usint7 = load i8, i8* %var_usint, align 1 + %load_var_usint7 = load i8, ptr %var_usint, align 1 %6 = zext i8 %load_var_usint7 to i32 %tmpVar8 = icmp eq i32 %5, %6 - %load_var_uint9 = load i16, i16* %var_uint, align 2 + %load_var_uint9 = load i16, ptr %var_uint, align 2 %7 = zext i16 %load_var_uint9 to i64 - %load_var_lint10 = load i64, i64* %var_lint, align 8 + %load_var_lint10 = load i64, ptr %var_lint, align 8 %tmpVar11 = icmp sle i64 %7, %load_var_lint10 - %load_var_dint12 = load i32, i32* %var_dint, align 4 + %load_var_dint12 = load i32, ptr %var_dint, align 4 %8 = sext i32 %load_var_dint12 to i64 - %load_var_ulint13 = load i64, i64* %var_ulint, align 8 + %load_var_ulint13 = load i64, ptr %var_ulint, align 8 %tmpVar14 = icmp sge i64 %8, %load_var_ulint13 - %load_var_lint15 = load i64, i64* %var_lint, align 8 - %load_a = load i16, i16* %a, align 2 + %load_var_lint15 = load i64, ptr %var_lint, align 8 + %load_a = load i16, ptr %a, align 2 %9 = sext i16 %load_a to i64 %tmpVar16 = icmp slt i64 %load_var_lint15, %9 - %load_a17 = load i16, i16* %a, align 2 + %load_a17 = load i16, ptr %a, align 2 %10 = sext i16 %load_a17 to i32 - %load_var_sint18 = load i8, i8* %var_sint, align 1 + %load_var_sint18 = load i8, ptr %var_sint, align 1 %11 = sext i8 %load_var_sint18 to i32 %tmpVar19 = icmp sgt i32 %10, %11 - %load_b = load i32, i32* %b, align 4 + %load_b = load i32, ptr %b, align 4 %12 = sext i32 %load_b to i64 - %load_var_lint20 = load i64, i64* %var_lint, align 8 + %load_var_lint20 = load i64, ptr %var_lint, align 8 %tmpVar21 = icmp slt i64 %12, %load_var_lint20 - %load_b22 = load i32, i32* %b, align 4 + %load_b22 = load i32, ptr %b, align 4 %tmpVar23 = icmp ne i32 5, %load_b22 - %load_ptr_int = load i16*, i16** %ptr_int, align 8 - %load_var_usint24 = load i8, i8* %var_usint, align 1 + %load_ptr_int = load ptr, ptr %ptr_int, align 8 + %load_var_usint24 = load i8, ptr %var_usint, align 1 %13 = zext i8 %load_var_usint24 to i64 - %14 = ptrtoint i16* %load_ptr_int to i64 + %14 = ptrtoint ptr %load_ptr_int to i64 %tmpVar25 = icmp sle i64 %14, %13 - %load_a26 = load i16, i16* %a, align 2 + %load_a26 = load i16, ptr %a, align 2 %15 = sext i16 %load_a26 to i64 - %load_ptr_int27 = load i16*, i16** %ptr_int, align 8 - %16 = ptrtoint i16* %load_ptr_int27 to i64 + %load_ptr_int27 = load ptr, ptr %ptr_int, align 8 + %16 = ptrtoint ptr %load_ptr_int27 to i64 %tmpVar28 = icmp eq i64 %15, %16 %call = call i64 @foo() %tmpVar29 = icmp ne i64 %call, 40 - %load_var_udint30 = load i32, i32* %var_udint, align 4 + %load_var_udint30 = load i32, ptr %var_udint, align 4 %17 = zext i32 %load_var_udint30 to i64 %call31 = call i64 @foo() %tmpVar32 = icmp sle i64 %17, %call31 %call33 = call i64 @foo() - %load_var_lint34 = load i64, i64* %var_lint, align 8 + %load_var_lint34 = load i64, ptr %var_lint, align 8 %tmpVar35 = icmp eq i64 %call33, %load_var_lint34 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap index 2bb84baada0..53cb11d6ac4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap @@ -1,65 +1,64 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { i16, i16, i16*, i8 } +%main = type { i16, i16, ptr, i8 } -@main_instance = global %main { i16 10, i16 20, i16* null, i8 0 } +@main_instance = global %main { i16 10, i16 20, ptr null, i8 0 } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %comp = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - store i16* %x, i16** %pt, align 8 - %load_pt = load i16*, i16** %pt, align 8 - %load_pt1 = load i16*, i16** %pt, align 8 - %1 = ptrtoint i16* %load_pt to i64 - %2 = ptrtoint i16* %load_pt1 to i64 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %comp = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + store ptr %x, ptr %pt, align 8 + %load_pt = load ptr, ptr %pt, align 8 + %load_pt1 = load ptr, ptr %pt, align 8 + %1 = ptrtoint ptr %load_pt to i64 + %2 = ptrtoint ptr %load_pt1 to i64 %tmpVar = icmp eq i64 %1, %2 %3 = zext i1 %tmpVar to i8 - store i8 %3, i8* %comp, align 1 - %load_pt2 = load i16*, i16** %pt, align 8 - %load_y = load i16, i16* %y, align 2 + store i8 %3, ptr %comp, align 1 + %load_pt2 = load ptr, ptr %pt, align 8 + %load_y = load i16, ptr %y, align 2 %4 = sext i16 %load_y to i64 - %5 = ptrtoint i16* %load_pt2 to i64 + %5 = ptrtoint ptr %load_pt2 to i64 %tmpVar3 = icmp ne i64 %5, %4 %6 = zext i1 %tmpVar3 to i8 - store i8 %6, i8* %comp, align 1 - %load_pt4 = load i16*, i16** %pt, align 8 - %load_pt5 = load i16*, i16** %pt, align 8 - %7 = ptrtoint i16* %load_pt4 to i64 - %8 = ptrtoint i16* %load_pt5 to i64 + store i8 %6, ptr %comp, align 1 + %load_pt4 = load ptr, ptr %pt, align 8 + %load_pt5 = load ptr, ptr %pt, align 8 + %7 = ptrtoint ptr %load_pt4 to i64 + %8 = ptrtoint ptr %load_pt5 to i64 %tmpVar6 = icmp slt i64 %7, %8 %9 = zext i1 %tmpVar6 to i8 - store i8 %9, i8* %comp, align 1 - %load_pt7 = load i16*, i16** %pt, align 8 - %load_y8 = load i16, i16* %y, align 2 + store i8 %9, ptr %comp, align 1 + %load_pt7 = load ptr, ptr %pt, align 8 + %load_y8 = load i16, ptr %y, align 2 %10 = sext i16 %load_y8 to i64 - %11 = ptrtoint i16* %load_pt7 to i64 + %11 = ptrtoint ptr %load_pt7 to i64 %tmpVar9 = icmp sgt i64 %11, %10 %12 = zext i1 %tmpVar9 to i8 - store i8 %12, i8* %comp, align 1 - %load_pt10 = load i16*, i16** %pt, align 8 - %load_pt11 = load i16*, i16** %pt, align 8 - %13 = ptrtoint i16* %load_pt10 to i64 - %14 = ptrtoint i16* %load_pt11 to i64 + store i8 %12, ptr %comp, align 1 + %load_pt10 = load ptr, ptr %pt, align 8 + %load_pt11 = load ptr, ptr %pt, align 8 + %13 = ptrtoint ptr %load_pt10 to i64 + %14 = ptrtoint ptr %load_pt11 to i64 %tmpVar12 = icmp sle i64 %13, %14 %15 = zext i1 %tmpVar12 to i8 - store i8 %15, i8* %comp, align 1 - %load_y13 = load i16, i16* %y, align 2 + store i8 %15, ptr %comp, align 1 + %load_y13 = load i16, ptr %y, align 2 %16 = sext i16 %load_y13 to i64 - %load_pt14 = load i16*, i16** %pt, align 8 - %17 = ptrtoint i16* %load_pt14 to i64 + %load_pt14 = load ptr, ptr %pt, align 8 + %17 = ptrtoint ptr %load_pt14 to i64 %tmpVar15 = icmp sge i64 %16, %17 %18 = zext i1 %tmpVar15 to i8 - store i8 %18, i8* %comp, align 1 + store i8 %18, ptr %comp, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap index 22e8294bc2f..3fefaeaa816 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap @@ -1,66 +1,65 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { i16*, i16, i8 } +%main = type { ptr, i16, i8 } @main_instance = global %main zeroinitializer define i64 @foo() { entry: %foo = alloca i64, align 8 - store i64 0, i64* %foo, align 8 - %foo_ret = load i64, i64* %foo, align 8 + store i64 0, ptr %foo, align 8 + %foo_ret = load i64, ptr %foo, align 8 ret i64 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %comp = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - store i16* %x, i16** %pt, align 8 - %load_pt = load i16*, i16** %pt, align 8 + %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %comp = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + store ptr %x, ptr %pt, align 8 + %load_pt = load ptr, ptr %pt, align 8 %call = call i64 @foo() - %1 = ptrtoint i16* %load_pt to i64 + %1 = ptrtoint ptr %load_pt to i64 %tmpVar = icmp eq i64 %1, %call %2 = zext i1 %tmpVar to i8 - store i8 %2, i8* %comp, align 1 - %load_pt1 = load i16*, i16** %pt, align 8 + store i8 %2, ptr %comp, align 1 + %load_pt1 = load ptr, ptr %pt, align 8 %call2 = call i64 @foo() - %3 = ptrtoint i16* %load_pt1 to i64 + %3 = ptrtoint ptr %load_pt1 to i64 %tmpVar3 = icmp ne i64 %3, %call2 %4 = zext i1 %tmpVar3 to i8 - store i8 %4, i8* %comp, align 1 - %load_pt4 = load i16*, i16** %pt, align 8 + store i8 %4, ptr %comp, align 1 + %load_pt4 = load ptr, ptr %pt, align 8 %call5 = call i64 @foo() - %5 = ptrtoint i16* %load_pt4 to i64 + %5 = ptrtoint ptr %load_pt4 to i64 %tmpVar6 = icmp slt i64 %5, %call5 %6 = zext i1 %tmpVar6 to i8 - store i8 %6, i8* %comp, align 1 - %load_pt7 = load i16*, i16** %pt, align 8 + store i8 %6, ptr %comp, align 1 + %load_pt7 = load ptr, ptr %pt, align 8 %call8 = call i64 @foo() - %7 = ptrtoint i16* %load_pt7 to i64 + %7 = ptrtoint ptr %load_pt7 to i64 %tmpVar9 = icmp sgt i64 %7, %call8 %8 = zext i1 %tmpVar9 to i8 - store i8 %8, i8* %comp, align 1 - %load_pt10 = load i16*, i16** %pt, align 8 + store i8 %8, ptr %comp, align 1 + %load_pt10 = load ptr, ptr %pt, align 8 %call11 = call i64 @foo() - %9 = ptrtoint i16* %load_pt10 to i64 + %9 = ptrtoint ptr %load_pt10 to i64 %tmpVar12 = icmp sle i64 %9, %call11 %10 = zext i1 %tmpVar12 to i8 - store i8 %10, i8* %comp, align 1 - %load_pt13 = load i16*, i16** %pt, align 8 + store i8 %10, ptr %comp, align 1 + %load_pt13 = load ptr, ptr %pt, align 8 %call14 = call i64 @foo() - %11 = ptrtoint i16* %load_pt13 to i64 + %11 = ptrtoint ptr %load_pt13 to i64 %tmpVar15 = icmp sge i64 %11, %call14 %12 = zext i1 %tmpVar15 to i8 - store i8 %12, i8* %comp, align 1 + store i8 %12, ptr %comp, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap index ebead1266b3..396dc5485ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__ranged_number_type_comparing_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,20 +12,20 @@ entry: %baz = alloca i16, align 2 %x = alloca i16, align 2 %y = alloca i16, align 2 - store i16 0, i16* %x, align 2 - store i16 0, i16* %y, align 2 - store i16 0, i16* %baz, align 2 - %load_x = load i16, i16* %x, align 2 + store i16 0, ptr %x, align 2 + store i16 0, ptr %y, align 2 + store i16 0, ptr %baz, align 2 + %load_x = load i16, ptr %x, align 2 %0 = sext i16 %load_x to i32 %tmpVar = icmp eq i32 %0, 3 - %load_x1 = load i16, i16* %x, align 2 + %load_x1 = load i16, ptr %x, align 2 %1 = sext i16 %load_x1 to i32 - %load_y = load i16, i16* %y, align 2 + %load_y = load i16, ptr %y, align 2 %2 = sext i16 %load_y to i32 %tmpVar2 = icmp slt i32 %1, %2 - %load_y3 = load i16, i16* %y, align 2 + %load_y3 = load i16, ptr %y, align 2 %3 = sext i16 %load_y3 to i32 %tmpVar4 = icmp sle i32 %3, 0 - %baz_ret = load i16, i16* %baz, align 2 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap index a78c1bb52e8..f2895a770fb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,19 +10,17 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"a\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) { +define i8 @STRING_EQUAL(ptr %0, ptr %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_EQUAL, align 1 - %STRING_EQUAL_ret = load i8, i8* %STRING_EQUAL, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_EQUAL, align 1 + %STRING_EQUAL_ret = load i8, ptr %STRING_EQUAL, align 1 ret i8 %STRING_EQUAL_ret } @@ -33,27 +30,23 @@ entry: %a = alloca [81 x i8], align 1 %b = alloca [81 x i8], align 1 %result = alloca i8, align 1 - %0 = bitcast [81 x i8]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [81 x i8]* %b to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i8 0, i8* %result, align 1 - store i16 0, i16* %baz, align 2 - %call = call i8 @STRING_EQUAL(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_1, i32 0, i32 0)) - store i8 %call, i8* %result, align 1 - %2 = bitcast [81 x i8]* %a to i8* - %3 = bitcast [81 x i8]* %b to i8* - %call1 = call i8 @STRING_EQUAL(i8* %2, i8* %3) - store i8 %call1, i8* %result, align 1 - %baz_ret = load i16, i16* %baz, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %b, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i8 0, ptr %result, align 1 + store i16 0, ptr %baz, align 2 + %call = call i8 @STRING_EQUAL(ptr @utf08_literal_0, ptr @utf08_literal_1) + store i8 %call, ptr %result, align 1 + %call1 = call i8 @STRING_EQUAL(ptr %a, ptr %b) + store i8 %call1, ptr %result, align 1 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap index e5b92798c0c..50456f10aa7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,19 +10,17 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"a\00" @utf08_literal_1 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) { +define i8 @STRING_EQUAL(ptr %0, ptr %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_EQUAL, align 1 - %STRING_EQUAL_ret = load i8, i8* %STRING_EQUAL, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_EQUAL, align 1 + %STRING_EQUAL_ret = load i8, ptr %STRING_EQUAL, align 1 ret i8 %STRING_EQUAL_ret } @@ -33,27 +30,23 @@ entry: %a = alloca [81 x i8], align 1 %b = alloca [81 x i8], align 1 %result = alloca i8, align 1 - %0 = bitcast [81 x i8]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [81 x i8]* %b to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i8 0, i8* %result, align 1 - store i16 0, i16* %baz, align 2 - %2 = bitcast [81 x i8]* %a to i8* - %call = call i8 @STRING_EQUAL(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_1, i32 0, i32 0)) - store i8 %call, i8* %result, align 1 - %3 = bitcast [81 x i8]* %b to i8* - %call1 = call i8 @STRING_EQUAL(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0), i8* %3) - store i8 %call1, i8* %result, align 1 - %baz_ret = load i16, i16* %baz, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %b, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i8 0, ptr %result, align 1 + store i16 0, ptr %baz, align 2 + %call = call i8 @STRING_EQUAL(ptr %a, ptr @utf08_literal_1) + store i8 %call, ptr %result, align 1 + %call1 = call i8 @STRING_EQUAL(ptr @utf08_literal_0, ptr %b) + store i8 %call1, ptr %result, align 1 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap index 5d66343c854..67c2ebe6d20 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,35 +9,31 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_GREATER(i8* %0, i8* %1) { +define i8 @STRING_GREATER(ptr %0, ptr %1) { entry: %STRING_GREATER = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_GREATER, align 1 - %STRING_GREATER_ret = load i8, i8* %STRING_GREATER, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_GREATER, align 1 + %STRING_GREATER_ret = load i8, ptr %STRING_GREATER, align 1 ret i8 %STRING_GREATER_ret } -define i8 @STRING_EQUAL(i8* %0, i8* %1) { +define i8 @STRING_EQUAL(ptr %0, ptr %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_EQUAL, align 1 - %STRING_EQUAL_ret = load i8, i8* %STRING_EQUAL, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_EQUAL, align 1 + %STRING_EQUAL_ret = load i8, ptr %STRING_EQUAL, align 1 ret i8 %STRING_EQUAL_ret } @@ -48,36 +43,32 @@ entry: %a = alloca [81 x i8], align 1 %b = alloca [81 x i8], align 1 %result = alloca i8, align 1 - %0 = bitcast [81 x i8]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [81 x i8]* %b to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i8 0, i8* %result, align 1 - store i16 0, i16* %baz, align 2 - %2 = bitcast [81 x i8]* %a to i8* - %call = call i8 @STRING_EQUAL(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0)) - %3 = icmp ne i8 %call, 0 - br i1 %3, label %7, label %4 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %b, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i8 0, ptr %result, align 1 + store i16 0, ptr %baz, align 2 + %call = call i8 @STRING_EQUAL(ptr %a, ptr @utf08_literal_0) + %0 = icmp ne i8 %call, 0 + br i1 %0, label %3, label %1 -4: ; preds = %entry - %5 = bitcast [81 x i8]* %a to i8* - %call1 = call i8 @STRING_GREATER(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0)) - %6 = icmp ne i8 %call1, 0 - br label %7 +1: ; preds = %entry + %call1 = call i8 @STRING_GREATER(ptr %a, ptr @utf08_literal_0) + %2 = icmp ne i8 %call1, 0 + br label %3 -7: ; preds = %4, %entry - %8 = phi i1 [ %3, %entry ], [ %6, %4 ] - %9 = zext i1 %8 to i8 - store i8 %9, i8* %result, align 1 - %baz_ret = load i16, i16* %baz, align 2 +3: ; preds = %1, %entry + %4 = phi i1 [ %0, %entry ], [ %2, %1 ] + %5 = zext i1 %4 to i8 + store i8 %5, ptr %result, align 1 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap index 5e8888cf23a..2c34cd23396 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,19 +9,17 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_GREATER(i8* %0, i8* %1) { +define i8 @STRING_GREATER(ptr %0, ptr %1) { entry: %STRING_GREATER = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_GREATER, align 1 - %STRING_GREATER_ret = load i8, i8* %STRING_GREATER, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_GREATER, align 1 + %STRING_GREATER_ret = load i8, ptr %STRING_GREATER, align 1 ret i8 %STRING_GREATER_ret } @@ -31,22 +28,20 @@ entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 %result = alloca i8, align 1 - %0 = bitcast [81 x i8]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i8 0, i8* %result, align 1 - store i16 0, i16* %baz, align 2 - %1 = bitcast [81 x i8]* %a to i8* - %call = call i8 @STRING_GREATER(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0)) - store i8 %call, i8* %result, align 1 - %baz_ret = load i16, i16* %baz, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i8 0, ptr %result, align 1 + store i16 0, ptr %baz, align 2 + %call = call i8 @STRING_GREATER(ptr %a, ptr @utf08_literal_0) + store i8 %call, ptr %result, align 1 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap index d99024bc6f0..223d63ee679 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,19 +9,17 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_LESS(i8* %0, i8* %1) { +define i8 @STRING_LESS(ptr %0, ptr %1) { entry: %STRING_LESS = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_LESS, align 1 - %STRING_LESS_ret = load i8, i8* %STRING_LESS, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_LESS, align 1 + %STRING_LESS_ret = load i8, ptr %STRING_LESS, align 1 ret i8 %STRING_LESS_ret } @@ -31,22 +28,20 @@ entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 %result = alloca i8, align 1 - %0 = bitcast [81 x i8]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i8 0, i8* %result, align 1 - store i16 0, i16* %baz, align 2 - %1 = bitcast [81 x i8]* %a to i8* - %call = call i8 @STRING_LESS(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0)) - store i8 %call, i8* %result, align 1 - %baz_ret = load i16, i16* %baz, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i8 0, ptr %result, align 1 + store i16 0, ptr %baz, align 2 + %call = call i8 @STRING_LESS(ptr %a, ptr @utf08_literal_0) + store i8 %call, ptr %result, align 1 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap index 93dc818a6e5..694618d8f6e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,19 +9,17 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) { +define i8 @STRING_EQUAL(ptr %0, ptr %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_EQUAL, align 1 - %STRING_EQUAL_ret = load i8, i8* %STRING_EQUAL, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_EQUAL, align 1 + %STRING_EQUAL_ret = load i8, ptr %STRING_EQUAL, align 1 ret i8 %STRING_EQUAL_ret } @@ -31,25 +28,23 @@ entry: %baz = alloca i16, align 2 %a = alloca [81 x i8], align 1 %result = alloca i8, align 1 - %0 = bitcast [81 x i8]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i8 0, i8* %result, align 1 - store i16 0, i16* %baz, align 2 - %1 = bitcast [81 x i8]* %a to i8* - %call = call i8 @STRING_EQUAL(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0)) - %2 = icmp ne i8 %call, 0 - %tmpVar = xor i1 %2, true - %3 = zext i1 %tmpVar to i8 - store i8 %3, i8* %result, align 1 - %baz_ret = load i16, i16* %baz, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i8 0, ptr %result, align 1 + store i16 0, ptr %baz, align 2 + %call = call i8 @STRING_EQUAL(ptr %a, ptr @utf08_literal_0) + %0 = icmp ne i8 %call, 0 + %tmpVar = xor i1 %0, true + %1 = zext i1 %tmpVar to i8 + store i8 %1, ptr %result, align 1 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap index 95e590d5bfc..84f67d3e707 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/compare_instructions_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,35 +9,31 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [2 x i8] c"b\00" -define i8 @STRING_LESS(i8* %0, i8* %1) { +define i8 @STRING_LESS(ptr %0, ptr %1) { entry: %STRING_LESS = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_LESS, align 1 - %STRING_LESS_ret = load i8, i8* %STRING_LESS, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_LESS, align 1 + %STRING_LESS_ret = load i8, ptr %STRING_LESS, align 1 ret i8 %STRING_LESS_ret } -define i8 @STRING_EQUAL(i8* %0, i8* %1) { +define i8 @STRING_EQUAL(ptr %0, ptr %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_EQUAL, align 1 - %STRING_EQUAL_ret = load i8, i8* %STRING_EQUAL, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_EQUAL, align 1 + %STRING_EQUAL_ret = load i8, ptr %STRING_EQUAL, align 1 ret i8 %STRING_EQUAL_ret } @@ -48,36 +43,32 @@ entry: %a = alloca [81 x i8], align 1 %b = alloca [81 x i8], align 1 %result = alloca i8, align 1 - %0 = bitcast [81 x i8]* %a to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [81 x i8]* %b to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store i8 0, i8* %result, align 1 - store i16 0, i16* %baz, align 2 - %2 = bitcast [81 x i8]* %a to i8* - %call = call i8 @STRING_EQUAL(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0)) - %3 = icmp ne i8 %call, 0 - br i1 %3, label %7, label %4 + call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %b, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store i8 0, ptr %result, align 1 + store i16 0, ptr %baz, align 2 + %call = call i8 @STRING_EQUAL(ptr %a, ptr @utf08_literal_0) + %0 = icmp ne i8 %call, 0 + br i1 %0, label %3, label %1 -4: ; preds = %entry - %5 = bitcast [81 x i8]* %a to i8* - %call1 = call i8 @STRING_LESS(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0)) - %6 = icmp ne i8 %call1, 0 - br label %7 +1: ; preds = %entry + %call1 = call i8 @STRING_LESS(ptr %a, ptr @utf08_literal_0) + %2 = icmp ne i8 %call1, 0 + br label %3 -7: ; preds = %4, %entry - %8 = phi i1 [ %3, %entry ], [ %6, %4 ] - %9 = zext i1 %8 to i8 - store i8 %9, i8* %result, align 1 - %baz_ret = load i16, i16* %baz, align 2 +3: ; preds = %1, %entry + %4 = phi i1 [ %0, %entry ], [ %2, %1 ] + %5 = zext i1 %4 to i8 + store i8 %5, ptr %result, align 1 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap index dc6e405fac6..f9cd99b11a8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/constants_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,15 +12,14 @@ target triple = "[filtered]" @const_arr = unnamed_addr constant [4 x i16] [i16 1, i16 2, i16 3, i16 4] @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %arr = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %1 = bitcast [4 x i16]* %arr to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast ([4 x i16]* @const_arr to i8*), i64 ptrtoint ([4 x i16]* getelementptr ([4 x i16], [4 x i16]* null, i32 1) to i64), i1 false) + %arr = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr, ptr align 1 @const_arr, i64 ptrtoint (ptr getelementptr ([4 x i16], ptr null, i32 1) to i64), i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap index 27329fb55ed..97c2af33b75 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/constants_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,15 +12,14 @@ target triple = "[filtered]" @const_str = unnamed_addr constant [81 x i8] c"global constant string\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %str = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %1 = bitcast [81 x i8]* %str to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([81 x i8], [81 x i8]* @const_str, i32 0, i32 0), i32 80, i1 false) + %str = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %str, ptr align 1 @const_str, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap index 21412d7c014..a42d25363b0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/constants_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,15 +14,14 @@ target triple = "[filtered]" @__Point__init = unnamed_addr constant %Point zeroinitializer @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %strct = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %1 = bitcast %Point* %strct to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 bitcast (%Point* @const_strct to i8*), i64 ptrtoint (%Point* getelementptr (%Point, %Point* null, i32 1) to i64), i1 false) + %strct = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %strct, ptr align 1 @const_strct, i64 ptrtoint (ptr getelementptr (%Point, ptr null, i32 1) to i64), i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap index ce5f64fa6d0..d3739b66be6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap @@ -10,49 +10,49 @@ target triple = "[filtered]" %myStruct = type { i32, %myStruct2 } %myStruct2 = type { i32, double } -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !0 @__myStruct2__init = unnamed_addr constant %myStruct2 zeroinitializer, !dbg !14 @gStruct = global %myStruct zeroinitializer, !dbg !17 -define void @__init_mystruct(%myStruct* %0) { +define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 - %deref = load %myStruct*, %myStruct** %self, align 8 - %b = getelementptr inbounds %myStruct, %myStruct* %deref, i32 0, i32 1 - call void @__init_mystruct2(%myStruct2* %b) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %myStruct, ptr %deref, i32 0, i32 1 + call void @__init_mystruct2(ptr %b) ret void } -define void @__init_mystruct2(%myStruct2* %0) { +define void @__init_mystruct2(ptr %0) { entry: - %self = alloca %myStruct2*, align 8 - store %myStruct2* %0, %myStruct2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_myStruct(%myStruct* %0) { +define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 - %deref = load %myStruct*, %myStruct** %self, align 8 - %b = getelementptr inbounds %myStruct, %myStruct* %deref, i32 0, i32 1 - call void @__user_init_myStruct2(%myStruct2* %b) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %b = getelementptr inbounds %myStruct, ptr %deref, i32 0, i32 1 + call void @__user_init_myStruct2(ptr %b) ret void } -define void @__user_init_myStruct2(%myStruct2* %0) { +define void @__user_init_myStruct2(ptr %0) { entry: - %self = alloca %myStruct2*, align 8 - store %myStruct2* %0, %myStruct2** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_mystruct(%myStruct* @gStruct) - call void @__user_init_myStruct(%myStruct* @gStruct) + call void @__init_mystruct(ptr @gStruct) + call void @__user_init_myStruct(ptr @gStruct) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap index 9ff4815e4c8..4f08375c019 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_pointer_added_to_debug_info.snap @@ -7,8 +7,8 @@ source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -@a = global i32* null, !dbg !0 -@b = global [11 x i32]* null, !dbg !6 +@a = global ptr null, !dbg !0 +@b = global ptr null, !dbg !6 !llvm.module.flags = !{!13, !14} !llvm.dbg.cu = !{!15} diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap index 3e6044abdc9..3d47d4a9898 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_struct_added_to_debug_info.snap @@ -10,28 +10,28 @@ target triple = "[filtered]" %myStruct = type { i32, double, [11 x i32] } @b = global [11 x %myStruct] zeroinitializer, !dbg !0 -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer, !dbg !14 @gStruct = global %myStruct zeroinitializer, !dbg !17 -define void @__init_mystruct(%myStruct* %0) { +define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_myStruct(%myStruct* %0) { +define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_mystruct(%myStruct* @gStruct) - call void @__user_init_myStruct(%myStruct* @gStruct) + call void @__init_mystruct(ptr @gStruct) + call void @__user_init_myStruct(ptr @gStruct) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap index 4b2293d2d98..86e7131da88 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__bitaccess_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/directaccess_test.rs expression: prog -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,26 +12,26 @@ entry: %main = alloca i16, align 2 %a = alloca i8, align 1 %b = alloca i16, align 2 - store i8 0, i8* %a, align 1 - store i16 1, i16* %b, align 2 - store i16 0, i16* %main, align 2 - %0 = load i8, i8* %a, align 1 + store i8 0, ptr %a, align 1 + store i16 1, ptr %b, align 2 + store i16 0, ptr %main, align 2 + %0 = load i8, ptr %a, align 1 %erase = and i8 %0, -3 %or = or i8 %erase, 2 - store i8 %or, i8* %a, align 1 - %1 = load i8, i8* %a, align 1 + store i8 %or, ptr %a, align 1 + %1 = load i8, ptr %a, align 1 %erase1 = and i8 %1, -5 %or2 = or i8 %erase1, 0 - store i8 %or2, i8* %a, align 1 - %2 = load i8, i8* %a, align 1 - %load_b = load i16, i16* %b, align 2 + store i8 %or2, ptr %a, align 1 + %2 = load i8, ptr %a, align 1 + %load_b = load i16, ptr %b, align 2 %3 = trunc i16 %load_b to i8 %shift = shl i8 1, %3 %invert = xor i8 %shift, -1 %erase3 = and i8 %2, %invert %value = shl i8 0, %3 %or4 = or i8 %erase3, %value - store i8 %or4, i8* %a, align 1 - %main_ret = load i16, i16* %main, align 2 + store i8 %or4, ptr %a, align 1 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap index e48f28c90a4..9ff6cdd2549 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__byteaccess_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/directaccess_test.rs expression: prog -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ define i16 @main() { entry: %main = alloca i16, align 2 %b = alloca i16, align 2 - store i16 0, i16* %b, align 2 - store i16 0, i16* %main, align 2 - %0 = load i16, i16* %b, align 2 + store i16 0, ptr %b, align 2 + store i16 0, ptr %main, align 2 + %0 = load i16, ptr %b, align 2 %erase = and i16 %0, -256 %or = or i16 %erase, 2 - store i16 %or, i16* %b, align 2 - %main_ret = load i16, i16* %main, align 2 + store i16 %or, ptr %b, align 2 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap index 252078d7155..0b9b30cb4bc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__chained_bit_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/directaccess_test.rs expression: prog -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ define i16 @main() { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 - store i64 0, i64* %d, align 8 - store i16 0, i16* %main, align 2 - %0 = load i64, i64* %d, align 8 + store i64 0, ptr %d, align 8 + store i16 0, ptr %main, align 2 + %0 = load i64, ptr %d, align 8 %erase = and i64 %0, -8589934593 %or = or i64 %erase, 8589934592 - store i64 %or, i64* %d, align 8 - %main_ret = load i16, i16* %main, align 2 + store i64 %or, ptr %d, align 8 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap index 81a282dc6a2..6572dac4d06 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__dwordaccess_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/directaccess_test.rs expression: prog -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ define i16 @main() { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 - store i64 0, i64* %d, align 8 - store i16 0, i16* %main, align 2 - %0 = load i64, i64* %d, align 8 + store i64 0, ptr %d, align 8 + store i16 0, ptr %main, align 2 + %0 = load i64, ptr %d, align 8 %erase = and i64 %0, -4294967296 %or = or i64 %erase, 11259375 - store i64 %or, i64* %d, align 8 - %main_ret = load i16, i16* %main, align 2 + store i64 %or, ptr %d, align 8 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap index 5fd655f9cd5..c90668c7ab9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__lwordaccess_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/directaccess_test.rs expression: prog -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ define i16 @main() { entry: %main = alloca i16, align 2 %d = alloca i64, align 8 - store i64 0, i64* %d, align 8 - store i16 0, i16* %main, align 2 - %0 = load i64, i64* %d, align 8 + store i64 0, ptr %d, align 8 + store i16 0, ptr %main, align 2 + %0 = load i64, ptr %d, align 8 %erase = and i64 %0, poison %or = or i64 %erase, poison - store i64 %or, i64* %d, align 8 - %main_ret = load i16, i16* %main, align 2 + store i64 %or, ptr %d, align 8 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap index a362bf19fa5..4f421f28e9f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/directaccess_test.rs expression: prog -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,24 +15,23 @@ define i16 @main() { entry: %main = alloca i16, align 2 %str = alloca %myStruct, align 8 - %0 = bitcast %myStruct* %str to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds (%myStruct, %myStruct* @__myStruct__init, i32 0, i32 0), i64 ptrtoint (%myStruct* getelementptr (%myStruct, %myStruct* null, i32 1) to i64), i1 false) - store i16 0, i16* %main, align 2 - %x = getelementptr inbounds %myStruct, %myStruct* %str, i32 0, i32 0 - %1 = load i8, i8* %x, align 1 - %erase = and i8 %1, -2 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %str, ptr align 1 @__myStruct__init, i64 ptrtoint (ptr getelementptr (%myStruct, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %main, align 2 + %x = getelementptr inbounds %myStruct, ptr %str, i32 0, i32 0 + %0 = load i8, ptr %x, align 1 + %erase = and i8 %0, -2 %or = or i8 %erase, 0 - store i8 %or, i8* %x, align 1 - %x1 = getelementptr inbounds %myStruct, %myStruct* %str, i32 0, i32 0 - %2 = load i8, i8* %x1, align 1 - %erase2 = and i8 %2, -3 + store i8 %or, ptr %x, align 1 + %x1 = getelementptr inbounds %myStruct, ptr %str, i32 0, i32 0 + %1 = load i8, ptr %x1, align 1 + %erase2 = and i8 %1, -3 %or3 = or i8 %erase2, 2 - store i8 %or3, i8* %x1, align 1 - %main_ret = load i16, i16* %main, align 2 + store i8 %or3, ptr %x1, align 1 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap index 2e9a2e79209..89477c17cde 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__wordaccess_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/directaccess_test.rs expression: prog -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ define i16 @main() { entry: %main = alloca i16, align 2 %c = alloca i32, align 4 - store i32 0, i32* %c, align 4 - store i16 0, i16* %main, align 2 - %0 = load i32, i32* %c, align 4 + store i32 0, ptr %c, align 4 + store i16 0, ptr %main, align 2 + %0 = load i32, ptr %c, align 4 %erase = and i32 %0, -65536 %or = or i32 %erase, 256 - store i32 %or, i32* %c, align 4 - %main_ret = load i16, i16* %main, align 2 + store i32 %or, ptr %c, align 4 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap index dc00a25e2ca..5f2f96e0ab0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap @@ -1,25 +1,22 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%baz = type { [11 x i8], i8*, [10 x i8]* } +%baz = type { [11 x i8], ptr, ptr } @baz_instance = global %baz zeroinitializer -define void @baz(%baz* %0) { +define void @baz(ptr %0) { entry: - %str = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 - %ptr = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 - %bytes = getelementptr inbounds %baz, %baz* %0, i32 0, i32 2 - %1 = bitcast [11 x i8]* %str to i8* - store i8* %1, i8** %ptr, align 8 - %2 = bitcast [11 x i8]* %str to [10 x i8]* - store [10 x i8]* %2, [10 x i8]** %bytes, align 8 + %str = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 + %ptr = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 + %bytes = getelementptr inbounds %baz, ptr %0, i32 0, i32 2 + store ptr %str, ptr %ptr, align 8 + store ptr %str, ptr %bytes, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap index 8e5bdf249c9..fab401011f7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap @@ -1,41 +1,40 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { i16, [2 x i16], i16*, [2 x i16]* } +%main = type { i16, [2 x i16], ptr, ptr } @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %v = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %y = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %z = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - store i16 0, i16* %v, align 2 - %tmpVar = getelementptr inbounds [2 x i16], [2 x i16]* %x, i32 0, i32 0 - store i16 1, i16* %tmpVar, align 2 - %deref = load i16*, i16** %y, align 8 - store i16 2, i16* %deref, align 2 - %deref1 = load i16*, i16** %y, align 8 - %1 = load i16, i16* %deref1, align 2 + %v = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + store i16 0, ptr %v, align 2 + %tmpVar = getelementptr inbounds [2 x i16], ptr %x, i32 0, i32 0 + store i16 1, ptr %tmpVar, align 2 + %deref = load ptr, ptr %y, align 8 + store i16 2, ptr %deref, align 2 + %deref1 = load ptr, ptr %y, align 8 + %1 = load i16, ptr %deref1, align 2 %erase = and i16 %1, -3 %or = or i16 %erase, 6 - store i16 %or, i16* %deref1, align 2 - %deref2 = load [2 x i16]*, [2 x i16]** %z, align 8 - %tmpVar3 = getelementptr inbounds [2 x i16], [2 x i16]* %deref2, i32 0, i32 0 - store i16 4, i16* %tmpVar3, align 2 - %deref4 = load [2 x i16]*, [2 x i16]** %z, align 8 - %tmpVar5 = getelementptr inbounds [2 x i16], [2 x i16]* %deref4, i32 0, i32 1 - %2 = load i16, i16* %tmpVar5, align 2 + store i16 %or, ptr %deref1, align 2 + %deref2 = load ptr, ptr %z, align 8 + %tmpVar3 = getelementptr inbounds [2 x i16], ptr %deref2, i32 0, i32 0 + store i16 4, ptr %tmpVar3, align 2 + %deref4 = load ptr, ptr %z, align 8 + %tmpVar5 = getelementptr inbounds [2 x i16], ptr %deref4, i32 0, i32 1 + %2 = load i16, ptr %tmpVar5, align 2 %erase6 = and i16 %2, -3 %or7 = or i16 %erase6, 10 - store i16 %or7, i16* %tmpVar5, align 2 + store i16 %or7, ptr %tmpVar5, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap index 2701661b9b0..02761f41816 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_float.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,19 +14,19 @@ entry: %x2 = alloca float, align 4 %x3 = alloca float, align 4 %l1 = alloca double, align 8 - store float 0.000000e+00, float* %x1, align 4 - store float 0.000000e+00, float* %x2, align 4 - store float 0.000000e+00, float* %x3, align 4 - store double 0.000000e+00, double* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 - %load_x2 = load float, float* %x2, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store float 0.000000e+00, ptr %x2, align 4 + store float 0.000000e+00, ptr %x3, align 4 + store double 0.000000e+00, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 + %load_x2 = load float, ptr %x2, align 4 %tmpVar = fadd float %load_x1, %load_x2 - %load_x3 = load float, float* %x3, align 4 + %load_x3 = load float, ptr %x3, align 4 %tmpVar1 = fadd float %tmpVar, %load_x3 %0 = fpext float %tmpVar1 to double - %load_l1 = load double, double* %l1, align 8 + %load_l1 = load double, ptr %l1, align 8 %tmpVar2 = fadd double %0, %load_l1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap index 59b07c00168..84e2b314b28 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_ints.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,23 +15,23 @@ entry: %x3 = alloca i32, align 4 %l1 = alloca i64, align 8 %s1 = alloca i8, align 1 - store i32 0, i32* %x1, align 4 - store i32 0, i32* %x2, align 4 - store i32 0, i32* %x3, align 4 - store i64 0, i64* %l1, align 8 - store i8 0, i8* %s1, align 1 - store i32 0, i32* %main, align 4 - %load_x1 = load i32, i32* %x1, align 4 - %load_x2 = load i32, i32* %x2, align 4 + store i32 0, ptr %x1, align 4 + store i32 0, ptr %x2, align 4 + store i32 0, ptr %x3, align 4 + store i64 0, ptr %l1, align 8 + store i8 0, ptr %s1, align 1 + store i32 0, ptr %main, align 4 + %load_x1 = load i32, ptr %x1, align 4 + %load_x2 = load i32, ptr %x2, align 4 %tmpVar = add i32 %load_x1, %load_x2 - %load_x3 = load i32, i32* %x3, align 4 + %load_x3 = load i32, ptr %x3, align 4 %tmpVar1 = add i32 %tmpVar, %load_x3 %0 = sext i32 %tmpVar1 to i64 - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %tmpVar2 = add i64 %0, %load_l1 - %load_s1 = load i8, i8* %s1, align 1 + %load_s1 = load i8, ptr %s1, align 1 %1 = sext i8 %load_s1 to i64 %tmpVar3 = add i64 %tmpVar2, %1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap index 16a32739060..6b282d5b7df 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_add_mixed.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,20 +14,20 @@ entry: %x2 = alloca float, align 4 %x3 = alloca float, align 4 %l1 = alloca i64, align 8 - store float 0.000000e+00, float* %x1, align 4 - store float 0.000000e+00, float* %x2, align 4 - store float 0.000000e+00, float* %x3, align 4 - store i64 0, i64* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 - %load_x2 = load float, float* %x2, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store float 0.000000e+00, ptr %x2, align 4 + store float 0.000000e+00, ptr %x3, align 4 + store i64 0, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 + %load_x2 = load float, ptr %x2, align 4 %tmpVar = fadd float %load_x1, %load_x2 - %load_x3 = load float, float* %x3, align 4 + %load_x3 = load float, ptr %x3, align 4 %tmpVar1 = fadd float %tmpVar, %load_x3 %0 = fpext float %tmpVar1 to double - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %1 = sitofp i64 %load_l1 to double %tmpVar2 = fadd double %0, %1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap index 1a160e40127..cb27c152a2c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_float.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,13 +12,13 @@ entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 %l1 = alloca double, align 8 - store float 0.000000e+00, float* %x1, align 4 - store double 0.000000e+00, double* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store double 0.000000e+00, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 %0 = fpext float %load_x1 to double - %load_l1 = load double, double* %l1, align 8 + %load_l1 = load double, ptr %l1, align 8 %tmpVar = fdiv double %0, %load_l1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap index c69b0880467..27f14efcdf3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_ints.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,13 +12,13 @@ entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 %l1 = alloca i64, align 8 - store i32 0, i32* %x1, align 4 - store i64 0, i64* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load i32, i32* %x1, align 4 + store i32 0, ptr %x1, align 4 + store i64 0, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load i32, ptr %x1, align 4 %0 = sext i32 %load_x1 to i64 - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %tmpVar = sdiv i64 %0, %load_l1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap index eaf59af3bfd..839cc6c7958 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_div_mixed.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,14 +12,14 @@ entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 %l1 = alloca i64, align 8 - store float 0.000000e+00, float* %x1, align 4 - store i64 0, i64* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store i64 0, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 %0 = fpext float %load_x1 to double - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %1 = sitofp i64 %load_l1 to double %tmpVar = fdiv double %0, %1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap index 54bbdcdd388..120119ae1ef 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,13 +11,13 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %c = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %d = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %e = getelementptr inbounds %main, %main* %0, i32 0, i32 4 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %d = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %e = getelementptr inbounds %main, ptr %0, i32 0, i32 4 %1 = alloca i32, align 4 switch i32 3, label %continue_block [ i32 0, label %2 @@ -28,27 +27,27 @@ entry: ] 2: ; preds = %entry - %load_b = load i32, i32* %b, align 4 - store i32 %load_b, i32* %1, align 4 + %load_b = load i32, ptr %b, align 4 + store i32 %load_b, ptr %1, align 4 br label %continue_block 3: ; preds = %entry - %load_c = load i32, i32* %c, align 4 - store i32 %load_c, i32* %1, align 4 + %load_c = load i32, ptr %c, align 4 + store i32 %load_c, ptr %1, align 4 br label %continue_block 4: ; preds = %entry - %load_d = load i32, i32* %d, align 4 - store i32 %load_d, i32* %1, align 4 + %load_d = load i32, ptr %d, align 4 + store i32 %load_d, ptr %1, align 4 br label %continue_block 5: ; preds = %entry - %load_e = load i32, i32* %e, align 4 - store i32 %load_e, i32* %1, align 4 + %load_e = load i32, ptr %e, align 4 + store i32 %load_e, ptr %1, align 4 br label %continue_block continue_block: ; preds = %entry, %5, %4, %3, %2 - %6 = load i32, i32* %1, align 4 - store i32 %6, i32* %a, align 4 + %6 = load i32, ptr %1, align 4 + store i32 %6, ptr %a, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap index fafbbbb858f..5ec12cf9f7f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,45 +15,39 @@ target triple = "[filtered]" @utf08_literal_2 = private unnamed_addr constant [6 x i8] c"lorem\00" @utf08_literal_3 = private unnamed_addr constant [4 x i8] c"sit\00" -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %str1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %str1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 switch i32 3, label %continue_block [ i32 0, label %2 - i32 1, label %4 - i32 2, label %6 - i32 3, label %8 + i32 1, label %3 + i32 2, label %4 + i32 3, label %5 ] 2: ; preds = %entry - %3 = bitcast [81 x i8]* %1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_2, i32 0, i32 0), i32 6, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %1, ptr align 1 @utf08_literal_2, i32 6, i1 false) br label %continue_block -4: ; preds = %entry - %5 = bitcast [81 x i8]* %1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %5, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false) +3: ; preds = %entry + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %1, ptr align 1 @utf08_literal_1, i32 6, i1 false) br label %continue_block -6: ; preds = %entry - %7 = bitcast [81 x i8]* %1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %7, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) +4: ; preds = %entry + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %1, ptr align 1 @utf08_literal_0, i32 6, i1 false) br label %continue_block -8: ; preds = %entry - %9 = bitcast [81 x i8]* %1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %9, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_3, i32 0, i32 0), i32 4, i1 false) +5: ; preds = %entry + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %1, ptr align 1 @utf08_literal_3, i32 4, i1 false) br label %continue_block -continue_block: ; preds = %entry, %8, %6, %4, %2 - %10 = bitcast [81 x i8]* %str1 to i8* - %11 = bitcast [81 x i8]* %1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %10, i8* align 1 %11, i32 80, i1 false) +continue_block: ; preds = %entry, %5, %4, %3, %2 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %str1, ptr align 1 %1, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap index 8c256a2997d..ef5cde1797f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %c = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_b = load i32, i32* %b, align 4 - %load_c = load i32, i32* %c, align 4 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_b = load i32, ptr %b, align 4 + %load_c = load i32, ptr %c, align 4 %1 = select i1 true, i32 %load_c, i32 %load_b %tmpVar = add i32 %1, 10 - store i32 %tmpVar, i32* %a, align 4 + store i32 %tmpVar, ptr %a, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap index 074c65ee680..ad5cafcfaf4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap @@ -8,47 +8,47 @@ target datalayout = "[filtered]" target triple = "[filtered]" %main = type { [16 x i32], i32 } -%__foo_vla = type { i32*, [2 x i32] } +%__foo_vla = type { ptr, [2 x i32] } @MY_CONST = unnamed_addr constant i32 10 @main_instance = global %main zeroinitializer @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %auto_deref = load [16 x i32], [16 x i32]* %a, align 4 - %outer_arr_gep = getelementptr inbounds [16 x i32], [16 x i32]* %a, i32 0, i32 0 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %auto_deref = load [16 x i32], ptr %a, align 4 + %outer_arr_gep = getelementptr inbounds [16 x i32], ptr %a, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [8 x i32] [i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4], [2 x i32]* %vla_dimensions_gep, align 4 - store i32* %outer_arr_gep, i32** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [8 x i32] [i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %1 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i32 @foo(%__foo_vla* %vla_struct_ptr) - store i32 %call, i32* %b, align 4 + store %__foo_vla %1, ptr %vla_struct_ptr, align 8 + %call = call i32 @foo(ptr %vla_struct_ptr) + store i32 %call, ptr %b, align 4 ret void } -define i32 @foo(%__foo_vla* %0) { +define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 - %vla = alloca %__foo_vla*, align 8 - store %__foo_vla* %0, %__foo_vla** %vla, align 8 - store i32 0, i32* %foo, align 4 - %deref = load %__foo_vla*, %__foo_vla** %vla, align 8 - %dim = getelementptr inbounds %__foo_vla, %__foo_vla* %deref, i32 0, i32 1 - %1 = getelementptr inbounds [2 x i32], [2 x i32]* %dim, i32 0, i32 7 - %2 = load i32, i32* %1, align 4 - store i32 %2, i32* %foo, align 4 - %deref1 = load %__foo_vla*, %__foo_vla** %vla, align 8 - %dim2 = getelementptr inbounds %__foo_vla, %__foo_vla* %deref1, i32 0, i32 1 - %3 = getelementptr inbounds [2 x i32], [2 x i32]* %dim2, i32 0, i32 7 - %4 = load i32, i32* %3, align 4 - store i32 %4, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + %vla = alloca ptr, align 8 + store ptr %0, ptr %vla, align 8 + store i32 0, ptr %foo, align 4 + %deref = load ptr, ptr %vla, align 8 + %dim = getelementptr inbounds %__foo_vla, ptr %deref, i32 0, i32 1 + %1 = getelementptr inbounds [2 x i32], ptr %dim, i32 0, i32 7 + %2 = load i32, ptr %1, align 4 + store i32 %2, ptr %foo, align 4 + %deref1 = load ptr, ptr %vla, align 8 + %dim2 = getelementptr inbounds %__foo_vla, ptr %deref1, i32 0, i32 1 + %3 = getelementptr inbounds [2 x i32], ptr %dim2, i32 0, i32 7 + %4 = load i32, ptr %3, align 4 + store i32 %4, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap index 6ddf786f115..92fcb599617 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_float.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,19 +14,19 @@ entry: %x2 = alloca float, align 4 %x3 = alloca float, align 4 %l1 = alloca double, align 8 - store float 0.000000e+00, float* %x1, align 4 - store float 0.000000e+00, float* %x2, align 4 - store float 0.000000e+00, float* %x3, align 4 - store double 0.000000e+00, double* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 - %load_x2 = load float, float* %x2, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store float 0.000000e+00, ptr %x2, align 4 + store float 0.000000e+00, ptr %x3, align 4 + store double 0.000000e+00, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 + %load_x2 = load float, ptr %x2, align 4 %tmpVar = fmul float %load_x1, %load_x2 - %load_x3 = load float, float* %x3, align 4 + %load_x3 = load float, ptr %x3, align 4 %tmpVar1 = fmul float %tmpVar, %load_x3 %0 = fpext float %tmpVar1 to double - %load_l1 = load double, double* %l1, align 8 + %load_l1 = load double, ptr %l1, align 8 %tmpVar2 = fmul double %0, %load_l1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap index cfd9cb9b506..232d4d134ca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_ints.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,23 +15,23 @@ entry: %x3 = alloca i32, align 4 %l1 = alloca i64, align 8 %s1 = alloca i8, align 1 - store i32 0, i32* %x1, align 4 - store i32 0, i32* %x2, align 4 - store i32 0, i32* %x3, align 4 - store i64 0, i64* %l1, align 8 - store i8 0, i8* %s1, align 1 - store i32 0, i32* %main, align 4 - %load_x1 = load i32, i32* %x1, align 4 - %load_x2 = load i32, i32* %x2, align 4 + store i32 0, ptr %x1, align 4 + store i32 0, ptr %x2, align 4 + store i32 0, ptr %x3, align 4 + store i64 0, ptr %l1, align 8 + store i8 0, ptr %s1, align 1 + store i32 0, ptr %main, align 4 + %load_x1 = load i32, ptr %x1, align 4 + %load_x2 = load i32, ptr %x2, align 4 %tmpVar = mul i32 %load_x1, %load_x2 - %load_x3 = load i32, i32* %x3, align 4 + %load_x3 = load i32, ptr %x3, align 4 %tmpVar1 = mul i32 %tmpVar, %load_x3 %0 = sext i32 %tmpVar1 to i64 - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %tmpVar2 = mul i64 %0, %load_l1 - %load_s1 = load i8, i8* %s1, align 1 + %load_s1 = load i8, ptr %s1, align 1 %1 = sext i8 %load_s1 to i64 %tmpVar3 = mul i64 %tmpVar2, %1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap index 3dca5426871..aaee9aee6f1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_mul_mixed.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,20 +14,20 @@ entry: %x2 = alloca float, align 4 %x3 = alloca float, align 4 %l1 = alloca i64, align 8 - store float 0.000000e+00, float* %x1, align 4 - store float 0.000000e+00, float* %x2, align 4 - store float 0.000000e+00, float* %x3, align 4 - store i64 0, i64* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 - %load_x2 = load float, float* %x2, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store float 0.000000e+00, ptr %x2, align 4 + store float 0.000000e+00, ptr %x3, align 4 + store i64 0, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 + %load_x2 = load float, ptr %x2, align 4 %tmpVar = fmul float %load_x1, %load_x2 - %load_x3 = load float, float* %x3, align 4 + %load_x3 = load float, ptr %x3, align 4 %tmpVar1 = fmul float %tmpVar, %load_x3 %0 = fpext float %tmpVar1 to double - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %1 = sitofp i64 %load_l1 to double %tmpVar2 = fmul double %0, %1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap index 3f77b3c1b28..22c457efa39 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_float.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,13 +12,13 @@ entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 %l1 = alloca double, align 8 - store float 0.000000e+00, float* %x1, align 4 - store double 0.000000e+00, double* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store double 0.000000e+00, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 %0 = fpext float %load_x1 to double - %load_l1 = load double, double* %l1, align 8 + %load_l1 = load double, ptr %l1, align 8 %tmpVar = fsub double %0, %load_l1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap index 53dbc27765f..cb3e72b025c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_ints.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,13 +12,13 @@ entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 %l1 = alloca i64, align 8 - store i32 0, i32* %x1, align 4 - store i64 0, i64* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load i32, i32* %x1, align 4 + store i32 0, ptr %x1, align 4 + store i64 0, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load i32, ptr %x1, align 4 %0 = sext i32 %load_x1 to i64 - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %tmpVar = sub i64 %0, %load_l1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap index 474d64aae76..4bac2c6a4e5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_sub_mixed.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,14 +12,14 @@ entry: %main = alloca i32, align 4 %x1 = alloca float, align 4 %l1 = alloca i64, align 8 - store float 0.000000e+00, float* %x1, align 4 - store i64 0, i64* %l1, align 8 - store i32 0, i32* %main, align 4 - %load_x1 = load float, float* %x1, align 4 + store float 0.000000e+00, ptr %x1, align 4 + store i64 0, ptr %l1, align 8 + store i32 0, ptr %main, align 4 + %load_x1 = load float, ptr %x1, align 4 %0 = fpext float %load_x1 to double - %load_l1 = load i64, i64* %l1, align 8 + %load_l1 = load i64, ptr %l1, align 8 %1 = sitofp i64 %load_l1 to double %tmpVar = fsub double %0, %1 - %main_ret = load i32, i32* %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap index e66c9de1046..a05da8b50af 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,34 +12,30 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @func(i8* %0) { +define void @func(ptr %0) { entry: - %func = alloca i8*, align 8 - store i8* %0, i8** %func, align 8 - %deref = load i8*, i8** %func, align 8 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) + %func = alloca ptr, align 8 + store ptr %0, ptr %func, align 8 + %deref = load ptr, ptr %func, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 6, i1 false) ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %__func0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__func0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %__func0 to i8* - call void @func(i8* %2) - %3 = bitcast [81 x i8]* %x to i8* - %4 = bitcast [81 x i8]* %__func0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %4, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__func0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @func(ptr %__func0) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %x, ptr align 1 %__func0, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap index 65efa9a8b22..cd0c4426f55 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap @@ -1,22 +1,20 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%baz = type { i8*, i16 } +%baz = type { ptr, i16 } @baz_instance = global %baz zeroinitializer -define void @baz(%baz* %0) { +define void @baz(ptr %0) { entry: - %ptr_x = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 - %y = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 - %1 = bitcast i16* %y to i8* - store i8* %1, i8** %ptr_x, align 8 + %ptr_x = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 + store ptr %y, ptr %ptr_x, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap index f5abb26bb98..ea252191961 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_lword_to_pointer.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,14 +10,14 @@ target triple = "[filtered]" define i16 @baz() { entry: %baz = alloca i16, align 2 - %ptr_x = alloca i16*, align 8 + %ptr_x = alloca ptr, align 8 %y = alloca i64, align 8 - store i16* null, i16** %ptr_x, align 8 - store i64 0, i64* %y, align 8 - store i16 0, i16* %baz, align 2 - %load_y = load i64, i64* %y, align 8 - %0 = inttoptr i64 %load_y to i16* - store i16* %0, i16** %ptr_x, align 8 - %baz_ret = load i16, i16* %baz, align 2 + store ptr null, ptr %ptr_x, align 8 + store i64 0, ptr %y, align 8 + store i16 0, ptr %baz, align 2 + %load_y = load i64, ptr %y, align 8 + %0 = inttoptr i64 %load_y to ptr + store ptr %0, ptr %ptr_x, align 8 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap index b3924c389a9..314df566476 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_pointer_to_lword.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,14 +10,14 @@ target triple = "[filtered]" define i16 @baz() { entry: %baz = alloca i16, align 2 - %ptr_x = alloca i16*, align 8 + %ptr_x = alloca ptr, align 8 %y = alloca i64, align 8 - store i16* null, i16** %ptr_x, align 8 - store i64 0, i64* %y, align 8 - store i16 0, i16* %baz, align 2 - %load_ptr_x = load i16*, i16** %ptr_x, align 8 - %0 = ptrtoint i16* %load_ptr_x to i64 - store i64 %0, i64* %y, align 8 - %baz_ret = load i16, i16* %baz, align 2 + store ptr null, ptr %ptr_x, align 8 + store i64 0, ptr %y, align 8 + store i16 0, ptr %baz, align 2 + %load_ptr_x = load ptr, ptr %ptr_x, align 8 + %0 = ptrtoint ptr %load_ptr_x to i64 + store i64 %0, ptr %y, align 8 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap index d2434cc9bd2..d0b9517de9c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__compare_date_time_literals.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,7 +11,7 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %cmp1 = alloca i8, align 1 %cmp2 = alloca i8, align 1 @@ -22,21 +21,21 @@ entry: %cmp6 = alloca i8, align 1 %cmp7 = alloca i8, align 1 %cmp8 = alloca i8, align 1 - store i8 0, i8* %cmp1, align 1 - store i8 0, i8* %cmp2, align 1 - store i8 0, i8* %cmp3, align 1 - store i8 0, i8* %cmp4, align 1 - store i8 0, i8* %cmp5, align 1 - store i8 0, i8* %cmp6, align 1 - store i8 0, i8* %cmp7, align 1 - store i8 0, i8* %cmp8, align 1 - store i8 0, i8* %cmp1, align 1 - store i8 1, i8* %cmp2, align 1 - store i8 0, i8* %cmp3, align 1 - store i8 1, i8* %cmp4, align 1 - store i8 0, i8* %cmp5, align 1 - store i8 1, i8* %cmp6, align 1 - store i8 0, i8* %cmp7, align 1 - store i8 1, i8* %cmp8, align 1 + store i8 0, ptr %cmp1, align 1 + store i8 0, ptr %cmp2, align 1 + store i8 0, ptr %cmp3, align 1 + store i8 0, ptr %cmp4, align 1 + store i8 0, ptr %cmp5, align 1 + store i8 0, ptr %cmp6, align 1 + store i8 0, ptr %cmp7, align 1 + store i8 0, ptr %cmp8, align 1 + store i8 0, ptr %cmp1, align 1 + store i8 1, ptr %cmp2, align 1 + store i8 0, ptr %cmp3, align 1 + store i8 1, ptr %cmp4, align 1 + store i8 0, ptr %cmp5, align 1 + store i8 1, ptr %cmp6, align 1 + store i8 0, ptr %cmp7, align 1 + store i8 1, ptr %cmp8, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap index 72e6e9d7f07..c1772539b58 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__max_int.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,27 +10,26 @@ target triple = "[filtered]" define i16 @main() { entry: %main = alloca i16, align 2 - store i16 0, i16* %main, align 2 + store i16 0, ptr %main, align 2 %0 = alloca [7 x i16], align 2 - %1 = getelementptr inbounds [7 x i16], [7 x i16]* %0, i32 0, i32 0 - store i16 5, i16* %1, align 2 - %2 = getelementptr inbounds [7 x i16], [7 x i16]* %0, i32 0, i32 1 - store i16 2, i16* %2, align 2 - %3 = getelementptr inbounds [7 x i16], [7 x i16]* %0, i32 0, i32 2 - store i16 1, i16* %3, align 2 - %4 = getelementptr inbounds [7 x i16], [7 x i16]* %0, i32 0, i32 3 - store i16 3, i16* %4, align 2 - %5 = getelementptr inbounds [7 x i16], [7 x i16]* %0, i32 0, i32 4 - store i16 4, i16* %5, align 2 - %6 = getelementptr inbounds [7 x i16], [7 x i16]* %0, i32 0, i32 5 - store i16 7, i16* %6, align 2 - %7 = getelementptr inbounds [7 x i16], [7 x i16]* %0, i32 0, i32 6 - store i16 -1, i16* %7, align 2 - %8 = bitcast [7 x i16]* %0 to i16* - %call = call i16 @MAX__INT(i32 7, i16* %8) - store i16 %call, i16* %main, align 2 - %main_ret = load i16, i16* %main, align 2 + %1 = getelementptr inbounds [7 x i16], ptr %0, i32 0, i32 0 + store i16 5, ptr %1, align 2 + %2 = getelementptr inbounds [7 x i16], ptr %0, i32 0, i32 1 + store i16 2, ptr %2, align 2 + %3 = getelementptr inbounds [7 x i16], ptr %0, i32 0, i32 2 + store i16 1, ptr %3, align 2 + %4 = getelementptr inbounds [7 x i16], ptr %0, i32 0, i32 3 + store i16 3, ptr %4, align 2 + %5 = getelementptr inbounds [7 x i16], ptr %0, i32 0, i32 4 + store i16 4, ptr %5, align 2 + %6 = getelementptr inbounds [7 x i16], ptr %0, i32 0, i32 5 + store i16 7, ptr %6, align 2 + %7 = getelementptr inbounds [7 x i16], ptr %0, i32 0, i32 6 + store i16 -1, ptr %7, align 2 + %call = call i16 @MAX__INT(i32 7, ptr %0) + store i16 %call, ptr %main, align 2 + %main_ret = load i16, ptr %main, align 2 ret i16 %main_ret } -declare i16 @MAX__INT(i32, i16*) +declare i16 @MAX__INT(i32, ptr) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap index eec1c96c3a5..3c17b0636e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__nested_call_statements.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,13 +15,13 @@ define i32 @foo(i32 %0) { entry: %foo = alloca i32, align 4 %a = alloca i32, align 4 - store i32 %0, i32* %a, align 4 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %a, align 4 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %call = call i32 @foo(i32 2) %call1 = call i32 @foo(i32 %call) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap index 9c16959f23a..36dd48f33ed 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap @@ -1,65 +1,64 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { i16, i16, i16* } +%main = type { i16, i16, ptr } -@main_instance = global %main { i16 10, i16 20, i16* null } +@main_instance = global %main { i16 10, i16 20, ptr null } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - store i16* %x, i16** %pt, align 8 - %load_pt = load i16*, i16** %pt, align 8 - %access___main_pt = getelementptr inbounds i16, i16* %load_pt, i32 1 - store i16* %access___main_pt, i16** %pt, align 8 - %load_pt1 = load i16*, i16** %pt, align 8 - %access___main_pt2 = getelementptr inbounds i16, i16* %load_pt1, i32 1 - %access___main_pt3 = getelementptr inbounds i16, i16* %access___main_pt2, i32 1 - store i16* %access___main_pt3, i16** %pt, align 8 - %load_pt4 = load i16*, i16** %pt, align 8 - %access___main_pt5 = getelementptr inbounds i16, i16* %load_pt4, i32 1 - store i16* %access___main_pt5, i16** %pt, align 8 - %load_pt6 = load i16*, i16** %pt, align 8 - %load_y = load i16, i16* %y, align 2 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + store ptr %x, ptr %pt, align 8 + %load_pt = load ptr, ptr %pt, align 8 + %access___main_pt = getelementptr inbounds i16, ptr %load_pt, i32 1 + store ptr %access___main_pt, ptr %pt, align 8 + %load_pt1 = load ptr, ptr %pt, align 8 + %access___main_pt2 = getelementptr inbounds i16, ptr %load_pt1, i32 1 + %access___main_pt3 = getelementptr inbounds i16, ptr %access___main_pt2, i32 1 + store ptr %access___main_pt3, ptr %pt, align 8 + %load_pt4 = load ptr, ptr %pt, align 8 + %access___main_pt5 = getelementptr inbounds i16, ptr %load_pt4, i32 1 + store ptr %access___main_pt5, ptr %pt, align 8 + %load_pt6 = load ptr, ptr %pt, align 8 + %load_y = load i16, ptr %y, align 2 %1 = sub i16 0, %load_y - %access___main_pt7 = getelementptr inbounds i16, i16* %load_pt6, i16 %1 - store i16* %access___main_pt7, i16** %pt, align 8 - %load_pt8 = load i16*, i16** %pt, align 8 - %access___main_pt9 = getelementptr inbounds i16, i16* %load_pt8, i32 1 - %access___main_pt10 = getelementptr inbounds i16, i16* %access___main_pt9, i32 1 - store i16* %access___main_pt10, i16** %pt, align 8 - %load_pt11 = load i16*, i16** %pt, align 8 - %load_y12 = load i16, i16* %y, align 2 + %access___main_pt7 = getelementptr inbounds i16, ptr %load_pt6, i16 %1 + store ptr %access___main_pt7, ptr %pt, align 8 + %load_pt8 = load ptr, ptr %pt, align 8 + %access___main_pt9 = getelementptr inbounds i16, ptr %load_pt8, i32 1 + %access___main_pt10 = getelementptr inbounds i16, ptr %access___main_pt9, i32 1 + store ptr %access___main_pt10, ptr %pt, align 8 + %load_pt11 = load ptr, ptr %pt, align 8 + %load_y12 = load i16, ptr %y, align 2 %2 = sub i16 0, %load_y12 - %access___main_pt13 = getelementptr inbounds i16, i16* %load_pt11, i16 %2 - %access___main_pt14 = getelementptr inbounds i16, i16* %access___main_pt13, i32 -1 - store i16* %access___main_pt14, i16** %pt, align 8 - %load_pt15 = load i16*, i16** %pt, align 8 - %access___main_pt16 = getelementptr inbounds i16, i16* %load_pt15, i32 2 - store i16* %access___main_pt16, i16** %pt, align 8 - %load_y17 = load i16, i16* %y, align 2 - %load_pt18 = load i16*, i16** %pt, align 8 - %access___main_pt19 = getelementptr inbounds i16, i16* %load_pt18, i16 %load_y17 - %load_y20 = load i16, i16* %y, align 2 + %access___main_pt13 = getelementptr inbounds i16, ptr %load_pt11, i16 %2 + %access___main_pt14 = getelementptr inbounds i16, ptr %access___main_pt13, i32 -1 + store ptr %access___main_pt14, ptr %pt, align 8 + %load_pt15 = load ptr, ptr %pt, align 8 + %access___main_pt16 = getelementptr inbounds i16, ptr %load_pt15, i32 2 + store ptr %access___main_pt16, ptr %pt, align 8 + %load_y17 = load i16, ptr %y, align 2 + %load_pt18 = load ptr, ptr %pt, align 8 + %access___main_pt19 = getelementptr inbounds i16, ptr %load_pt18, i16 %load_y17 + %load_y20 = load i16, ptr %y, align 2 %3 = sub i16 0, %load_y20 - %access___main_pt21 = getelementptr inbounds i16, i16* %access___main_pt19, i16 %3 - store i16* %access___main_pt21, i16** %pt, align 8 - %load_y22 = load i16, i16* %y, align 2 + %access___main_pt21 = getelementptr inbounds i16, ptr %access___main_pt19, i16 %3 + store ptr %access___main_pt21, ptr %pt, align 8 + %load_y22 = load i16, ptr %y, align 2 %4 = sext i16 %load_y22 to i32 - %load_y23 = load i16, i16* %y, align 2 + %load_y23 = load i16, ptr %y, align 2 %5 = sext i16 %load_y23 to i32 %tmpVar = add i32 %4, %5 - %load_pt24 = load i16*, i16** %pt, align 8 - %access___main_pt25 = getelementptr inbounds i16, i16* %load_pt24, i32 %tmpVar - store i16* %access___main_pt25, i16** %pt, align 8 + %load_pt24 = load ptr, ptr %pt, align 8 + %access___main_pt25 = getelementptr inbounds i16, ptr %load_pt24, i32 %tmpVar + store ptr %access___main_pt25, ptr %pt, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap index c629ccd91b6..4c6ddacc7bc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap @@ -1,33 +1,32 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { i16*, i16 } +%main = type { ptr, i16 } @main_instance = global %main zeroinitializer define i64 @foo() { entry: %foo = alloca i64, align 8 - store i64 0, i64* %foo, align 8 - %foo_ret = load i64, i64* %foo, align 8 + store i64 0, ptr %foo, align 8 + %foo_ret = load i64, ptr %foo, align 8 ret i64 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %pt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - store i16* %x, i16** %pt, align 8 - %load_pt = load i16*, i16** %pt, align 8 + %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + store ptr %x, ptr %pt, align 8 + %load_pt = load ptr, ptr %pt, align 8 %call = call i64 @foo() - %access___main_pt = getelementptr inbounds i16, i16* %load_pt, i64 %call - store i16* %access___main_pt, i16** %pt, align 8 + %access___main_pt = getelementptr inbounds i16, ptr %load_pt, i64 %call + store ptr %access___main_pt, ptr %pt, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap index 8df22cc5ee0..b288716ad3f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointers_in_function_return.snap @@ -1,17 +1,16 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -define i16* @func() { +define ptr @func() { entry: - %func = alloca i16*, align 8 - store i16* null, i16** %func, align 8 - %func_ret = load i16*, i16** %func, align 8 - ret i16* %func_ret + %func = alloca ptr, align 8 + store ptr null, ptr %func, align 8 + %func_ret = load ptr, ptr %func, align 8 + ret ptr %func_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap index 8c555e4de0f..f982b848e72 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,21 +9,20 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define void @func(i8* %0, [81 x i8]* %1) { +define void @func(ptr %0, ptr %1) { entry: - %func = alloca i8*, align 8 - store i8* %0, i8** %func, align 8 - %myout = alloca [81 x i8]*, align 8 - store [81 x i8]* %1, [81 x i8]** %myout, align 8 - %deref = load i8*, i8** %func, align 8 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %deref1 = load [81 x i8]*, [81 x i8]** %myout, align 8 - %2 = bitcast [81 x i8]* %deref1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) + %func = alloca ptr, align 8 + store ptr %0, ptr %func, align 8 + %myout = alloca ptr, align 8 + store ptr %1, ptr %myout, align 8 + %deref = load ptr, ptr %func, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 6, i1 false) + %deref1 = load ptr, ptr %myout, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref1, ptr align 1 @utf08_literal_0, i32 6, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap index d77b542920f..f1cea470b92 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__structs_in_function_return.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer -define void @func(%myStruct* %0, %myStruct* %1) { +define void @func(ptr %0, ptr %1) { entry: - %func = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %func, align 8 - %xxx = alloca %myStruct*, align 8 - store %myStruct* %1, %myStruct** %xxx, align 8 + %func = alloca ptr, align 8 + store ptr %0, ptr %func, align 8 + %xxx = alloca ptr, align 8 + store ptr %1, ptr %xxx, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap index 043ac4293ac..ecb9bc5fc75 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__type_mix_in_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,17 +11,17 @@ define i16 @foo(i16 %0) { entry: %foo = alloca i16, align 2 %in = alloca i16, align 2 - store i16 %0, i16* %in, align 2 - store i16 0, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + store i16 %0, ptr %in, align 2 + store i16 0, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } define i16 @baz() { entry: %baz = alloca i16, align 2 - store i16 0, i16* %baz, align 2 + store i16 0, ptr %baz, align 2 %call = call i16 @foo(i16 1) - %baz_ret = load i16, i16* %baz, align 2 + %baz_ret = load i16, ptr %baz, align 2 ret i16 %baz_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap index 86debc2c1cf..01702b153e2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,13 +11,13 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - store float -2.000000e+00, float* %b, align 4 - %load_b = load float, float* %b, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + store float -2.000000e+00, ptr %b, align 4 + %load_b = load float, ptr %b, align 4 %tmpVar = fneg float %load_b - store float %tmpVar, float* %a, align 4 + store float %tmpVar, ptr %a, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap index f79941fd0f1..91b71559d15 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap @@ -1,25 +1,24 @@ --- source: src/codegen/tests/expression_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%baz = type { i8*, i8, i8, i8 } +%baz = type { ptr, i8, i8, i8 } @baz_instance = global %baz zeroinitializer -define void @baz(%baz* %0) { +define void @baz(ptr %0) { entry: - %ptr = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 - %b = getelementptr inbounds %baz, %baz* %0, i32 0, i32 1 - %si = getelementptr inbounds %baz, %baz* %0, i32 0, i32 2 - %mb = getelementptr inbounds %baz, %baz* %0, i32 0, i32 3 - store i8* %b, i8** %ptr, align 8 - store i8* %si, i8** %ptr, align 8 - store i8* %mb, i8** %ptr, align 8 + %ptr = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 + %si = getelementptr inbounds %baz, ptr %0, i32 0, i32 2 + %mb = getelementptr inbounds %baz, ptr %0, i32 0, i32 3 + store ptr %b, ptr %ptr, align 8 + store ptr %si, ptr %ptr, align 8 + store ptr %mb, ptr %ptr, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap index feada78fd27..f909a97b1c2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,45 +11,40 @@ define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [5 x i32], align 4 - %0 = bitcast [5 x i32]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([5 x i32]* getelementptr ([5 x i32], [5 x i32]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %1 = bitcast [5 x i32]* %arr to i32* - %call = call i32 @fn_by_ref(i32* %1) - %main_ret = load i32, i32* %main, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([5 x i32], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %call = call i32 @fn_by_ref(ptr %arr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -define i32 @fn_by_ref(i32* %0) { +define i32 @fn_by_ref(ptr %0) { entry: %fn_by_ref = alloca i32, align 4 - %arg_by_ref = alloca i32*, align 8 - store i32* %0, i32** %arg_by_ref, align 8 - store i32 0, i32* %fn_by_ref, align 4 - %deref = load i32*, i32** %arg_by_ref, align 8 - %call = call i32 @fn_by_val(i32* %deref) - %fn_by_ref_ret = load i32, i32* %fn_by_ref, align 4 + %arg_by_ref = alloca ptr, align 8 + store ptr %0, ptr %arg_by_ref, align 8 + store i32 0, ptr %fn_by_ref, align 4 + %deref = load ptr, ptr %arg_by_ref, align 8 + %call = call i32 @fn_by_val(ptr %deref) + %fn_by_ref_ret = load i32, ptr %fn_by_ref, align 4 ret i32 %fn_by_ref_ret } -define i32 @fn_by_val(i32* %0) { +define i32 @fn_by_val(ptr %0) { entry: %fn_by_val = alloca i32, align 4 %arg_by_val = alloca [5 x i32], align 4 - %bitcast = bitcast [5 x i32]* %arg_by_val to i32* - %1 = bitcast i32* %bitcast to i8* - %2 = bitcast i32* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint ([5 x i32]* getelementptr ([5 x i32], [5 x i32]* null, i32 1) to i64), i1 false) - store i32 0, i32* %fn_by_val, align 4 - %fn_by_val_ret = load i32, i32* %fn_by_val, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arg_by_val, ptr align 1 %0, i64 ptrtoint (ptr getelementptr ([5 x i32], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %fn_by_val, align 4 + %fn_by_val_ret = load i32, ptr %fn_by_val, align 4 ret i32 %fn_by_val_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap index 525fbc99b66..37650f38ed8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__autocast_argument_literals_for_function_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,41 +11,41 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @func(i8* %0, i16* %1, i32* %2, i64* %3, float* %4, double* %5) { +define i32 @func(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr %5) { entry: %func = alloca i32, align 4 - %byInt1 = alloca i8*, align 8 - store i8* %0, i8** %byInt1, align 8 - %byInt2 = alloca i16*, align 8 - store i16* %1, i16** %byInt2, align 8 - %byInt3 = alloca i32*, align 8 - store i32* %2, i32** %byInt3, align 8 - %byInt4 = alloca i64*, align 8 - store i64* %3, i64** %byInt4, align 8 - %byReal1 = alloca float*, align 8 - store float* %4, float** %byReal1, align 8 - %byReal2 = alloca double*, align 8 - store double* %5, double** %byReal2, align 8 - store i32 0, i32* %func, align 4 - store i32 1, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + %byInt1 = alloca ptr, align 8 + store ptr %0, ptr %byInt1, align 8 + %byInt2 = alloca ptr, align 8 + store ptr %1, ptr %byInt2, align 8 + %byInt3 = alloca ptr, align 8 + store ptr %2, ptr %byInt3, align 8 + %byInt4 = alloca ptr, align 8 + store ptr %3, ptr %byInt4, align 8 + %byReal1 = alloca ptr, align 8 + store ptr %4, ptr %byReal1, align 8 + %byReal2 = alloca ptr, align 8 + store ptr %5, ptr %byReal2, align 8 + store i32 0, ptr %func, align 4 + store i32 1, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %1 = alloca i8, align 1 - store i8 1, i8* %1, align 1 + store i8 1, ptr %1, align 1 %2 = alloca i16, align 2 - store i16 2, i16* %2, align 2 + store i16 2, ptr %2, align 2 %3 = alloca i32, align 4 - store i32 3, i32* %3, align 4 + store i32 3, ptr %3, align 4 %4 = alloca i64, align 8 - store i64 4, i64* %4, align 8 + store i64 4, ptr %4, align 8 %5 = alloca float, align 4 - store float 5.000000e+00, float* %5, align 4 + store float 5.000000e+00, ptr %5, align 4 %6 = alloca double, align 8 - store double 6.000000e+00, double* %6, align 8 - %call = call i32 @func(i8* %1, i16* %2, i32* %3, i64* %4, float* %5, double* %6) + store double 6.000000e+00, ptr %6, align 8 + %call = call i32 @func(ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr %6) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap index 90a480f3f89..89cbee3265b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,95 +11,79 @@ target triple = "[filtered]" @main_instance = global %main { i8 1, i8 1, i16 2, i16 2, i32 3, i32 3, i64 4, i64 4, float 5.000000e+00, float 5.000000e+00, double 6.000000e+00, double 6.000000e+00 } -define i8 @fn_sint(i8* %0, i8* %1) { +define i8 @fn_sint(ptr %0, ptr %1) { entry: %fn_sint = alloca i8, align 1 - %in_ref = alloca i8*, align 8 - store i8* %0, i8** %in_ref, align 8 - %in_out = alloca i8*, align 8 - store i8* %1, i8** %in_out, align 8 - store i8 0, i8* %fn_sint, align 1 - %fn_sint_ret = load i8, i8* %fn_sint, align 1 + %in_ref = alloca ptr, align 8 + store ptr %0, ptr %in_ref, align 8 + %in_out = alloca ptr, align 8 + store ptr %1, ptr %in_out, align 8 + store i8 0, ptr %fn_sint, align 1 + %fn_sint_ret = load i8, ptr %fn_sint, align 1 ret i8 %fn_sint_ret } -define i64 @fn_lint(i64* %0, i64* %1) { +define i64 @fn_lint(ptr %0, ptr %1) { entry: %fn_lint = alloca i64, align 8 - %in_ref = alloca i64*, align 8 - store i64* %0, i64** %in_ref, align 8 - %in_out = alloca i64*, align 8 - store i64* %1, i64** %in_out, align 8 - store i64 0, i64* %fn_lint, align 8 - %fn_lint_ret = load i64, i64* %fn_lint, align 8 + %in_ref = alloca ptr, align 8 + store ptr %0, ptr %in_ref, align 8 + %in_out = alloca ptr, align 8 + store ptr %1, ptr %in_out, align 8 + store i64 0, ptr %fn_lint, align 8 + %fn_lint_ret = load i64, ptr %fn_lint, align 8 ret i64 %fn_lint_ret } -define i64 @fn_real(float* %0, float* %1) { +define i64 @fn_real(ptr %0, ptr %1) { entry: %fn_real = alloca i64, align 8 - %in_ref = alloca float*, align 8 - store float* %0, float** %in_ref, align 8 - %in_out = alloca float*, align 8 - store float* %1, float** %in_out, align 8 - store i64 0, i64* %fn_real, align 8 - %fn_real_ret = load i64, i64* %fn_real, align 8 + %in_ref = alloca ptr, align 8 + store ptr %0, ptr %in_ref, align 8 + %in_out = alloca ptr, align 8 + store ptr %1, ptr %in_out, align 8 + store i64 0, ptr %fn_real, align 8 + %fn_real_ret = load i64, ptr %fn_real, align 8 ret i64 %fn_real_ret } -define i64 @fn_lreal(double* %0, double* %1) { +define i64 @fn_lreal(ptr %0, ptr %1) { entry: %fn_lreal = alloca i64, align 8 - %in_ref = alloca double*, align 8 - store double* %0, double** %in_ref, align 8 - %in_out = alloca double*, align 8 - store double* %1, double** %in_out, align 8 - store i64 0, i64* %fn_lreal, align 8 - %fn_lreal_ret = load i64, i64* %fn_lreal, align 8 + %in_ref = alloca ptr, align 8 + store ptr %0, ptr %in_ref, align 8 + %in_out = alloca ptr, align 8 + store ptr %1, ptr %in_out, align 8 + store i64 0, ptr %fn_lreal, align 8 + %fn_lreal_ret = load i64, ptr %fn_lreal, align 8 ret i64 %fn_lreal_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2_sint = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var1_int = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %var2_int = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %var1_dint = getelementptr inbounds %main, %main* %0, i32 0, i32 4 - %var2_dint = getelementptr inbounds %main, %main* %0, i32 0, i32 5 - %var1_lint = getelementptr inbounds %main, %main* %0, i32 0, i32 6 - %var2_lint = getelementptr inbounds %main, %main* %0, i32 0, i32 7 - %var1_real = getelementptr inbounds %main, %main* %0, i32 0, i32 8 - %var2_real = getelementptr inbounds %main, %main* %0, i32 0, i32 9 - %var1_lreal = getelementptr inbounds %main, %main* %0, i32 0, i32 10 - %var2_lreal = getelementptr inbounds %main, %main* %0, i32 0, i32 11 - %call = call i8 @fn_sint(i8* %var1_sint, i8* %var2_sint) - %1 = bitcast i16* %var1_int to i8* - %2 = bitcast i16* %var2_int to i8* - %call1 = call i8 @fn_sint(i8* %1, i8* %2) - %3 = bitcast i32* %var1_dint to i8* - %4 = bitcast i32* %var2_dint to i8* - %call2 = call i8 @fn_sint(i8* %3, i8* %4) - %5 = bitcast i64* %var1_lint to i8* - %6 = bitcast i64* %var2_lint to i8* - %call3 = call i8 @fn_sint(i8* %5, i8* %6) - %7 = bitcast i8* %var1_sint to i64* - %8 = bitcast i8* %var2_sint to i64* - %call4 = call i64 @fn_lint(i64* %7, i64* %8) - %9 = bitcast i16* %var1_int to i64* - %10 = bitcast i16* %var2_int to i64* - %call5 = call i64 @fn_lint(i64* %9, i64* %10) - %11 = bitcast i32* %var1_dint to i64* - %12 = bitcast i32* %var2_dint to i64* - %call6 = call i64 @fn_lint(i64* %11, i64* %12) - %call7 = call i64 @fn_lint(i64* %var1_lint, i64* %var2_lint) - %call8 = call i64 @fn_real(float* %var1_real, float* %var2_real) - %13 = bitcast double* %var1_lreal to float* - %14 = bitcast double* %var2_lreal to float* - %call9 = call i64 @fn_real(float* %13, float* %14) - %15 = bitcast float* %var1_real to double* - %16 = bitcast float* %var2_real to double* - %call10 = call i64 @fn_lreal(double* %15, double* %16) - %call11 = call i64 @fn_lreal(double* %var1_lreal, double* %var2_lreal) + %var1_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var1_int = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var2_int = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %var1_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 4 + %var2_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 5 + %var1_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 6 + %var2_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 7 + %var1_real = getelementptr inbounds %main, ptr %0, i32 0, i32 8 + %var2_real = getelementptr inbounds %main, ptr %0, i32 0, i32 9 + %var1_lreal = getelementptr inbounds %main, ptr %0, i32 0, i32 10 + %var2_lreal = getelementptr inbounds %main, ptr %0, i32 0, i32 11 + %call = call i8 @fn_sint(ptr %var1_sint, ptr %var2_sint) + %call1 = call i8 @fn_sint(ptr %var1_int, ptr %var2_int) + %call2 = call i8 @fn_sint(ptr %var1_dint, ptr %var2_dint) + %call3 = call i8 @fn_sint(ptr %var1_lint, ptr %var2_lint) + %call4 = call i64 @fn_lint(ptr %var1_sint, ptr %var2_sint) + %call5 = call i64 @fn_lint(ptr %var1_int, ptr %var2_int) + %call6 = call i64 @fn_lint(ptr %var1_dint, ptr %var2_dint) + %call7 = call i64 @fn_lint(ptr %var1_lint, ptr %var2_lint) + %call8 = call i64 @fn_real(ptr %var1_real, ptr %var2_real) + %call9 = call i64 @fn_real(ptr %var1_lreal, ptr %var2_lreal) + %call10 = call i64 @fn_lreal(ptr %var1_real, ptr %var2_real) + %call11 = call i64 @fn_lreal(ptr %var1_lreal, ptr %var2_lreal) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap index 0dec905aa79..03af2c64f53 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap @@ -1,38 +1,35 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -define void @foo(i32* %0) { +define void @foo(ptr %0) { entry: - %foo = alloca i32*, align 8 - store i32* %0, i32** %foo, align 8 - %deref = load i32*, i32** %foo, align 8 - store [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1], i32* %deref, align 4 + %foo = alloca ptr, align 8 + store ptr %0, ptr %foo, align 8 + %deref = load ptr, ptr %foo, align 8 + store [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1], ptr %deref, align 4 ret void } define void @main() { entry: %value = alloca i32, align 4 - store i32 0, i32* %value, align 4 + store i32 0, ptr %value, align 4 %__foo0 = alloca [5 x i32], align 4 - %0 = bitcast [5 x i32]* %__foo0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([5 x i32]* getelementptr ([5 x i32], [5 x i32]* null, i32 1) to i64), i1 false) - %1 = bitcast [5 x i32]* %__foo0 to i32* - call void @foo(i32* %1) - %tmpVar = getelementptr inbounds [5 x i32], [5 x i32]* %__foo0, i32 0, i32 2 - %load_tmpVar = load i32, i32* %tmpVar, align 4 - store i32 %load_tmpVar, i32* %value, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %__foo0, i8 0, i64 ptrtoint (ptr getelementptr ([5 x i32], ptr null, i32 1) to i64), i1 false) + call void @foo(ptr %__foo0) + %tmpVar = getelementptr inbounds [5 x i32], ptr %__foo0, i32 0, i32 2 + %load_tmpVar = load i32, ptr %tmpVar, align 4 + store i32 %load_tmpVar, ptr %value, align 4 ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap index 1fa8f783e47..c51d8721e35 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,20 +14,19 @@ target triple = "[filtered]" @utf08_literal_1 = private unnamed_addr constant [4 x i8] c"abc\00" @utf08_literal_2 = private unnamed_addr constant [7 x i8] c"abcdef\00" -declare i32 @foo(i32, i8**) +declare i32 @foo(i32, ptr) -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %1 = alloca [3 x i8*], align 8 - %2 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i32 0, i32 0 - store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0), i8** %2, align 8 - %3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i32 0, i32 1 - store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_1, i32 0, i32 0), i8** %3, align 8 - %4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i32 0, i32 2 - store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @utf08_literal_2, i32 0, i32 0), i8** %4, align 8 - %5 = bitcast [3 x i8*]* %1 to i8** - %call = call i32 @foo(i32 3, i8** %5) - store i32 %call, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %1 = alloca [3 x ptr], align 8 + %2 = getelementptr inbounds [3 x ptr], ptr %1, i32 0, i32 0 + store ptr @utf08_literal_0, ptr %2, align 8 + %3 = getelementptr inbounds [3 x ptr], ptr %1, i32 0, i32 1 + store ptr @utf08_literal_1, ptr %3, align 8 + %4 = getelementptr inbounds [3 x ptr], ptr %1, i32 0, i32 2 + store ptr @utf08_literal_2, ptr %4, align 8 + %call = call i32 @foo(i32 3, ptr %1) + store i32 %call, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap index 5d9d1419644..216c1d167d1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,22 +11,21 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -declare i32 @foo(i32, i32*) +declare i32 @foo(i32, ptr) -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 1 %1 = alloca [3 x i32], align 4 - %2 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i32 0, i32 0 - store i32 0, i32* %2, align 4 - %3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i32 0, i32 1 - store i32 3, i32* %3, align 4 - %4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i32 0, i32 2 - store i32 %tmpVar, i32* %4, align 4 - %5 = bitcast [3 x i32]* %1 to i32* - %call = call i32 @foo(i32 3, i32* %5) - store i32 %call, i32* %x, align 4 + %2 = getelementptr inbounds [3 x i32], ptr %1, i32 0, i32 0 + store i32 0, ptr %2, align 4 + %3 = getelementptr inbounds [3 x i32], ptr %1, i32 0, i32 1 + store i32 3, ptr %3, align 4 + %4 = getelementptr inbounds [3 x i32], ptr %1, i32 0, i32 2 + store i32 %tmpVar, ptr %4, align 4 + %call = call i32 @foo(i32 3, ptr %1) + store i32 %call, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap index e4704070640..688d6976f2f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,12 +13,12 @@ target triple = "[filtered]" declare i32 @foo(...) -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %load_x = load i32, i32* %x, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 1 %call = call i32 (...) @foo(i1 false, i32 3, i32 %tmpVar) - store i32 %call, i32* %x, align 4 + store i32 %call, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap index 9e5bcb70fa6..69644891bbe 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,27 +12,23 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -declare void @func(i8*, i8*) +declare void @func(ptr, ptr) -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %res = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %res = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %__func0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__func0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %__func0 to i8* - call void @func(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0)) - %3 = bitcast [81 x i8]* %res to i8* - %4 = bitcast [81 x i8]* %__func0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %4, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__func0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @func(ptr %__func0, ptr @utf08_literal_0) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %res, ptr align 1 %__func0, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap index 2f802f5e93b..3c57febfb48 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__member_variables_in_body.snap @@ -1,46 +1,45 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -define i32 @func(i16 %0, i8* %1, i64* %2) { +define i32 @func(i16 %0, ptr %1, ptr %2) { entry: %func = alloca i32, align 4 %i = alloca i16, align 2 - store i16 %0, i16* %i, align 2 - %io = alloca i8*, align 8 - store i8* %1, i8** %io, align 8 - %o = alloca i64*, align 8 - store i64* %2, i64** %o, align 8 + store i16 %0, ptr %i, align 2 + %io = alloca ptr, align 8 + store ptr %1, ptr %io, align 8 + %o = alloca ptr, align 8 + store ptr %2, ptr %o, align 8 %v = alloca i16, align 2 %vt = alloca i16, align 2 - store i16 1, i16* %v, align 2 - store i16 2, i16* %vt, align 2 - store i32 0, i32* %func, align 4 - %load_i = load i16, i16* %i, align 2 + store i16 1, ptr %v, align 2 + store i16 2, ptr %vt, align 2 + store i32 0, ptr %func, align 4 + %load_i = load i16, ptr %i, align 2 %3 = sext i16 %load_i to i32 - %deref = load i8*, i8** %io, align 8 - %load_io = load i8, i8* %deref, align 1 + %deref = load ptr, ptr %io, align 8 + %load_io = load i8, ptr %deref, align 1 %4 = sext i8 %load_io to i32 %tmpVar = mul i32 %3, %4 %5 = sext i32 %tmpVar to i64 - %deref1 = load i64*, i64** %o, align 8 - %load_o = load i64, i64* %deref1, align 8 + %deref1 = load ptr, ptr %o, align 8 + %load_o = load i64, ptr %deref1, align 8 %tmpVar2 = sub i64 %5, %load_o - %load_v = load i16, i16* %v, align 2 + %load_v = load i16, ptr %v, align 2 %6 = sext i16 %load_v to i32 - %load_vt = load i16, i16* %vt, align 2 + %load_vt = load i16, ptr %vt, align 2 %7 = sext i16 %load_vt to i32 %tmpVar3 = mul i32 %6, %7 %8 = sext i32 %tmpVar3 to i64 %tmpVar4 = add i64 %tmpVar2, %8 %9 = trunc i64 %tmpVar4 to i32 - store i32 %9, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + store i32 %9, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap index e934c713561..3aca5b2e084 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__on_functions_var_output_should_be_passed_as_a_pointer.snap @@ -1,22 +1,21 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -define i32 @bump(i8* %0) { +define i32 @bump(ptr %0) { entry: %bump = alloca i32, align 4 - %v = alloca i8*, align 8 - store i8* %0, i8** %v, align 8 - store i32 0, i32* %bump, align 4 - store i32 1, i32* %bump, align 4 - %deref = load i8*, i8** %v, align 8 - store i8 2, i8* %deref, align 1 - %bump_ret = load i32, i32* %bump, align 4 + %v = alloca ptr, align 8 + store ptr %0, ptr %v, align 8 + store i32 0, ptr %bump, align 4 + store i32 1, ptr %bump, align 4 + %deref = load ptr, ptr %v, align 8 + store i8 2, ptr %deref, align 1 + %bump_ret = load i32, ptr %bump, align 4 ret i32 %bump_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap index 21477f52bfd..bd7445aac6a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,32 +12,30 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" -define i32 @func(i8* %0) { +define i32 @func(ptr %0) { entry: %func = alloca i32, align 4 %x = alloca [6 x i8], align 1 - %bitcast = bitcast [6 x i8]* %x to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 6, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 5, i1 false) - store i32 0, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + call void @llvm.memset.p0.i64(ptr align 1 %x, i8 0, i64 6, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %x, ptr align 1 %0, i64 5, i1 false) + store i32 0, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %1 = bitcast [6 x i8]* %a to i8* - %call = call i32 @func(i8* %1) - %call1 = call i32 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0)) + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %call = call i32 @func(ptr %a) + %call1 = call i32 @func(ptr @utf08_literal_0) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap index af0187d1e38..4b528bd9729 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,21 +12,20 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"12345\00" -define i32 @func(i8* %0) { +define i32 @func(ptr %0) { entry: %func = alloca i32, align 4 - %x = alloca i8*, align 8 - store i8* %0, i8** %x, align 8 - store i32 0, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + %x = alloca ptr, align 8 + store ptr %0, ptr %x, align 8 + store i32 0, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %1 = bitcast [6 x i8]* %a to i8* - %call = call i32 @func(i8* %1) - %call1 = call i32 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0)) + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %call = call i32 @func(ptr %a) + %call1 = call i32 @func(ptr @utf08_literal_0) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap index 65022ed504f..931c910d404 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_arguments_to_functions_by_ref_and_val.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,41 +11,41 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @func(i16* %0, i32* %1, i16 %2, i32 %3) { +define i32 @func(ptr %0, ptr %1, i16 %2, i32 %3) { entry: %func = alloca i32, align 4 - %byRef1 = alloca i16*, align 8 - store i16* %0, i16** %byRef1, align 8 - %byRef2 = alloca i32*, align 8 - store i32* %1, i32** %byRef2, align 8 + %byRef1 = alloca ptr, align 8 + store ptr %0, ptr %byRef1, align 8 + %byRef2 = alloca ptr, align 8 + store ptr %1, ptr %byRef2, align 8 %byVal1 = alloca i16, align 2 - store i16 %2, i16* %byVal1, align 2 + store i16 %2, ptr %byVal1, align 2 %byVal2 = alloca i32, align 4 - store i32 %3, i32* %byVal2, align 4 - store i32 0, i32* %func, align 4 - %deref = load i16*, i16** %byRef1, align 8 - %load_byRef1 = load i16, i16* %deref, align 2 + store i32 %3, ptr %byVal2, align 4 + store i32 0, ptr %func, align 4 + %deref = load ptr, ptr %byRef1, align 8 + %load_byRef1 = load i16, ptr %deref, align 2 %4 = sext i16 %load_byRef1 to i32 - %deref1 = load i32*, i32** %byRef2, align 8 - %load_byRef2 = load i32, i32* %deref1, align 4 + %deref1 = load ptr, ptr %byRef2, align 8 + %load_byRef2 = load i32, ptr %deref1, align 4 %tmpVar = mul i32 %4, %load_byRef2 - %load_byVal1 = load i16, i16* %byVal1, align 2 + %load_byVal1 = load i16, ptr %byVal1, align 2 %5 = sext i16 %load_byVal1 to i32 %tmpVar2 = mul i32 %tmpVar, %5 - %deref3 = load i32*, i32** %byRef2, align 8 - %load_byRef24 = load i32, i32* %deref3, align 4 + %deref3 = load ptr, ptr %byRef2, align 8 + %load_byRef24 = load i32, ptr %deref3, align 4 %tmpVar5 = mul i32 %tmpVar2, %load_byRef24 - store i32 %tmpVar5, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + store i32 %tmpVar5, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %1 = alloca i16, align 2 - store i16 1, i16* %1, align 2 + store i16 1, ptr %1, align 2 %2 = alloca i32, align 4 - store i32 2, i32* %2, align 4 - %call = call i32 @func(i16* %1, i32* %2, i16 3, i32 4) + store i32 2, ptr %2, align 4 + %call = call i32 @func(ptr %1, ptr %2, i16 3, i32 4) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap index fac468d1b33..f34bb1ddc47 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__return_variable_in_nested_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: codegen(src) -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,13 +12,13 @@ entry: %main = alloca i32, align 4 %x1 = alloca i32, align 4 %x2 = alloca i32, align 4 - store i32 0, i32* %x1, align 4 - store i32 0, i32* %x2, align 4 - store i32 0, i32* %main, align 4 - %0 = ptrtoint i32* %main to i64 + store i32 0, ptr %x1, align 4 + store i32 0, ptr %x2, align 4 + store i32 0, ptr %main, align 4 + %0 = ptrtoint ptr %main to i64 %call = call i32 @SMC_Read(i64 %0) - store i32 %call, i32* %x1, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 %call, ptr %x1, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } @@ -27,8 +26,8 @@ define i32 @SMC_Read(i64 %0) { entry: %SMC_Read = alloca i32, align 4 %ValAddr = alloca i64, align 8 - store i64 %0, i64* %ValAddr, align 8 - store i32 0, i32* %SMC_Read, align 4 - %SMC_Read_ret = load i32, i32* %SMC_Read, align 4 + store i64 %0, ptr %ValAddr, align 8 + store i32 0, ptr %SMC_Read, align 4 + %SMC_Read_ret = load i32, ptr %SMC_Read, align 4 ret i32 %SMC_Read_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap index 1e6ec2c6f93..65c5d97d862 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,19 +15,19 @@ define i32 @func(i32 %0) { entry: %func = alloca i32, align 4 %x = alloca i32, align 4 - store i32 %0, i32* %x, align 4 - store i32 0, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + store i32 %0, ptr %x, align 4 + store i32 0, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %load_a = load i32, i32* %a, align 4 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %load_a = load i32, ptr %a, align 4 %call = call i32 @func(i32 %load_a) %call1 = call i32 @func(i32 1) - %load_a2 = load i32, i32* %a, align 4 + %load_a2 = load i32, ptr %a, align 4 %tmpVar = add i32 1, %load_a2 %call3 = call i32 @func(i32 %tmpVar) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap index 102eab2916e..f8602063c45 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/function_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,22 +11,22 @@ target triple = "[filtered]" @main_instance = global %main { i16 4 } -define i32 @func(i16* %0) { +define i32 @func(ptr %0) { entry: %func = alloca i32, align 4 - %o = alloca i16*, align 8 - store i16* %0, i16** %o, align 8 - store i32 0, i32* %func, align 4 - %deref = load i16*, i16** %o, align 8 - store i16 6, i16* %deref, align 2 - store i32 4, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + %o = alloca ptr, align 8 + store ptr %0, ptr %o, align 8 + store i32 0, ptr %func, align 4 + %deref = load ptr, ptr %o, align 8 + store i16 6, ptr %deref, align 2 + store i32 4, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %call = call i32 @func(i16* %x) + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %call = call i32 @func(ptr %x) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap index 75db1b553cf..ec9ee1d640c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/generics_test.rs expression: codegen(src) -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,46 +15,46 @@ define float @foo__REAL(float %0) { entry: %foo__REAL = alloca float, align 4 %in1 = alloca float, align 4 - store float %0, float* %in1, align 4 - store float 0.000000e+00, float* %foo__REAL, align 4 - %foo__REAL_ret = load float, float* %foo__REAL, align 4 + store float %0, ptr %in1, align 4 + store float 0.000000e+00, ptr %foo__REAL, align 4 + %foo__REAL_ret = load float, ptr %foo__REAL, align 4 ret float %foo__REAL_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %res_sint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %res_int = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %res_dint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %res_lint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %res_usint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 4 - %res_uint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 5 - %res_udint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 6 - %res_ulint = getelementptr inbounds %prg, %prg* %0, i32 0, i32 7 + %res_sint = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %res_int = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %res_dint = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %res_lint = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %res_usint = getelementptr inbounds %prg, ptr %0, i32 0, i32 4 + %res_uint = getelementptr inbounds %prg, ptr %0, i32 0, i32 5 + %res_udint = getelementptr inbounds %prg, ptr %0, i32 0, i32 6 + %res_ulint = getelementptr inbounds %prg, ptr %0, i32 0, i32 7 %v_dint = alloca i32, align 4 %v_udint = alloca i32, align 4 - store i32 1, i32* %v_dint, align 4 - store i32 1, i32* %v_udint, align 4 + store i32 1, ptr %v_dint, align 4 + store i32 1, ptr %v_udint, align 4 %call = call float @foo__REAL(float 1.000000e+00) - store float %call, float* %res_sint, align 4 + store float %call, ptr %res_sint, align 4 %call1 = call float @foo__REAL(float 1.000000e+00) - store float %call1, float* %res_int, align 4 - %load_v_dint = load i32, i32* %v_dint, align 4 + store float %call1, ptr %res_int, align 4 + %load_v_dint = load i32, ptr %v_dint, align 4 %1 = sitofp i32 %load_v_dint to float %call2 = call float @foo__REAL(float %1) - store float %call2, float* %res_dint, align 4 + store float %call2, ptr %res_dint, align 4 %call3 = call double @foo__LREAL(double 1.000000e+00) - store double %call3, double* %res_lint, align 8 + store double %call3, ptr %res_lint, align 8 %call4 = call float @foo__REAL(float 1.000000e+00) - store float %call4, float* %res_usint, align 4 + store float %call4, ptr %res_usint, align 4 %call5 = call float @foo__REAL(float 1.000000e+00) - store float %call5, float* %res_uint, align 4 - %load_v_udint = load i32, i32* %v_udint, align 4 + store float %call5, ptr %res_uint, align 4 + %load_v_udint = load i32, ptr %v_udint, align 4 %2 = sitofp i32 %load_v_udint to float %call6 = call float @foo__REAL(float %2) - store float %call6, float* %res_udint, align 4 + store float %call6, ptr %res_udint, align 4 %call7 = call double @foo__LREAL(double 1.000000e+00) - store double %call7, double* %res_ulint, align 8 + store double %call7, ptr %res_ulint, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap index cb83c6d237d..fb73b1b6ad3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_call_gets_cast_to_biggest_type.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/generics_test.rs expression: codegen(src) -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,21 +10,20 @@ target triple = "[filtered]" define double @main() { entry: %main = alloca double, align 8 - store double 0.000000e+00, double* %main, align 8 + store double 0.000000e+00, ptr %main, align 8 %0 = alloca [4 x double], align 8 - %1 = getelementptr inbounds [4 x double], [4 x double]* %0, i32 0, i32 0 - store double 5.000000e+00, double* %1, align 8 - %2 = getelementptr inbounds [4 x double], [4 x double]* %0, i32 0, i32 1 - store double 1.000000e+00, double* %2, align 8 - %3 = getelementptr inbounds [4 x double], [4 x double]* %0, i32 0, i32 2 - store double 1.500000e+00, double* %3, align 8 - %4 = getelementptr inbounds [4 x double], [4 x double]* %0, i32 0, i32 3 - store double 1.200000e+00, double* %4, align 8 - %5 = bitcast [4 x double]* %0 to double* - %call = call double @MAX__LREAL(i32 4, double* %5) - store double %call, double* %main, align 8 - %main_ret = load double, double* %main, align 8 + %1 = getelementptr inbounds [4 x double], ptr %0, i32 0, i32 0 + store double 5.000000e+00, ptr %1, align 8 + %2 = getelementptr inbounds [4 x double], ptr %0, i32 0, i32 1 + store double 1.000000e+00, ptr %2, align 8 + %3 = getelementptr inbounds [4 x double], ptr %0, i32 0, i32 2 + store double 1.500000e+00, ptr %3, align 8 + %4 = getelementptr inbounds [4 x double], ptr %0, i32 0, i32 3 + store double 1.200000e+00, ptr %4, align 8 + %call = call double @MAX__LREAL(i32 4, ptr %0) + store double %call, ptr %main, align 8 + %main_ret = load double, ptr %main, align 8 ret double %main_ret } -declare double @MAX__LREAL(i32, double*) +declare double @MAX__LREAL(i32, ptr) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap index 378dda5c867..130b62caa67 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/generics_test.rs expression: prg -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,36 +9,33 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [212 x i8] c" this is a very long sentence with plenty of characters and weird spacing.the same is true for this string.\00" -define void @main(i8* %0) { +define void @main(ptr %0) { entry: - %main = alloca i8*, align 8 - store i8* %0, i8** %main, align 8 + %main = alloca ptr, align 8 + store ptr %0, ptr %main, align 8 %l = alloca i32, align 4 %p = alloca i32, align 4 - store i32 0, i32* %l, align 4 - store i32 0, i32* %p, align 4 - store i32 4, i32* %l, align 4 - store i32 6, i32* %p, align 4 + store i32 0, ptr %l, align 4 + store i32 0, ptr %p, align 4 + store i32 4, ptr %l, align 4 + store i32 6, ptr %p, align 4 %__MID0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__MID0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %__MID0 to i8* - %load_l = load i32, i32* %l, align 4 - %load_p = load i32, i32* %p, align 4 - call void @MID__STRING(i8* %2, i8* getelementptr inbounds ([212 x i8], [212 x i8]* @utf08_literal_0, i32 0, i32 0), i32 %load_l, i32 %load_p) - %deref = load i8*, i8** %main, align 8 - %3 = bitcast [81 x i8]* %__MID0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 %3, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__MID0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + %load_l = load i32, ptr %l, align 4 + %load_p = load i32, ptr %p, align 4 + call void @MID__STRING(ptr %__MID0, ptr @utf08_literal_0, i32 %load_l, i32 %load_p) + %deref = load ptr, ptr %main, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 %__MID0, i32 80, i1 false) ret void } -declare void @MID__STRING(i8*, i8*, i32, i32) +declare void @MID__STRING(ptr, ptr, i32, i32) -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap index a98d98700e1..ada38759601 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/generics_test.rs expression: prg -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,21 +15,21 @@ define i32 @MAX__DINT(i32 %0, i32 %1) { entry: %MAX__DINT = alloca i32, align 4 %in1 = alloca i32, align 4 - store i32 %0, i32* %in1, align 4 + store i32 %0, ptr %in1, align 4 %in2 = alloca i32, align 4 - store i32 %1, i32* %in2, align 4 - store i32 0, i32* %MAX__DINT, align 4 - %MAX__DINT_ret = load i32, i32* %MAX__DINT, align 4 + store i32 %1, ptr %in2, align 4 + store i32 0, ptr %MAX__DINT, align 4 + %MAX__DINT_ret = load i32, ptr %MAX__DINT, align 4 ret i32 %MAX__DINT_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 %call = call i32 @MAX__DINT(i32 1, i32 2) - %load_a = load i16, i16* %a, align 2 - %load_b = load i16, i16* %b, align 2 + %load_a = load i16, ptr %a, align 2 + %load_b = load i16, ptr %b, align 2 %call1 = call i16 @MAX__INT(i16 %load_a, i16 %load_b) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap index d197ef7cb11..028f6b374e8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/generics_test.rs expression: codegen(src) -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -10,20 +9,18 @@ target triple = "[filtered]" @utf16_literal_0 = private unnamed_addr constant [6 x i16] [i16 72, i16 101, i16 108, i16 108, i16 111, i16 0] -declare void @TO_STRING__WSTRING(i8*, i16*) +declare void @TO_STRING__WSTRING(ptr, ptr) define void @main() { entry: %__TO_STRING0 = alloca [1025 x i8], align 1 - %0 = bitcast [1025 x i8]* %__TO_STRING0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([1025 x i8]* getelementptr ([1025 x i8], [1025 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [1025 x i8]* %__TO_STRING0 to i8* - call void @TO_STRING__WSTRING(i8* %1, i16* getelementptr inbounds ([6 x i16], [6 x i16]* @utf16_literal_0, i32 0, i32 0)) - %load___TO_STRING0 = load [1025 x i8], [1025 x i8]* %__TO_STRING0, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %__TO_STRING0, i8 0, i64 ptrtoint (ptr getelementptr ([1025 x i8], ptr null, i32 1) to i64), i1 false) + call void @TO_STRING__WSTRING(ptr %__TO_STRING0, ptr @utf16_literal_0) + %load___TO_STRING0 = load [1025 x i8], ptr %__TO_STRING0, align 1 ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap index ebf73b64db5..8c86d67eb14 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/generics_test.rs expression: codegen(src) -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,25 +11,25 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define i16 @foo__INT(i64 %0, i16* %1) { +define i16 @foo__INT(i64 %0, ptr %1) { entry: %foo__INT = alloca i16, align 2 %in1 = alloca i64, align 8 - store i64 %0, i64* %in1, align 8 - %out1 = alloca i16*, align 8 - store i16* %1, i16** %out1, align 8 - store i16 0, i16* %foo__INT, align 2 - %foo__INT_ret = load i16, i16* %foo__INT, align 2 + store i64 %0, ptr %in1, align 8 + %out1 = alloca ptr, align 8 + store ptr %1, ptr %out1, align 8 + store i16 0, ptr %foo__INT, align 2 + %foo__INT_ret = load i16, ptr %foo__INT, align 2 ret i16 %foo__INT_ret } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %theInt = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %iResult = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %data = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_data = load i64, i64* %data, align 8 - %call = call i16 @foo__INT(i64 %load_data, i16* %theInt) - store i16 %call, i16* %iResult, align 2 + %theInt = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %iResult = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %data = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_data = load i64, ptr %data, align 8 + %call = call i16 @foo__INT(i64 %load_data, ptr %theInt) + store i16 %call, ptr %iResult, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap index cad6b382099..a03b24909ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap @@ -7,7 +7,7 @@ source_filename = "myStruct.st" target datalayout = "[filtered]" target triple = "[filtered]" -%myStruct = type { i32, i16* } +%myStruct = type { i32, ptr } @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer @@ -17,13 +17,13 @@ target datalayout = "[filtered]" target triple = "[filtered]" %prog = type { %myStruct.1 } -%myStruct.1 = type { i32, i16* } +%myStruct.1 = type { i32, ptr } @prog_instance = global %prog zeroinitializer @__myStruct__init = external unnamed_addr constant %myStruct.1 -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 + %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap index fd905b2e8e7..08ed3c5f08c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap @@ -1,16 +1,15 @@ --- source: src/codegen/tests/multifile_codegen_tests.rs expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" -snapshot_kind: text --- ; ModuleID = 'myStruct.st' source_filename = "myStruct.st" target datalayout = "[filtered]" target triple = "[filtered]" -%myStruct = type { i32, i16* } +%myStruct = type { i32, ptr } -@__myStruct__init = unnamed_addr constant %myStruct { i32 20, i16* null } +@__myStruct__init = unnamed_addr constant %myStruct { i32 20, ptr null } ; ModuleID = 'prog.st' source_filename = "prog.st" @@ -21,8 +20,8 @@ target triple = "[filtered]" @prog_instance = global %prog zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 + %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap index bf5cb70afeb..2fdb2deeeca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/multifile_codegen_tests.rs expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" -snapshot_kind: text --- ; ModuleID = 'MyInt.st' source_filename = "MyInt.st" @@ -17,8 +16,8 @@ target triple = "[filtered]" @prog_instance = global %prog { i16 5 } -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 + %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap index 9ebcf75f16a..53620c6998a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/multifile_codegen_tests.rs expression: "codegen_multi(units, crate::DebugLevel::None).join(\"\\n\")" -snapshot_kind: text --- ; ModuleID = 'myEnum.st' source_filename = "myEnum.st" @@ -21,11 +20,11 @@ target triple = "[filtered]" @__fb__init = unnamed_addr constant %fb { i32 1 } -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 - %x = getelementptr inbounds %fb, %fb* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void } @@ -40,7 +39,7 @@ target triple = "[filtered]" @__myStruct__init = unnamed_addr constant %myStruct { %fb.2 { i32 1 } } @__fb__init = external unnamed_addr constant %fb.2 -declare void @fb(%fb.2*) +declare void @fb(ptr) ; ModuleID = 'fb2.st' source_filename = "fb2.st" @@ -55,15 +54,15 @@ target triple = "[filtered]" @__myStruct__init = external unnamed_addr constant %myStruct.4 @__fb__init = external unnamed_addr constant %fb.5 -define void @fb2(%fb2* %0) { +define void @fb2(ptr %0) { entry: - %this = alloca %fb2*, align 8 - store %fb2* %0, %fb2** %this, align 8 - %x = getelementptr inbounds %fb2, %fb2* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %x = getelementptr inbounds %fb2, ptr %0, i32 0, i32 0 ret void } -declare void @fb(%fb.5*) +declare void @fb(ptr) ; ModuleID = 'fb3.st' source_filename = "fb3.st" @@ -74,9 +73,9 @@ target triple = "[filtered]" @__fb3__init = unnamed_addr constant %fb3 zeroinitializer -define void @fb3(%fb3* %0) { +define void @fb3(ptr %0) { entry: - %this = alloca %fb3*, align 8 - store %fb3* %0, %fb3** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap index 4cceb85d294..154b51823b4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap @@ -10,8 +10,8 @@ target triple = "[filtered]" define i32 @func() { entry: %func = alloca i32, align 4 - store i32 0, i32* %func, align 4 - %func_ret = load i32, i32* %func, align 4 + store i32 0, ptr %func, align 4 + %func_ret = load i32, ptr %func, align 4 ret i32 %func_ret } @@ -24,10 +24,10 @@ target triple = "[filtered]" @__fb__init = unnamed_addr constant %fb zeroinitializer -define void @fb(%fb* %0) { +define void @fb(ptr %0) { entry: - %this = alloca %fb*, align 8 - store %fb* %0, %fb** %this, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 ret void } @@ -40,9 +40,9 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 ret void } @@ -55,9 +55,9 @@ target triple = "[filtered]" @prg2_instance = global %prg2 zeroinitializer -define void @prg2(%prg2* %0) { +define void @prg2(ptr %0) { entry: - %b = getelementptr inbounds %prg2, %prg2* %0, i32 0, i32 0 + %b = getelementptr inbounds %prg2, ptr %0, i32 0, i32 0 ret void } @@ -76,20 +76,20 @@ target triple = "[filtered]" @prg_instance = external global %prg.5 @prg2_instance = external global %prg2.6 -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %myFb = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %load_a = load i32, i32* getelementptr inbounds (%prg.5, %prg.5* @prg_instance, i32 0, i32 0), align 4 - call void @prg2(%prg2.6* @prg2_instance) + %myFb = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %load_a = load i32, ptr @prg_instance, align 4 + call void @prg2(ptr @prg2_instance) %call = call i32 @func() - call void @fb(%fb.4* %myFb) + call void @fb(ptr %myFb) ret void } -declare void @fb(%fb.4*) +declare void @fb(ptr) -declare void @prg(%prg.5*) +declare void @prg(ptr) -declare void @prg2(%prg2.6*) +declare void @prg2(ptr) declare i32 @func() diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap index 283683de58b..6be38bd9c3a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__global_value_from_different_file.snap @@ -32,8 +32,8 @@ target triple = "[filtered]" @c = external unnamed_addr constant i32 @x = external global i32 -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - store i32 7, i32* @x, align 4 + store i32 7, ptr @x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap index 12e9f5236c0..dbbbcb43130 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap @@ -34,9 +34,9 @@ target triple = "[filtered]" @__myStruct2__init = external unnamed_addr constant %myStruct2.3 @__prog.x__init = unnamed_addr constant %myStruct.2 { i32 5, i16 2 } -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %y = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 + %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap index 99a636d2243..050e1dcb9ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap @@ -13,20 +13,20 @@ target triple = "[filtered]" @__fb_t__init = unnamed_addr constant %fb_t zeroinitializer @main_instance = global %main zeroinitializer -define void @fb_t(%fb_t* %0) { +define void @fb_t(ptr %0) { entry: - %this = alloca %fb_t*, align 8 - store %fb_t* %0, %fb_t** %this, align 8 - %in1 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 - %in2 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %in1 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 + %in2 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %1 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 0 - store i32 1, i32* %1, align 4 - call void @fb_t(%fb_t* %fb) + %fb = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 0 + store i32 1, ptr %1, align 4 + call void @fb_t(ptr %fb) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap index d45989586b9..b5fe8faa4a8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap @@ -13,22 +13,22 @@ target triple = "[filtered]" @__fb_t__init = unnamed_addr constant %fb_t zeroinitializer @main_instance = global %main zeroinitializer -define void @fb_t(%fb_t* %0) { +define void @fb_t(ptr %0) { entry: - %this = alloca %fb_t*, align 8 - store %fb_t* %0, %fb_t** %this, align 8 - %out1 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 - %out2 = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %out1 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 + %out2 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %fb = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - call void @fb_t(%fb_t* %fb) - %1 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 0 - %2 = load i32, i32* %1, align 4 - store i32 %2, i32* %x, align 4 + %fb = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + call void @fb_t(ptr %fb) + %1 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 0 + %2 = load i32, ptr %1, align 4 + store i32 %2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap index 996c6c21621..e176905c620 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_input_param.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -15,16 +14,16 @@ target triple = "[filtered]" define void @foo(i32 %0, i32 %1) { entry: %in1 = alloca i32, align 4 - store i32 %0, i32* %in1, align 4 + store i32 %0, ptr %in1, align 4 %in2 = alloca i32, align 4 - store i32 %1, i32* %in2, align 4 + store i32 %1, ptr %in2, align 4 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %1 = alloca i32, align 4 - %2 = load i32, i32* %1, align 4 + %2 = load i32, ptr %1, align 4 call void @foo(i32 1, i32 %2) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap index 2050373d0b1..228021382f9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,19 +11,19 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define void @foo(i32* %0, i32* %1) { +define void @foo(ptr %0, ptr %1) { entry: - %out1 = alloca i32*, align 8 - store i32* %0, i32** %out1, align 8 - %out2 = alloca i32*, align 8 - store i32* %1, i32** %out2, align 8 + %out1 = alloca ptr, align 8 + store ptr %0, ptr %out1, align 8 + %out2 = alloca ptr, align 8 + store ptr %1, ptr %out2, align 8 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %1 = alloca i32, align 4 - call void @foo(i32* %x, i32* %1) + call void @foo(ptr %x, ptr %1) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap index 21551b4f2d0..cebc0123416 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,30 +11,30 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 - %call = call i32 @foo(i32 %load_var1, i32* %var2, i32* %var3) - %load_var11 = load i32, i32* %var1, align 4 - %call2 = call i32 @foo(i32 %load_var11, i32* %var2, i32* %var3) - %load_var13 = load i32, i32* %var1, align 4 - %call4 = call i32 @foo(i32 %load_var13, i32* %var2, i32* %var3) + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 + %call = call i32 @foo(i32 %load_var1, ptr %var2, ptr %var3) + %load_var11 = load i32, ptr %var1, align 4 + %call2 = call i32 @foo(i32 %load_var11, ptr %var2, ptr %var3) + %load_var13 = load i32, ptr %var1, align 4 + %call4 = call i32 @foo(i32 %load_var13, ptr %var2, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap index e2a53ca6702..43bcd7fadad 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,31 +11,31 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2, i32* %3) { +define i32 @foo(i32 %0, ptr %1, ptr %2, ptr %3) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %output2 = alloca i32*, align 8 - store i32* %2, i32** %output2, align 8 - %inout1 = alloca i32*, align 8 - store i32* %3, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %output2 = alloca ptr, align 8 + store ptr %2, ptr %output2, align 8 + %inout1 = alloca ptr, align 8 + store ptr %3, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 %1 = alloca i32, align 4 - store i32 20, i32* %1, align 4 + store i32 20, ptr %1, align 4 %2 = alloca i32, align 4 - store i32 20, i32* %2, align 4 - %call = call i32 @foo(i32 20, i32* %2, i32* %1, i32* %var3) + store i32 20, ptr %2, align 4 + %call = call i32 @foo(i32 20, ptr %2, ptr %1, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap index 44be2ae9907..9ed6a085729 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,27 +11,27 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 - %call = call i32 @foo(i32 %load_var1, i32* %var2, i32* %1) + %call = call i32 @foo(i32 %load_var1, ptr %var2, ptr %1) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap index 6d0ed49d4b0..0a4c6ab5049 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,27 +11,27 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 %1 = alloca i32, align 4 - %2 = load i32, i32* %1, align 4 - %call = call i32 @foo(i32 %2, i32* %var2, i32* %var3) + %2 = load i32, ptr %1, align 4 + %call = call i32 @foo(i32 %2, ptr %var2, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap index 7d28ee1b658..5a8f77e251b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,27 +11,27 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 - %call = call i32 @foo(i32 %load_var1, i32* %1, i32* %var3) + %call = call i32 @foo(i32 %load_var1, ptr %1, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap index d708f1bac86..59f0e250bc8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,28 +11,28 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 - store i32 3, i32* %1, align 4 - %call = call i32 @foo(i32 %load_var1, i32* %1, i32* %var3) + store i32 3, ptr %1, align 4 + %call = call i32 @foo(i32 %load_var1, ptr %1, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap index 44be2ae9907..9ed6a085729 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,27 +11,27 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 - %call = call i32 @foo(i32 %load_var1, i32* %var2, i32* %1) + %call = call i32 @foo(i32 %load_var1, ptr %var2, ptr %1) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap index 6d0ed49d4b0..0a4c6ab5049 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,27 +11,27 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 %1 = alloca i32, align 4 - %2 = load i32, i32* %1, align 4 - %call = call i32 @foo(i32 %2, i32* %var2, i32* %var3) + %2 = load i32, ptr %1, align 4 + %call = call i32 @foo(i32 %2, ptr %var2, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap index e9d3e257f28..4731082f763 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,25 +11,25 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %call = call i32 @foo(i32 10, i32* %var2, i32* %var3) + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %call = call i32 @foo(i32 10, ptr %var2, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap index 7d28ee1b658..5a8f77e251b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,27 +11,27 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 - %call = call i32 @foo(i32 %load_var1, i32* %1, i32* %var3) + %call = call i32 @foo(i32 %load_var1, ptr %1, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap index d708f1bac86..59f0e250bc8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,28 +11,28 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer -define i32 @foo(i32 %0, i32* %1, i32* %2) { +define i32 @foo(i32 %0, ptr %1, ptr %2) { entry: %foo = alloca i32, align 4 %input1 = alloca i32, align 4 - store i32 %0, i32* %input1, align 4 - %output1 = alloca i32*, align 8 - store i32* %1, i32** %output1, align 8 - %inout1 = alloca i32*, align 8 - store i32* %2, i32** %inout1, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %0, ptr %input1, align 4 + %output1 = alloca ptr, align 8 + store ptr %1, ptr %output1, align 8 + %inout1 = alloca ptr, align 8 + store ptr %2, ptr %inout1, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 - store i32 3, i32* %1, align 4 - %call = call i32 @foo(i32 %load_var1, i32* %1, i32* %var3) + store i32 3, ptr %1, align 4 + %call = call i32 @foo(i32 %load_var1, ptr %1, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap index 51152f767a5..fa7ffd87bda 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap @@ -7,29 +7,29 @@ source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%main = type { %file_t, %file_t* } +%main = type { %file_t, ptr } %file_t = type { i8, i8 } @main_instance = global %main zeroinitializer @__file_t__init = unnamed_addr constant %file_t zeroinitializer -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %file = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %FileOpen = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - store %file_t* %file, %file_t** %FileOpen, align 8 - %deref = load %file_t*, %file_t** %FileOpen, align 8 - %1 = getelementptr inbounds %file_t, %file_t* %deref, i32 0, i32 1 - store i8 1, i8* %1, align 1 - call void @file_t(%file_t* %deref) + %file = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %FileOpen = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + store ptr %file, ptr %FileOpen, align 8 + %deref = load ptr, ptr %FileOpen, align 8 + %1 = getelementptr inbounds %file_t, ptr %deref, i32 0, i32 1 + store i8 1, ptr %1, align 1 + call void @file_t(ptr %deref) ret void } -define void @file_t(%file_t* %0) { +define void @file_t(ptr %0) { entry: - %this = alloca %file_t*, align 8 - store %file_t* %0, %file_t** %this, align 8 - %var1 = getelementptr inbounds %file_t, %file_t* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %file_t, %file_t* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %var1 = getelementptr inbounds %file_t, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %file_t, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap index b5aa9e86e2d..abb15776187 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,16 +13,16 @@ target triple = "[filtered]" @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %in1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %in2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 + %in1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %in2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - store i32 1, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 - call void @prog(%prog* @prog_instance) + store i32 1, ptr @prog_instance, align 4 + call void @prog(ptr @prog_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap index bb95e0d9c9b..afac299f995 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,20 +13,20 @@ target triple = "[filtered]" @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %out1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %out2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - store i32 1, i32* %out1, align 4 - store i32 2, i32* %out2, align 4 + %out1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %out2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + store i32 1, ptr %out1, align 4 + store i32 2, ptr %out2, align 4 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - call void @prog(%prog* @prog_instance) - %1 = load i32, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 - store i32 %1, i32* %x, align 4 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + call void @prog(ptr @prog_instance) + %1 = load i32, ptr @prog_instance, align 4 + store i32 %1, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap index b8f45d9250d..a42b0a6e4b6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap @@ -1,43 +1,42 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%prog = type { i32, i32, i32* } +%prog = type { i32, i32, ptr } %main = type { i32, i32, i32 } @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 2 + %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 - store i32 %load_var1, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 - store i32* %var3, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 2), align 8 - call void @prog(%prog* @prog_instance) - %1 = load i32, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 4 - store i32 %1, i32* %var2, align 4 - store i32* %var3, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 2), align 8 - %load_var11 = load i32, i32* %var1, align 4 - store i32 %load_var11, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 - call void @prog(%prog* @prog_instance) - %2 = load i32, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 4 - store i32 %2, i32* %var2, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 + store i32 %load_var1, ptr @prog_instance, align 4 + store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + call void @prog(ptr @prog_instance) + %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + store i32 %1, ptr %var2, align 4 + store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + %load_var11 = load i32, ptr %var1, align 4 + store i32 %load_var11, ptr @prog_instance, align 4 + call void @prog(ptr @prog_instance) + %2 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + store i32 %2, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap index 563aabc17e4..083c0736d82 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap @@ -1,37 +1,36 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%prog = type { i32, i32, i32* } +%prog = type { i32, i32, ptr } %main = type { i32, i32, i32 } @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 2 + %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 - store i32 %load_var1, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 - store i32* %var3, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 2), align 8 - call void @prog(%prog* @prog_instance) - %1 = load i32, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 4 - store i32 %1, i32* %var2, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 + store i32 %load_var1, ptr @prog_instance, align 4 + store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + call void @prog(ptr @prog_instance) + %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + store i32 %1, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap index 69741f706ad..465c1887b65 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap @@ -1,38 +1,37 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%prog = type { i32, i32, i32* } +%prog = type { i32, i32, ptr } %main = type { i32, i32, i32 } @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 2 + %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 - store i32 %load_var1, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 + store i32 %load_var1, ptr @prog_instance, align 4 %empty_varinout = alloca i32, align 4 - store i32* %empty_varinout, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 2), align 8 - call void @prog(%prog* @prog_instance) - %1 = load i32, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 4 - store i32 %1, i32* %var2, align 4 + store ptr %empty_varinout, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + call void @prog(ptr @prog_instance) + %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + store i32 %1, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap index 0382383b7d8..f24dfdb4818 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap @@ -1,35 +1,34 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%prog = type { i32, i32, i32* } +%prog = type { i32, i32, ptr } %main = type { i32, i32, i32 } @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 2 + %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - store i32* %var3, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 2), align 8 - call void @prog(%prog* @prog_instance) - %1 = load i32, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1), align 4 - store i32 %1, i32* %var2, align 4 + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + call void @prog(ptr @prog_instance) + %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + store i32 %1, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap index 6993817fdb1..d218687f109 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap @@ -1,35 +1,34 @@ --- source: src/codegen/tests/parameters_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%prog = type { i32, i32, i32* } +%prog = type { i32, i32, ptr } %main = type { i32, i32, i32 } @prog_instance = global %prog zeroinitializer @main_instance = global %main zeroinitializer -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 2 + %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %load_var1 = load i32, i32* %var1, align 4 - store i32 %load_var1, i32* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0), align 4 - store i32* %var3, i32** getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 2), align 8 - call void @prog(%prog* @prog_instance) + %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %load_var1 = load i32, ptr %var1, align 4 + store i32 %load_var1, ptr @prog_instance, align 4 + store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + call void @prog(ptr @prog_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap index 7bbe91b29ab..7d2f6423c21 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap @@ -8,59 +8,59 @@ target datalayout = "[filtered]" target triple = "[filtered]" %mainProg = type { %fb_t, i8, i8 } -%fb_t = type { i8, i8, i8*, i8, i8* } +%fb_t = type { i8, i8, ptr, i8, ptr } @mainProg_instance = global %mainProg zeroinitializer @__fb_t__init = unnamed_addr constant %fb_t zeroinitializer -define void @mainProg(%mainProg* %0) { +define void @mainProg(ptr %0) { entry: - %fb = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 0 - %out1 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 1 - %out2 = getelementptr inbounds %mainProg, %mainProg* %0, i32 0, i32 2 - %1 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 4 - store i8* %out1, i8** %1, align 8 - %2 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 2 - store i8* %out2, i8** %2, align 8 - call void @fb_t(%fb_t* %fb) - %3 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 2 - store i8* %out1, i8** %3, align 8 - %4 = getelementptr inbounds %fb_t, %fb_t* %fb, i32 0, i32 4 - store i8* %out2, i8** %4, align 8 - call void @fb_t(%fb_t* %fb) - %load_out2 = load i8, i8* %out2, align 1 - %load_out1 = load i8, i8* %out1, align 1 - call void @fb_t__foo(%fb_t* %fb) - %load_out21 = load i8, i8* %out2, align 1 - %load_out12 = load i8, i8* %out1, align 1 - call void @fb_t__foo(%fb_t* %fb) + %fb = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 + %out1 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 1 + %out2 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 2 + %1 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 4 + store ptr %out1, ptr %1, align 8 + %2 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 2 + store ptr %out2, ptr %2, align 8 + call void @fb_t(ptr %fb) + %3 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 2 + store ptr %out1, ptr %3, align 8 + %4 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 4 + store ptr %out2, ptr %4, align 8 + call void @fb_t(ptr %fb) + %load_out2 = load i8, ptr %out2, align 1 + %load_out1 = load i8, ptr %out1, align 1 + call void @fb_t__foo(ptr %fb) + %load_out21 = load i8, ptr %out2, align 1 + %load_out12 = load i8, ptr %out1, align 1 + call void @fb_t__foo(ptr %fb) ret void } -define void @fb_t(%fb_t* %0) { +define void @fb_t(ptr %0) { entry: - %this = alloca %fb_t*, align 8 - store %fb_t* %0, %fb_t** %this, align 8 - %myVar = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 - %myInput = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 - %myInOut = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 2 - %myOut = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 3 - %myOtherInOut = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %myVar = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 + %myInput = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 + %myInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 2 + %myOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 3 + %myOtherInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 4 ret void } -define void @fb_t__foo(%fb_t* %0) { +define void @fb_t__foo(ptr %0) { entry: - %this = alloca %fb_t*, align 8 - store %fb_t* %0, %fb_t** %this, align 8 - %myVar = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 0 - %myInput = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 1 - %myInOut = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 2 - %myOut = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 3 - %myOtherInOut = getelementptr inbounds %fb_t, %fb_t* %0, i32 0, i32 4 - %deref = load i8*, i8** %myInOut, align 8 - %deref1 = load i8*, i8** %myOtherInOut, align 8 - %load_myOtherInOut = load i8, i8* %deref1, align 1 - store i8 %load_myOtherInOut, i8* %deref, align 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %myVar = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 + %myInput = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 + %myInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 2 + %myOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 3 + %myOtherInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 4 + %deref = load ptr, ptr %myInOut, align 8 + %deref1 = load ptr, ptr %myOtherInOut, align 8 + %load_myOtherInOut = load i8, ptr %deref1, align 1 + store i8 %load_myOtherInOut, ptr %deref, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap index a1721ecb4d6..4c82764682e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,20 +11,20 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_x = load i32, i32* %x, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_x = load i32, ptr %x, align 4 %shift = lshr i32 %load_x, 2 %1 = trunc i32 %shift to i8 %2 = and i8 %1, 1 - store i8 %2, i8* %a, align 1 - %load_y = load i32, i32* %y, align 4 + store i8 %2, ptr %a, align 1 + %load_y = load i32, ptr %y, align 4 %shift1 = ashr i32 %load_y, 4 %3 = trunc i32 %shift1 to i8 %4 = and i8 %3, 1 - store i8 %4, i8* %a, align 1 + store i8 %4, ptr %a, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap index 8d8d7b33e71..725ce7d4110 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,22 +11,22 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_x = load i32, i32* %x, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_x = load i32, ptr %x, align 4 %shift = lshr i32 %load_x, 0 %1 = trunc i32 %shift to i8 - store i8 %1, i8* %a, align 1 - %load_x1 = load i32, i32* %x, align 4 + store i8 %1, ptr %a, align 1 + %load_x1 = load i32, ptr %x, align 4 %shift2 = lshr i32 %load_x1, 8 %2 = trunc i32 %shift2 to i8 - store i8 %2, i8* %a, align 1 - %load_y = load i32, i32* %y, align 4 + store i8 %2, ptr %a, align 1 + %load_y = load i32, ptr %y, align 4 %shift3 = ashr i32 %load_y, 24 %3 = trunc i32 %shift3 to i8 - store i8 %3, i8* %a, align 1 + store i8 %3, ptr %a, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap index 41d653b2215..ffe8e1d6b95 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,22 +11,22 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_x = load i64, i64* %x, align 8 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_x = load i64, ptr %x, align 8 %shift = lshr i64 %load_x, 0 %1 = trunc i64 %shift to i32 - store i32 %1, i32* %a, align 4 - %load_x1 = load i64, i64* %x, align 8 + store i32 %1, ptr %a, align 4 + %load_x1 = load i64, ptr %x, align 8 %shift2 = lshr i64 %load_x1, 32 %2 = trunc i64 %shift2 to i32 - store i32 %2, i32* %a, align 4 - %load_y = load i64, i64* %y, align 8 + store i32 %2, ptr %a, align 4 + %load_y = load i64, ptr %y, align 8 %shift3 = ashr i64 %load_y, 32 %3 = trunc i64 %shift3 to i32 - store i32 %3, i32* %a, align 4 + store i32 %3, ptr %a, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap index 6cd27b62478..a9ea640d0ea 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__floating_point_type_casting.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,19 +16,19 @@ entry: %d = alloca double, align 8 %e = alloca double, align 8 %f = alloca double, align 8 - store float 3.000000e+00, float* %a, align 4 - store float 3.500000e+00, float* %b, align 4 - store float 3.500000e+00, float* %c, align 4 - store double 3.000000e+00, double* %d, align 8 - store double 3.500000e+00, double* %e, align 8 - store double 3.500000e+00, double* %f, align 8 - store i32 0, i32* %fn, align 4 - store float 3.000000e+00, float* %a, align 4 - store float 3.500000e+00, float* %b, align 4 - store float 3.500000e+00, float* %c, align 4 - store double 3.000000e+00, double* %d, align 8 - store double 3.500000e+00, double* %e, align 8 - store double 3.500000e+00, double* %f, align 8 - %fn_ret = load i32, i32* %fn, align 4 + store float 3.000000e+00, ptr %a, align 4 + store float 3.500000e+00, ptr %b, align 4 + store float 3.500000e+00, ptr %c, align 4 + store double 3.000000e+00, ptr %d, align 8 + store double 3.500000e+00, ptr %e, align 8 + store double 3.500000e+00, ptr %f, align 8 + store i32 0, ptr %fn, align 4 + store float 3.000000e+00, ptr %a, align 4 + store float 3.500000e+00, ptr %b, align 4 + store float 3.500000e+00, ptr %c, align 4 + store double 3.000000e+00, ptr %d, align 8 + store double 3.500000e+00, ptr %e, align 8 + store double 3.500000e+00, ptr %f, align 8 + %fn_ret = load i32, ptr %fn, align 4 ret i32 %fn_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap index b09d8adf8c3..d049b98fd2d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap @@ -1,49 +1,40 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -declare void @CONCAT(i8*, i8*, i8*) +declare void @CONCAT(ptr, ptr, ptr) -define i8 @LIST_ADD(i8* %0, i8* %1) { +define i8 @LIST_ADD(ptr %0, ptr %1) { entry: %LIST_ADD = alloca i8, align 1 %INS = alloca [1001 x i8], align 1 - %bitcast = bitcast [1001 x i8]* %INS to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1001, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1000, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %INS, i8 0, i64 1001, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %INS, ptr align 1 %0, i64 1000, i1 false) %sx = alloca [2 x i8], align 1 - %bitcast1 = bitcast [2 x i8]* %sx to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 2, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1, i1 false) - store i8 0, i8* %LIST_ADD, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %sx, i8 0, i64 2, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %sx, ptr align 1 %1, i64 1, i1 false) + store i8 0, ptr %LIST_ADD, align 1 %__CONCAT0 = alloca [1025 x i8], align 1 - %2 = bitcast [1025 x i8]* %__CONCAT0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([1025 x i8]* getelementptr ([1025 x i8], [1025 x i8]* null, i32 1) to i64), i1 false) - %3 = bitcast [1025 x i8]* %__CONCAT0 to i8* - %4 = bitcast [2 x i8]* %sx to i8* - %5 = bitcast [1001 x i8]* %INS to i8* - call void @CONCAT(i8* %3, i8* %4, i8* %5) - %6 = bitcast [1001 x i8]* %INS to i8* - %7 = bitcast [1025 x i8]* %__CONCAT0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %6, i8* align 1 %7, i32 1000, i1 false) - %LIST_ADD_ret = load i8, i8* %LIST_ADD, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %__CONCAT0, i8 0, i64 ptrtoint (ptr getelementptr ([1025 x i8], ptr null, i32 1) to i64), i1 false) + call void @CONCAT(ptr %__CONCAT0, ptr %sx, ptr %INS) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %INS, ptr align 1 %__CONCAT0, i32 1000, i1 false) + %LIST_ADD_ret = load i8, ptr %LIST_ADD, align 1 ret i8 %LIST_ADD_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap index b09d8adf8c3..d049b98fd2d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap @@ -1,49 +1,40 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -declare void @CONCAT(i8*, i8*, i8*) +declare void @CONCAT(ptr, ptr, ptr) -define i8 @LIST_ADD(i8* %0, i8* %1) { +define i8 @LIST_ADD(ptr %0, ptr %1) { entry: %LIST_ADD = alloca i8, align 1 %INS = alloca [1001 x i8], align 1 - %bitcast = bitcast [1001 x i8]* %INS to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1001, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1000, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %INS, i8 0, i64 1001, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %INS, ptr align 1 %0, i64 1000, i1 false) %sx = alloca [2 x i8], align 1 - %bitcast1 = bitcast [2 x i8]* %sx to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 2, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1, i1 false) - store i8 0, i8* %LIST_ADD, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %sx, i8 0, i64 2, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %sx, ptr align 1 %1, i64 1, i1 false) + store i8 0, ptr %LIST_ADD, align 1 %__CONCAT0 = alloca [1025 x i8], align 1 - %2 = bitcast [1025 x i8]* %__CONCAT0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([1025 x i8]* getelementptr ([1025 x i8], [1025 x i8]* null, i32 1) to i64), i1 false) - %3 = bitcast [1025 x i8]* %__CONCAT0 to i8* - %4 = bitcast [2 x i8]* %sx to i8* - %5 = bitcast [1001 x i8]* %INS to i8* - call void @CONCAT(i8* %3, i8* %4, i8* %5) - %6 = bitcast [1001 x i8]* %INS to i8* - %7 = bitcast [1025 x i8]* %__CONCAT0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %6, i8* align 1 %7, i32 1000, i1 false) - %LIST_ADD_ret = load i8, i8* %LIST_ADD, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %__CONCAT0, i8 0, i64 ptrtoint (ptr getelementptr ([1025 x i8], ptr null, i32 1) to i64), i1 false) + call void @CONCAT(ptr %__CONCAT0, ptr %sx, ptr %INS) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %INS, ptr align 1 %__CONCAT0, i32 1000, i1 false) + %LIST_ADD_ret = load i8, ptr %LIST_ADD, align 1 ret i8 %LIST_ADD_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap index 17cd18851d4..8626b705d2b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,11 +11,11 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i64, i64* %x, align 8 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i64, ptr %x, align 8 %shift = lshr i64 %load_x, 32 %1 = trunc i64 %shift to i32 %shift1 = lshr i32 %1, 16 @@ -25,6 +24,6 @@ entry: %3 = trunc i16 %shift2 to i8 %shift3 = lshr i8 %3, 1 %4 = and i8 %shift3, 1 - store i8 %4, i8* %a, align 1 + store i8 %4, ptr %a, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap index 67d8d31730f..d45c4af7cf2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,23 +11,23 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %load_x = load i16, i16* %x, align 2 - %load_y = load i16, i16* %y, align 2 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %load_x = load i16, ptr %x, align 2 + %load_y = load i16, ptr %y, align 2 %shift = ashr i16 %load_x, %load_y %1 = trunc i16 %shift to i8 %2 = and i8 %1, 1 - store i8 %2, i8* %a, align 1 - %load_x1 = load i16, i16* %x, align 2 - %load_y2 = load i16, i16* %y, align 2 + store i8 %2, ptr %a, align 1 + %load_x1 = load i16, ptr %x, align 2 + %load_y2 = load i16, ptr %y, align 2 %3 = mul i16 %load_y2, 8 %shift3 = ashr i16 %load_x1, %3 %4 = trunc i16 %shift3 to i8 - store i8 %4, i8* %b, align 1 + store i8 %4, ptr %b, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap index 6b101f4f96e..9422dc61ba5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/statement_codegen_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,22 +11,22 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_x = load i32, i32* %x, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_x = load i32, ptr %x, align 4 %shift = lshr i32 %load_x, 0 %1 = trunc i32 %shift to i16 - store i16 %1, i16* %a, align 2 - %load_x1 = load i32, i32* %x, align 4 + store i16 %1, ptr %a, align 2 + %load_x1 = load i32, ptr %x, align 4 %shift2 = lshr i32 %load_x1, 16 %2 = trunc i32 %shift2 to i16 - store i16 %2, i16* %a, align 2 - %load_y = load i32, i32* %y, align 4 + store i16 %2, ptr %a, align 2 + %load_y = load i32, ptr %y, align 4 %shift3 = ashr i32 %load_y, 16 %3 = trunc i32 %shift3 to i16 - store i16 %3, i16* %a, align 2 + store i16 %3, ptr %a, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap index 126b22f3f9b..3bd3d3e0767 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,22 +13,18 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" @utf16_literal_0 = private unnamed_addr constant [4 x i16] [i16 97, i16 98, i16 99, i16 0] -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %a to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_0, i32 0, i32 0), i32 80, i1 false) - %2 = bitcast [81 x i8]* %a to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_0, i32 0, i32 0), i32 80, i1 false) - %3 = bitcast [81 x i16]* %b to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %3, i8* align 2 bitcast ([4 x i16]* @utf16_literal_0 to i8*), i32 160, i1 false) - %4 = bitcast [81 x i16]* %b to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %4, i8* align 2 bitcast ([4 x i16]* @utf16_literal_0 to i8*), i32 160, i1 false) + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 80, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 80, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %b, ptr align 2 @utf16_literal_0, i32 160, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %b, ptr align 2 @utf16_literal_0, i32 160, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap index 6c195137032..f59ab48d42d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,42 +12,37 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" -define void @MID__STRING(i8* %0, i8* %1, i32 %2, i32 %3) { +define void @MID__STRING(ptr %0, ptr %1, i32 %2, i32 %3) { entry: - %MID__STRING = alloca i8*, align 8 - store i8* %0, i8** %MID__STRING, align 8 - %IN = alloca i8*, align 8 - store i8* %1, i8** %IN, align 8 + %MID__STRING = alloca ptr, align 8 + store ptr %0, ptr %MID__STRING, align 8 + %IN = alloca ptr, align 8 + store ptr %1, ptr %IN, align 8 %L = alloca i32, align 4 - store i32 %2, i32* %L, align 4 + store i32 %2, ptr %L, align 4 %P = alloca i32, align 4 - store i32 %3, i32* %P, align 4 - %deref = load i8*, i8** %MID__STRING, align 8 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_0, i32 0, i32 0), i32 4, i1 false) + store i32 %3, ptr %P, align 4 + %deref = load ptr, ptr %MID__STRING, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 4, i1 false) ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %fmt = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 1 + %fmt = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 %__MID0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__MID0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %__MID0 to i8* - %3 = bitcast [61 x i8]* %fmt to i8* - call void @MID__STRING(i8* %2, i8* %3, i32 1, i32 2) - %4 = bitcast [81 x i8]* %x to i8* - %5 = bitcast [81 x i8]* %__MID0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %4, i8* align 1 %5, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__MID0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @MID__STRING(ptr %__MID0, ptr %fmt, i32 1, i32 2) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %x, ptr align 1 %__MID0, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap index 90eb2240f3b..7ca1bfff202 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: program -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,34 +12,30 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @utf08_literal_0 = private unnamed_addr constant [4 x i8] c"abc\00" -define void @ret(i8* %0) { +define void @ret(ptr %0) { entry: - %ret = alloca i8*, align 8 - store i8* %0, i8** %ret, align 8 - %deref = load i8*, i8** %ret, align 8 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @utf08_literal_0, i32 0, i32 0), i32 4, i1 false) + %ret = alloca ptr, align 8 + store ptr %0, ptr %ret, align 8 + %deref = load ptr, ptr %ret, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 4, i1 false) ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %str = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %str = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %__ret0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__ret0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %__ret0 to i8* - call void @ret(i8* %2) - %3 = bitcast [81 x i8]* %str to i8* - %4 = bitcast [81 x i8]* %__ret0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %4, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__ret0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @ret(ptr %__ret0) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %str, ptr align 1 %__ret0, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap index bd58250aa9f..aaebdcc194d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: program -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,42 +12,36 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @utf08_literal_0 = private unnamed_addr constant [154 x i8] c"abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc\00" -define void @read_string(i8* %0, i8* %1) { +define void @read_string(ptr %0, ptr %1) { entry: - %read_string = alloca i8*, align 8 - store i8* %0, i8** %read_string, align 8 + %read_string = alloca ptr, align 8 + store ptr %0, ptr %read_string, align 8 %to_read = alloca [81 x i8], align 1 - %bitcast = bitcast [81 x i8]* %to_read to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 81, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %1, i64 80, i1 false) - %deref = load i8*, i8** %read_string, align 8 - %2 = bitcast [81 x i8]* %to_read to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 %2, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %to_read, i8 0, i64 81, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %to_read, ptr align 1 %1, i64 80, i1 false) + %deref = load ptr, ptr %read_string, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 %to_read, i32 80, i1 false) ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %text1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 + %text1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %__read_string0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__read_string0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %__read_string0 to i8* - call void @read_string(i8* %2, i8* getelementptr inbounds ([154 x i8], [154 x i8]* @utf08_literal_0, i32 0, i32 0)) - %3 = bitcast [81 x i8]* %text1 to i8* - %4 = bitcast [81 x i8]* %__read_string0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %4, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__read_string0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @read_string(ptr %__read_string0, ptr @utf08_literal_0) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %text1, ptr align 1 %__read_string0, i32 80, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap index 9a84df2baae..3ebc9f289a8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -18,23 +17,19 @@ entry: %FSTRING_TO_DT = alloca i64, align 8 %ignore = alloca [2 x i8], align 1 %fchar = alloca [2 x i8], align 1 - %0 = bitcast [2 x i8]* %ignore to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @__FSTRING_TO_DT.ignore__init, i32 0, i32 0), i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [2 x i8]* %fchar to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @__FSTRING_TO_DT.fchar__init, i32 0, i32 0), i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - store i64 0, i64* %FSTRING_TO_DT, align 8 - %2 = bitcast [2 x i8]* %fchar to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_0, i32 0, i32 0), i32 1, i1 false) - %3 = bitcast [2 x i8]* %ignore to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @utf08_literal_1, i32 0, i32 0), i32 1, i1 false) - %FSTRING_TO_DT_ret = load i64, i64* %FSTRING_TO_DT, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %ignore, ptr align 1 @__FSTRING_TO_DT.ignore__init, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fchar, ptr align 1 @__FSTRING_TO_DT.fchar__init, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + store i64 0, ptr %FSTRING_TO_DT, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %fchar, ptr align 1 @utf08_literal_0, i32 1, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %ignore, ptr align 1 @utf08_literal_1, i32 1, i1 false) + %FSTRING_TO_DT_ret = load i64, ptr %FSTRING_TO_DT, align 8 ret i64 %FSTRING_TO_DT_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap index eda1adb316a..21cf612e42d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,30 +15,26 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [7 x i8] c"string\00" @utf16_literal_0 = private unnamed_addr constant [8 x i16] [i16 119, i16 115, i16 116, i16 114, i16 105, i16 110, i16 103, i16 0] -define void @prog(%prog* %0) { +define void @prog(ptr %0) { entry: - %output1 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 0 - %output2 = getelementptr inbounds %prog, %prog* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %output1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([7 x i8], [7 x i8]* @utf08_literal_0, i32 0, i32 0), i32 7, i1 false) - %2 = bitcast [81 x i16]* %output2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %2, i8* align 2 bitcast ([8 x i16]* @utf16_literal_0 to i8*), i32 16, i1 false) + %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %output2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %output1, ptr align 1 @utf08_literal_0, i32 7, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %output2, ptr align 2 @utf16_literal_0, i32 16, i1 false) ret void } -define void @main(%main* %0) { +define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %y = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - call void @prog(%prog* @prog_instance) - %1 = bitcast [7 x i8]* %x to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 0, i32 0), i32 6, i1 false) - %2 = bitcast [8 x i16]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %2, i8* align 2 bitcast ([81 x i16]* getelementptr inbounds (%prog, %prog* @prog_instance, i32 0, i32 1) to i8*), i32 14, i1 false) + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + call void @prog(ptr @prog_instance) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %x, ptr align 1 @prog_instance, i32 6, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %y, ptr align 2 getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), i32 14, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap index ded08f4b7ae..5502ba12b7a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,18 +15,16 @@ target triple = "[filtered]" @utf16_literal_0 = private unnamed_addr constant [12 x i16] [i16 105, i16 109, i16 32, i16 97, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] @utf16_literal_1 = private unnamed_addr constant [18 x i16] [i16 105, i16 109, i16 32, i16 97, i16 32, i16 117, i16 116, i16 102, i16 49, i16 54, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([12 x i8], [12 x i8]* @utf08_literal_0, i32 0, i32 0), i32 80, i1 false) - %2 = bitcast [81 x i16]* %z to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %2, i8* align 2 bitcast ([18 x i16]* @utf16_literal_1 to i8*), i32 160, i1 false) + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 80, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %z, ptr align 2 @utf16_literal_1, i32 160, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap index 1e7ae940a06..cac4c5c2a9c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -17,21 +16,18 @@ target triple = "[filtered]" @utf08_literal_1 = private unnamed_addr constant [17 x i8] c"im also a genius\00" @utf16_literal_0 = private unnamed_addr constant [17 x i16] [i16 105, i16 109, i16 32, i16 97, i16 108, i16 115, i16 111, i16 32, i16 97, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %zz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %1 = bitcast [81 x i8]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([12 x i8], [12 x i8]* @utf08_literal_0, i32 0, i32 0), i32 12, i1 false) - %2 = bitcast [100 x i8]* %z to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([17 x i8], [17 x i8]* @utf08_literal_1, i32 0, i32 0), i32 17, i1 false) - %3 = bitcast [100 x i16]* %zz to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %3, i8* align 2 bitcast ([17 x i16]* @utf16_literal_0 to i8*), i32 34, i1 false) + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %zz = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %z, ptr align 1 @utf08_literal_1, i32 17, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %zz, ptr align 2 @utf16_literal_0, i32 34, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap index cb54b24a66e..6719647fbc9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -14,45 +13,40 @@ target triple = "[filtered]" @__prg.s__init = unnamed_addr constant [11 x i8] c"hello\00\00\00\00\00\00" @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" -define i16 @foo(i8* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %s = alloca [81 x i8], align 1 - %bitcast = bitcast [81 x i8]* %s to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 81, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 80, i1 false) - store i16 0, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 81, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %s, ptr align 1 %0, i64 80, i1 false) + store i16 0, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret buffer_block: ; No predecessors! - %foo_ret1 = load i16, i16* %foo, align 2 + %foo_ret1 = load i16, ptr %foo, align 2 ret i16 %foo_ret1 } -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %a to i8* - %2 = bitcast [11 x i8]* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 %2, i32 11, i1 false) - %3 = bitcast [81 x i8]* %a to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %4 = bitcast [11 x i8]* %s to i8* - %call = call i16 @foo(i8* %4) - %call1 = call i16 @foo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0)) + %s = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %s, i32 11, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 6, i1 false) + %call = call i16 @foo(ptr %s) + %call1 = call i16 @foo(ptr @utf08_literal_0) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap index 241e0170deb..4ce9685a2ee 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,15 +10,15 @@ target triple = "[filtered]" @__FSTRING_TO_DT.ignore__init = unnamed_addr constant [2 x i8] c"*\00" @__FSTRING_TO_DT.fchar__init = unnamed_addr constant [2 x i8] c"#\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) { +define i8 @STRING_EQUAL(ptr %0, ptr %1) { entry: %STRING_EQUAL = alloca i8, align 1 - %op1 = alloca i8*, align 8 - store i8* %0, i8** %op1, align 8 - %op2 = alloca i8*, align 8 - store i8* %1, i8** %op2, align 8 - store i8 0, i8* %STRING_EQUAL, align 1 - %STRING_EQUAL_ret = load i8, i8* %STRING_EQUAL, align 1 + %op1 = alloca ptr, align 8 + store ptr %0, ptr %op1, align 8 + %op2 = alloca ptr, align 8 + store ptr %1, ptr %op2, align 8 + store i8 0, ptr %STRING_EQUAL, align 1 + %STRING_EQUAL_ret = load i8, ptr %STRING_EQUAL, align 1 ret i8 %STRING_EQUAL_ret } @@ -29,32 +28,27 @@ entry: %ignore = alloca [2 x i8], align 1 %fchar = alloca [2 x i8], align 1 %c = alloca [2 x i8], align 1 - %0 = bitcast [2 x i8]* %ignore to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @__FSTRING_TO_DT.ignore__init, i32 0, i32 0), i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [2 x i8]* %fchar to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @__FSTRING_TO_DT.fchar__init, i32 0, i32 0), i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [2 x i8]* %c to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - store i64 0, i64* %FSTRING_TO_DT, align 8 - %3 = bitcast [2 x i8]* %c to i8* - %4 = bitcast [2 x i8]* %ignore to i8* - %call = call i8 @STRING_EQUAL(i8* %3, i8* %4) - %5 = icmp ne i8 %call, 0 - br i1 %5, label %condition_body, label %continue + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %ignore, ptr align 1 @__FSTRING_TO_DT.ignore__init, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fchar, ptr align 1 @__FSTRING_TO_DT.fchar__init, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %c, i8 0, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + store i64 0, ptr %FSTRING_TO_DT, align 8 + %call = call i8 @STRING_EQUAL(ptr %c, ptr %ignore) + %0 = icmp ne i8 %call, 0 + br i1 %0, label %condition_body, label %continue condition_body: ; preds = %entry br label %continue continue: ; preds = %condition_body, %entry - %FSTRING_TO_DT_ret = load i64, i64* %FSTRING_TO_DT, align 8 + %FSTRING_TO_DT_ret = load i64, ptr %FSTRING_TO_DT, align 8 ret i64 %FSTRING_TO_DT_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap index 99fa5afe981..ea64aee7b06 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,19 +10,17 @@ target triple = "[filtered]" @__FSTRING_TO_DT.ignore__init = unnamed_addr constant [2 x i8] c"*\00" @__FSTRING_TO_DT.fchar__init = unnamed_addr constant [2 x i8] c"#\00" -define i8 @STRING_EQUAL(i8* %0, i8* %1) { +define i8 @STRING_EQUAL(ptr %0, ptr %1) { entry: %STRING_EQUAL = alloca i8, align 1 %op1 = alloca [1025 x i8], align 1 - %bitcast = bitcast [1025 x i8]* %op1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 1024, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %op1, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op1, ptr align 1 %0, i64 1024, i1 false) %op2 = alloca [1025 x i8], align 1 - %bitcast1 = bitcast [1025 x i8]* %op2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast1, i8 0, i64 1025, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast1, i8* align 1 %1, i64 1024, i1 false) - store i8 0, i8* %STRING_EQUAL, align 1 - %STRING_EQUAL_ret = load i8, i8* %STRING_EQUAL, align 1 + call void @llvm.memset.p0.i64(ptr align 1 %op2, i8 0, i64 1025, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %op2, ptr align 1 %1, i64 1024, i1 false) + store i8 0, ptr %STRING_EQUAL, align 1 + %STRING_EQUAL_ret = load i8, ptr %STRING_EQUAL, align 1 ret i8 %STRING_EQUAL_ret } @@ -33,32 +30,27 @@ entry: %ignore = alloca [2 x i8], align 1 %fchar = alloca [2 x i8], align 1 %c = alloca [2 x i8], align 1 - %0 = bitcast [2 x i8]* %ignore to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @__FSTRING_TO_DT.ignore__init, i32 0, i32 0), i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - %1 = bitcast [2 x i8]* %fchar to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds ([2 x i8], [2 x i8]* @__FSTRING_TO_DT.fchar__init, i32 0, i32 0), i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [2 x i8]* %c to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %2, i8 0, i64 ptrtoint ([2 x i8]* getelementptr ([2 x i8], [2 x i8]* null, i32 1) to i64), i1 false) - store i64 0, i64* %FSTRING_TO_DT, align 8 - %3 = bitcast [2 x i8]* %c to i8* - %4 = bitcast [2 x i8]* %ignore to i8* - %call = call i8 @STRING_EQUAL(i8* %3, i8* %4) - %5 = icmp ne i8 %call, 0 - br i1 %5, label %condition_body, label %continue + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %ignore, ptr align 1 @__FSTRING_TO_DT.ignore__init, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fchar, ptr align 1 @__FSTRING_TO_DT.fchar__init, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %c, i8 0, i64 ptrtoint (ptr getelementptr ([2 x i8], ptr null, i32 1) to i64), i1 false) + store i64 0, ptr %FSTRING_TO_DT, align 8 + %call = call i8 @STRING_EQUAL(ptr %c, ptr %ignore) + %0 = icmp ne i8 %call, 0 + br i1 %0, label %condition_body, label %continue condition_body: ; preds = %entry br label %continue continue: ; preds = %condition_body, %entry - %FSTRING_TO_DT_ret = load i64, i64* %FSTRING_TO_DT, align 8 + %FSTRING_TO_DT_ret = load i64, ptr %FSTRING_TO_DT, align 8 ret i64 %FSTRING_TO_DT_ret } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap index 9bafab43fb5..9a0d0fd2749 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -16,20 +15,18 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" @utf16_literal_0 = private unnamed_addr constant [12 x i16] [i16 105, i16 109, i16 32, i16 97, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %wy = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %wz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %1 = bitcast [16 x i8]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([12 x i8], [12 x i8]* @utf08_literal_0, i32 0, i32 0), i32 12, i1 false) - %2 = bitcast [16 x i16]* %wy to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %2, i8* align 2 bitcast ([12 x i16]* @utf16_literal_0 to i8*), i32 24, i1 false) + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %wy = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %wz = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %wy, ptr align 2 @utf16_literal_0, i32 24, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap index ef7b653a81e..cc8d239a95a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -18,20 +17,18 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [12 x i8] c"im a genius\00" @utf16_literal_0 = private unnamed_addr constant [12 x i16] [i16 105, i16 109, i16 32, i16 97, i16 32, i16 103, i16 101, i16 110, i16 105, i16 117, i16 115, i16 0] -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %wy = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %wz = getelementptr inbounds %prg, %prg* %0, i32 0, i32 3 - %1 = bitcast [16 x i8]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([12 x i8], [12 x i8]* @utf08_literal_0, i32 0, i32 0), i32 12, i1 false) - %2 = bitcast [31 x i16]* %wy to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 2 %2, i8* align 2 bitcast ([12 x i16]* @utf16_literal_0 to i8*), i32 24, i1 false) + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %wy = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %wz = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %wy, ptr align 2 @utf16_literal_0, i32 24, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap index 2cff91b9fcb..acb997da913 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,20 +12,16 @@ target triple = "[filtered]" @prg_instance = global %prg { [16 x i8] zeroinitializer, [31 x i8] c"xyz\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" } @__prg.z__init = unnamed_addr constant [31 x i8] c"xyz\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [16 x i8]* %y to i8* - %2 = bitcast [31 x i8]* %z to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 %2, i32 15, i1 false) - %3 = bitcast [31 x i8]* %z to i8* - %4 = bitcast [16 x i8]* %y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %4, i32 16, i1 false) + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 %z, i32 15, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %z, ptr align 1 %y, i32 16, i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap index 43d6a4cebf1..e0567c84a81 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/string_tests.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,22 +12,20 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer @__prg.z__init = unnamed_addr constant [31 x i8] c"xyz\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: %y = alloca [16 x i8], align 1 %z = alloca [31 x i8], align 1 - %1 = bitcast [16 x i8]* %y to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([16 x i8]* getelementptr ([16 x i8], [16 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [31 x i8]* %z to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 getelementptr inbounds ([31 x i8], [31 x i8]* @__prg.z__init, i32 0, i32 0), i64 ptrtoint ([31 x i8]* getelementptr ([31 x i8], [31 x i8]* null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %y, i8 0, i64 ptrtoint (ptr getelementptr ([16 x i8], ptr null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %z, ptr align 1 @__prg.z__init, i64 ptrtoint (ptr getelementptr ([31 x i8], ptr null, i32 1) to i64), i1 false) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap index b50bdd1cfb8..d034d5443bf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,20 +11,20 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_b = load i8, i8* %b, align 1 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_b = load i8, ptr %b, align 1 %1 = sext i8 %load_b to i32 - %load_c = load i32, i32* %c, align 4 + %load_c = load i32, ptr %c, align 4 %tmpVar = add i32 %1, %load_c - store i32 %tmpVar, i32* %x, align 4 - %load_c1 = load i32, i32* %c, align 4 - %load_x = load i32, i32* %x, align 4 + store i32 %tmpVar, ptr %x, align 4 + %load_c1 = load i32, ptr %c, align 4 + %load_x = load i32, ptr %x, align 4 %tmpVar2 = add i32 %load_c1, %load_x %2 = trunc i32 %tmpVar2 to i8 - store i8 %2, i8* %b, align 1 + store i8 %2, ptr %b, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap index ece4ed7e3fa..495bbc72f97 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_b = load i32, i32* %b, align 4 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_b = load i32, ptr %b, align 4 %1 = sext i32 %load_b to i64 - %load_c = load i64, i64* %c, align 8 + %load_c = load i64, ptr %c, align 8 %tmpVar = add i64 %1, %load_c - store i64 %tmpVar, i64* %x, align 8 + store i64 %tmpVar, ptr %x, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap index c40964af676..58a1ef7d988 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_b = load i8, i8* %b, align 1 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_b = load i8, ptr %b, align 1 %1 = sext i8 %load_b to i32 - %load_c = load i32, i32* %c, align 4 + %load_c = load i32, ptr %c, align 4 %tmpVar = add i32 %1, %load_c - store i32 %tmpVar, i32* %x, align 4 + store i32 %tmpVar, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap index b32301e40ed..18e6e6f5400 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,17 +11,17 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_b = load i8, i8* %b, align 1 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_b = load i8, ptr %b, align 1 %1 = sext i8 %load_b to i32 - %load_c = load i8, i8* %c, align 1 + %load_c = load i8, ptr %c, align 1 %2 = sext i8 %load_c to i32 %tmpVar = add i32 %1, %2 %3 = trunc i32 %tmpVar to i8 - store i8 %3, i8* %x, align 1 + store i8 %3, ptr %x, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap index d50d134b5ef..004cc46dc0b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_b = load double, double* %b, align 8 - %load_a = load float, float* %a, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_b = load double, ptr %b, align 8 + %load_a = load float, ptr %a, align 4 %1 = fpext float %load_a to double %tmpVar = fadd double %load_b, %1 - store double %tmpVar, double* %c, align 8 + store double %tmpVar, ptr %c, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap index d7f26b22d9d..9f4e51276ca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_c = load float, float* %c, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_c = load float, ptr %c, align 4 %1 = fptosi float %load_c to i16 - store i16 %1, i16* %a, align 2 - %load_c1 = load float, float* %c, align 4 + store i16 %1, ptr %a, align 2 + %load_c1 = load float, ptr %c, align 4 %2 = fptoui float %load_c1 to i16 - store i16 %2, i16* %b, align 2 + store i16 %2, ptr %b, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap index fa2e3717cb5..21e8715c735 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_a = load float, float* %a, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_a = load float, ptr %a, align 4 %1 = fpext float %load_a to double - store double %1, double* %b, align 8 + store double %1, ptr %b, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap index ff62d286d59..415d4c89542 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,16 +11,16 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_a = load i16, i16* %a, align 2 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_a = load i16, ptr %a, align 2 %1 = sitofp i16 %load_a to float - store float %1, float* %c, align 4 - %load_b = load i16, i16* %b, align 2 + store float %1, ptr %c, align 4 + %load_b = load i16, ptr %b, align 2 %2 = uitofp i16 %load_b to float - store float %2, float* %c, align 4 + store float %2, ptr %c, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap index 1c6d4d41ca4..18754077d18 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,12 +11,12 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_b = load i64, i64* %b, align 8 - %load_a = load i8, i8* %a, align 1 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_b = load i64, ptr %b, align 8 + %load_a = load i8, ptr %a, align 1 %1 = zext i8 %load_a to i64 %tmpVar = icmp slt i64 %load_b, %1 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap index 1d4af0214eb..eca03c9c7a5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,13 +11,13 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_b = load i64, i64* %b, align 8 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_b = load i64, ptr %b, align 8 %1 = sitofp i64 %load_b to double - %load_a = load float, float* %a, align 4 + %load_a = load float, ptr %a, align 4 %2 = fpext float %load_a to double %tmpVar = fadd double %1, %2 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap index bc81fe80caf..40a88b016a7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_b = load i16, i16* %b, align 2 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_b = load i16, ptr %b, align 2 %1 = sitofp i16 %load_b to float - %load_a = load float, float* %a, align 4 + %load_a = load float, ptr %a, align 4 %tmpVar = fadd float %1, %load_a - store float %tmpVar, float* %c, align 4 + store float %tmpVar, ptr %c, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap index b3cbb90e9ac..e943f57ca9a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -13,30 +12,28 @@ target triple = "[filtered]" @main_instance = global %main zeroinitializer @__main.s__init = unnamed_addr constant [81 x i8] c"\0A numbers: %f %f %f %d \0A \0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" -declare i32 @printf(i8*, ...) +declare i32 @printf(ptr, ...) -define void @main(%main* %0) { +define void @main(ptr %0) { entry: %s = alloca [81 x i8], align 1 %float = alloca float, align 4 %double = alloca double, align 8 %integer = alloca i16, align 2 - %1 = bitcast [81 x i8]* %s to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 getelementptr inbounds ([81 x i8], [81 x i8]* @__main.s__init, i32 0, i32 0), i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - store float 3.000000e+00, float* %float, align 4 - store double 3.000000e+00, double* %double, align 8 - store i16 3, i16* %integer, align 2 - %2 = bitcast [81 x i8]* %s to i8* - %load_float = load float, float* %float, align 4 - %3 = fpext float %load_float to double - %load_double = load double, double* %double, align 8 - %load_integer = load i16, i16* %integer, align 2 - %4 = sext i16 %load_integer to i32 - %call = call i32 (i8*, ...) @printf(i8* %2, double 3.000000e+00, double %3, double %load_double, i32 %4) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %s, ptr align 1 @__main.s__init, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + store float 3.000000e+00, ptr %float, align 4 + store double 3.000000e+00, ptr %double, align 8 + store i16 3, ptr %integer, align 2 + %load_float = load float, ptr %float, align 4 + %1 = fpext float %load_float to double + %load_double = load double, ptr %double, align 8 + %load_integer = load i16, ptr %integer, align 2 + %2 = sext i16 %load_integer to i32 + %call = call i32 (ptr, ...) @printf(ptr %s, double 3.000000e+00, double %1, double %load_double, i32 %2) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap index 47ff568e0c3..fd06629f215 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__small_int_varargs_get_promoted_while_32bit_and_higher_keep_their_type.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -11,7 +10,7 @@ target triple = "[filtered]" @utf08_literal_0 = private unnamed_addr constant [26 x i8] c"(d) result : %d %d %d %u\0A\00" @utf08_literal_1 = private unnamed_addr constant [27 x i8] c"(hd) result : %hd %hd %hd\0A\00" -declare i32 @printf(i8*, ...) +declare i32 @printf(ptr, ...) define i32 @main() { entry: @@ -20,22 +19,22 @@ entry: %out2 = alloca i32, align 4 %out3 = alloca i64, align 8 %out4 = alloca i32, align 4 - store i16 -1, i16* %out1, align 2 - store i32 -1, i32* %out2, align 4 - store i64 -1, i64* %out3, align 8 - store i32 -1, i32* %out4, align 4 - store i32 0, i32* %main, align 4 - %load_out1 = load i16, i16* %out1, align 2 + store i16 -1, ptr %out1, align 2 + store i32 -1, ptr %out2, align 4 + store i64 -1, ptr %out3, align 8 + store i32 -1, ptr %out4, align 4 + store i32 0, ptr %main, align 4 + %load_out1 = load i16, ptr %out1, align 2 %0 = sext i16 %load_out1 to i32 - %load_out2 = load i32, i32* %out2, align 4 - %load_out3 = load i64, i64* %out3, align 8 - %load_out4 = load i32, i32* %out4, align 4 - %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @utf08_literal_0, i32 0, i32 0), i32 %0, i32 %load_out2, i64 %load_out3, i32 %load_out4) - %load_out11 = load i16, i16* %out1, align 2 + %load_out2 = load i32, ptr %out2, align 4 + %load_out3 = load i64, ptr %out3, align 8 + %load_out4 = load i32, ptr %out4, align 4 + %call = call i32 (ptr, ...) @printf(ptr @utf08_literal_0, i32 %0, i32 %load_out2, i64 %load_out3, i32 %load_out4) + %load_out11 = load i16, ptr %out1, align 2 %1 = sext i16 %load_out11 to i32 - %load_out22 = load i32, i32* %out2, align 4 - %load_out33 = load i64, i64* %out3, align 8 - %call4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @utf08_literal_1, i32 0, i32 0), i32 %1, i32 %load_out22, i64 %load_out33) - %main_ret = load i32, i32* %main, align 4 + %load_out22 = load i32, ptr %out2, align 4 + %load_out33 = load i64, ptr %out3, align 8 + %call4 = call i32 (ptr, ...) @printf(ptr @utf08_literal_1, i32 %1, i32 %load_out22, i64 %load_out33) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap index bf414d3e0f3..880984e90ab 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap @@ -1,7 +1,6 @@ --- source: src/codegen/tests/typesystem_test.rs expression: result -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,15 +11,15 @@ target triple = "[filtered]" @prg_instance = global %prg zeroinitializer -define void @prg(%prg* %0) { +define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - %load_b = load i8, i8* %b, align 1 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %load_b = load i8, ptr %b, align 1 %1 = zext i8 %load_b to i32 - %load_c = load i32, i32* %c, align 4 + %load_c = load i32, ptr %c, align 4 %tmpVar = add i32 %1, %load_c - store i32 %tmpVar, i32* %x, align 4 + store i32 %tmpVar, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap index ff5bf0837d4..c67bdfc0cc1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap @@ -1,62 +1,59 @@ --- source: src/codegen/tests/vla_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [4 x i32] } +%__foo_vla = type { ptr, [4 x i32] } @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define i16 @foo(%__foo_vla* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) - store i16 0, i16* %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 0 - %vla_arr_ptr = load i16*, i16** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 - %start_idx_ptr1 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 2 - %end_idx_ptr1 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 3 - %start_idx_value1 = load i32, i32* %start_idx_ptr1, align 4 - %end_idx_value1 = load i32, i32* %end_idx_ptr1, align 4 - %3 = sub i32 %end_idx_value0, %start_idx_value0 - %len_dim0 = add i32 1, %3 - %4 = sub i32 %end_idx_value1, %start_idx_value1 - %len_dim1 = add i32 1, %4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %foo, align 2 + %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 + %start_idx_ptr1 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 2 + %end_idx_ptr1 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 3 + %start_idx_value1 = load i32, ptr %start_idx_ptr1, align 4 + %end_idx_value1 = load i32, ptr %end_idx_ptr1, align 4 + %1 = sub i32 %end_idx_value0, %start_idx_value0 + %len_dim0 = add i32 1, %1 + %2 = sub i32 %end_idx_value1, %start_idx_value1 + %len_dim1 = add i32 1, %2 %accum = alloca i32, align 4 - store i32 1, i32* %accum, align 4 - %load_accum = load i32, i32* %accum, align 4 + store i32 1, ptr %accum, align 4 + %load_accum = load i32, ptr %accum, align 4 %product = mul i32 %load_accum, %len_dim1 - store i32 %product, i32* %accum, align 4 - %accessor_factor = load i32, i32* %accum, align 4 + store i32 %product, ptr %accum, align 4 + %accessor_factor = load i32, ptr %accum, align 4 %adj_access0 = sub i32 2, %start_idx_value0 %adj_access1 = sub i32 -1, %start_idx_value1 %accum1 = alloca i32, align 4 - store i32 0, i32* %accum1, align 4 + store i32 0, ptr %accum1, align 4 %multiply = mul i32 %adj_access0, %accessor_factor - %load_accum2 = load i32, i32* %accum1, align 4 + %load_accum2 = load i32, ptr %accum1, align 4 %accumulate = add i32 %load_accum2, %multiply - store i32 %accumulate, i32* %accum1, align 4 + store i32 %accumulate, ptr %accum1, align 4 %multiply3 = mul i32 %adj_access1, 1 - %load_accum4 = load i32, i32* %accum1, align 4 + %load_accum4 = load i32, ptr %accum1, align 4 %accumulate5 = add i32 %load_accum4, %multiply3 - store i32 %accumulate5, i32* %accum1, align 4 - %accessor = load i32, i32* %accum1, align 4 - %arr_val = getelementptr inbounds i16, i16* %vla_arr_ptr, i32 %accessor - store i16 1, i16* %arr_val, align 2 - %foo_ret = load i16, i16* %foo, align 2 + store i32 %accumulate5, ptr %accum1, align 4 + %accessor = load i32, ptr %accum1, align 4 + %arr_val = getelementptr inbounds i16, ptr %vla_arr_ptr, i32 %accessor + store i16 1, ptr %arr_val, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } @@ -65,42 +62,40 @@ entry: %main = alloca i32, align 4 %arr = alloca [60 x i16], align 2 %arr2 = alloca [299 x i16], align 2 - %0 = bitcast [60 x i16]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([60 x i16]* getelementptr ([60 x i16], [60 x i16]* null, i32 1) to i64), i1 false) - %1 = bitcast [299 x i16]* %arr2 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([299 x i16]* getelementptr ([299 x i16], [299 x i16]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %auto_deref = load [60 x i16], [60 x i16]* %arr, align 2 - %outer_arr_gep = getelementptr inbounds [60 x i16], [60 x i16]* %arr, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([60 x i16], ptr null, i32 1) to i64), i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %arr2, i8 0, i64 ptrtoint (ptr getelementptr ([299 x i16], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %auto_deref = load [60 x i16], ptr %arr, align 2 + %outer_arr_gep = getelementptr inbounds [60 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [4 x i32] [i32 0, i32 14, i32 -2, i32 1], [4 x i32]* %vla_dimensions_gep, align 4 - store i16* %outer_arr_gep, i16** %vla_array_gep, align 8 - %2 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [4 x i32] [i32 0, i32 14, i32 -2, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %2, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i16 @foo(%__foo_vla* %vla_struct_ptr) - %auto_deref1 = load [299 x i16], [299 x i16]* %arr2, align 2 - %outer_arr_gep2 = getelementptr inbounds [299 x i16], [299 x i16]* %arr2, i32 0, i32 0 + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + %call = call i16 @foo(ptr %vla_struct_ptr) + %auto_deref1 = load [299 x i16], ptr %arr2, align 2 + %outer_arr_gep2 = getelementptr inbounds [299 x i16], ptr %arr2, i32 0, i32 0 %vla_struct3 = alloca %__foo_vla, align 8 - %vla_array_gep4 = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct3, i32 0, i32 0 - %vla_dimensions_gep5 = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct3, i32 0, i32 1 - store [4 x i32] [i32 -8, i32 4, i32 -3, i32 19], [4 x i32]* %vla_dimensions_gep5, align 4 - store i16* %outer_arr_gep2, i16** %vla_array_gep4, align 8 - %3 = load %__foo_vla, %__foo_vla* %vla_struct3, align 8 + %vla_array_gep4 = getelementptr inbounds %__foo_vla, ptr %vla_struct3, i32 0, i32 0 + %vla_dimensions_gep5 = getelementptr inbounds %__foo_vla, ptr %vla_struct3, i32 0, i32 1 + store [4 x i32] [i32 -8, i32 4, i32 -3, i32 19], ptr %vla_dimensions_gep5, align 4 + store ptr %outer_arr_gep2, ptr %vla_array_gep4, align 8 + %1 = load %__foo_vla, ptr %vla_struct3, align 8 %vla_struct_ptr6 = alloca %__foo_vla, align 8 - store %__foo_vla %3, %__foo_vla* %vla_struct_ptr6, align 8 - %call7 = call i16 @foo(%__foo_vla* %vla_struct_ptr6) - %main_ret = load i32, i32* %main, align 4 + store %__foo_vla %1, ptr %vla_struct_ptr6, align 8 + %call7 = call i16 @foo(ptr %vla_struct_ptr6) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap index 81ac40dec53..10ddb5af928 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap @@ -1,59 +1,56 @@ --- source: src/codegen/tests/vla_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [2 x i32] } +%__foo_vla = type { ptr, [2 x i32] } @arr = global [2 x i16] zeroinitializer @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define i16 @foo(%__foo_vla* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) - store i16 0, i16* %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 0 - %vla_arr_ptr = load i16*, i16** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %foo, align 2 + %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 %tmpVar = sub i32 0, %start_idx_value0 - %arr_val = getelementptr inbounds i16, i16* %vla_arr_ptr, i32 %tmpVar - store i16 10, i16* %arr_val, align 2 - %foo_ret = load i16, i16* %foo, align 2 + %arr_val = getelementptr inbounds i16, ptr %vla_arr_ptr, i32 %tmpVar + store i16 10, ptr %arr_val, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } define i32 @main() { entry: %main = alloca i32, align 4 - store i32 0, i32* %main, align 4 - %auto_deref = load [2 x i16], [2 x i16]* @arr, align 2 + store i32 0, ptr %main, align 4 + %auto_deref = load [2 x i16], ptr @arr, align 2 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i16* getelementptr inbounds ([2 x i16], [2 x i16]* @arr, i32 0, i32 0), i16** %vla_array_gep, align 8 - %0 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr @arr, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %0, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i16 @foo(%__foo_vla* %vla_struct_ptr) - %main_ret = load i32, i32* %main, align 4 + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + %call = call i16 @foo(ptr %vla_struct_ptr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap index ece7ff55d86..0a004ac677d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap @@ -1,50 +1,46 @@ --- source: src/codegen/tests/vla_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [2 x i32] } +%__foo_vla = type { ptr, [2 x i32] } @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define void @foo(%__foo_vla* %0) { +define void @foo(ptr %0) { entry: %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) ret void } define void @bar() { entry: %arr = alloca [2 x i16], align 2 - %0 = bitcast [2 x i16]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x i16]* getelementptr ([2 x i16], [2 x i16]* null, i32 1) to i64), i1 false) - %auto_deref = load [2 x i16], [2 x i16]* %arr, align 2 - %outer_arr_gep = getelementptr inbounds [2 x i16], [2 x i16]* %arr, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([2 x i16], ptr null, i32 1) to i64), i1 false) + %auto_deref = load [2 x i16], ptr %arr, align 2 + %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i16* %outer_arr_gep, i16** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - call void @foo(%__foo_vla* %vla_struct_ptr) + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + call void @foo(ptr %vla_struct_ptr) ret void } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap index b860d9f9f45..69880c99b1d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap @@ -1,62 +1,59 @@ --- source: src/codegen/tests/vla_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [4 x i32] } +%__foo_vla = type { ptr, [4 x i32] } @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define i16 @foo(%__foo_vla* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) - store i16 0, i16* %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 0 - %vla_arr_ptr = load i16*, i16** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 - %start_idx_ptr1 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 2 - %end_idx_ptr1 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 3 - %start_idx_value1 = load i32, i32* %start_idx_ptr1, align 4 - %end_idx_value1 = load i32, i32* %end_idx_ptr1, align 4 - %3 = sub i32 %end_idx_value0, %start_idx_value0 - %len_dim0 = add i32 1, %3 - %4 = sub i32 %end_idx_value1, %start_idx_value1 - %len_dim1 = add i32 1, %4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %foo, align 2 + %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 + %start_idx_ptr1 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 2 + %end_idx_ptr1 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 3 + %start_idx_value1 = load i32, ptr %start_idx_ptr1, align 4 + %end_idx_value1 = load i32, ptr %end_idx_ptr1, align 4 + %1 = sub i32 %end_idx_value0, %start_idx_value0 + %len_dim0 = add i32 1, %1 + %2 = sub i32 %end_idx_value1, %start_idx_value1 + %len_dim1 = add i32 1, %2 %accum = alloca i32, align 4 - store i32 1, i32* %accum, align 4 - %load_accum = load i32, i32* %accum, align 4 + store i32 1, ptr %accum, align 4 + %load_accum = load i32, ptr %accum, align 4 %product = mul i32 %load_accum, %len_dim1 - store i32 %product, i32* %accum, align 4 - %accessor_factor = load i32, i32* %accum, align 4 + store i32 %product, ptr %accum, align 4 + %accessor_factor = load i32, ptr %accum, align 4 %adj_access0 = sub i32 2, %start_idx_value0 %adj_access1 = sub i32 -1, %start_idx_value1 %accum1 = alloca i32, align 4 - store i32 0, i32* %accum1, align 4 + store i32 0, ptr %accum1, align 4 %multiply = mul i32 %adj_access0, %accessor_factor - %load_accum2 = load i32, i32* %accum1, align 4 + %load_accum2 = load i32, ptr %accum1, align 4 %accumulate = add i32 %load_accum2, %multiply - store i32 %accumulate, i32* %accum1, align 4 + store i32 %accumulate, ptr %accum1, align 4 %multiply3 = mul i32 %adj_access1, 1 - %load_accum4 = load i32, i32* %accum1, align 4 + %load_accum4 = load i32, ptr %accum1, align 4 %accumulate5 = add i32 %load_accum4, %multiply3 - store i32 %accumulate5, i32* %accum1, align 4 - %accessor = load i32, i32* %accum1, align 4 - %arr_val = getelementptr inbounds i16, i16* %vla_arr_ptr, i32 %accessor - store i16 1, i16* %arr_val, align 2 - %foo_ret = load i16, i16* %foo, align 2 + store i32 %accumulate5, ptr %accum1, align 4 + %accessor = load i32, ptr %accum1, align 4 + %arr_val = getelementptr inbounds i16, ptr %vla_arr_ptr, i32 %accessor + store i16 1, ptr %arr_val, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } @@ -64,29 +61,28 @@ define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [20 x i16], align 2 - %0 = bitcast [20 x i16]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([20 x i16]* getelementptr ([20 x i16], [20 x i16]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %auto_deref = load [20 x i16], [20 x i16]* %arr, align 2 - %outer_arr_gep = getelementptr inbounds [20 x i16], [20 x i16]* %arr, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([20 x i16], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %auto_deref = load [20 x i16], ptr %arr, align 2 + %outer_arr_gep = getelementptr inbounds [20 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [4 x i32] [i32 0, i32 4, i32 -2, i32 1], [4 x i32]* %vla_dimensions_gep, align 4 - store i16* %outer_arr_gep, i16** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [4 x i32] [i32 0, i32 4, i32 -2, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i16 @foo(%__foo_vla* %vla_struct_ptr) - %main_ret = load i32, i32* %main, align 4 + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + %call = call i16 @foo(ptr %vla_struct_ptr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap index 388340079df..525e98bc0e5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap @@ -1,37 +1,34 @@ --- source: src/codegen/tests/vla_tests.rs expression: res -snapshot_kind: text --- ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [2 x i32] } +%__foo_vla = type { ptr, [2 x i32] } @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define i16 @foo(%__foo_vla* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) - store i16 0, i16* %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 0 - %vla_arr_ptr = load i16*, i16** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %foo, align 2 + %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 %tmpVar = sub i32 0, %start_idx_value0 - %arr_val = getelementptr inbounds i16, i16* %vla_arr_ptr, i32 %tmpVar - %load_tmpVar = load i16, i16* %arr_val, align 2 - store i16 %load_tmpVar, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + %arr_val = getelementptr inbounds i16, ptr %vla_arr_ptr, i32 %tmpVar + %load_tmpVar = load i16, ptr %arr_val, align 2 + store i16 %load_tmpVar, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } @@ -39,29 +36,28 @@ define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [2 x i16], align 2 - %0 = bitcast [2 x i16]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x i16]* getelementptr ([2 x i16], [2 x i16]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %auto_deref = load [2 x i16], [2 x i16]* %arr, align 2 - %outer_arr_gep = getelementptr inbounds [2 x i16], [2 x i16]* %arr, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([2 x i16], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %auto_deref = load [2 x i16], ptr %arr, align 2 + %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i16* %outer_arr_gep, i16** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i16 @foo(%__foo_vla* %vla_struct_ptr) - %main_ret = load i32, i32* %main, align 4 + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + %call = call i16 @foo(ptr %vla_struct_ptr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap index d9a4105669c..c47aecd0e37 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap @@ -7,34 +7,32 @@ source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [2 x i32] } +%__foo_vla = type { ptr, [2 x i32] } @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define i16 @foo(%__foo_vla* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) %i = alloca i32, align 4 - store i32 0, i32* %i, align 4 - store i16 0, i16* %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 0 - %vla_arr_ptr = load i16*, i16** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 - %load_i = load i32, i32* %i, align 4 + store i32 0, ptr %i, align 4 + store i16 0, ptr %foo, align 2 + %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 + %load_i = load i32, ptr %i, align 4 %tmpVar = add i32 %load_i, 1 %tmpVar1 = sub i32 %tmpVar, %start_idx_value0 - %arr_val = getelementptr inbounds i16, i16* %vla_arr_ptr, i32 %tmpVar1 - %load_tmpVar = load i16, i16* %arr_val, align 2 - store i16 %load_tmpVar, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + %arr_val = getelementptr inbounds i16, ptr %vla_arr_ptr, i32 %tmpVar1 + %load_tmpVar = load i16, ptr %arr_val, align 2 + store i16 %load_tmpVar, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } @@ -42,29 +40,28 @@ define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [2 x i16], align 2 - %0 = bitcast [2 x i16]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x i16]* getelementptr ([2 x i16], [2 x i16]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %auto_deref = load [2 x i16], [2 x i16]* %arr, align 2 - %outer_arr_gep = getelementptr inbounds [2 x i16], [2 x i16]* %arr, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([2 x i16], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %auto_deref = load [2 x i16], ptr %arr, align 2 + %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i16* %outer_arr_gep, i16** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i16 @foo(%__foo_vla* %vla_struct_ptr) - %main_ret = load i32, i32* %main, align 4 + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + %call = call i16 @foo(ptr %vla_struct_ptr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap index 44189ea120c..525e98bc0e5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap @@ -7,30 +7,28 @@ source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [2 x i32] } +%__foo_vla = type { ptr, [2 x i32] } @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define i16 @foo(%__foo_vla* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) - store i16 0, i16* %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 0 - %vla_arr_ptr = load i16*, i16** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) + store i16 0, ptr %foo, align 2 + %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 %tmpVar = sub i32 0, %start_idx_value0 - %arr_val = getelementptr inbounds i16, i16* %vla_arr_ptr, i32 %tmpVar - %load_tmpVar = load i16, i16* %arr_val, align 2 - store i16 %load_tmpVar, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + %arr_val = getelementptr inbounds i16, ptr %vla_arr_ptr, i32 %tmpVar + %load_tmpVar = load i16, ptr %arr_val, align 2 + store i16 %load_tmpVar, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } @@ -38,29 +36,28 @@ define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [2 x i16], align 2 - %0 = bitcast [2 x i16]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x i16]* getelementptr ([2 x i16], [2 x i16]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %auto_deref = load [2 x i16], [2 x i16]* %arr, align 2 - %outer_arr_gep = getelementptr inbounds [2 x i16], [2 x i16]* %arr, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([2 x i16], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %auto_deref = load [2 x i16], ptr %arr, align 2 + %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i16* %outer_arr_gep, i16** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i16 @foo(%__foo_vla* %vla_struct_ptr) - %main_ret = load i32, i32* %main, align 4 + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + %call = call i16 @foo(ptr %vla_struct_ptr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap index 84acd5dafa4..4489e428cf0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap @@ -7,33 +7,31 @@ source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" -%__foo_vla = type { i16*, [2 x i32] } +%__foo_vla = type { ptr, [2 x i32] } @____foo_vla__init = unnamed_addr constant %__foo_vla zeroinitializer -define i16 @foo(%__foo_vla* %0) { +define i16 @foo(ptr %0) { entry: %foo = alloca i16, align 2 %vla = alloca %__foo_vla, align 8 - %1 = bitcast %__foo_vla* %vla to i8* - %2 = bitcast %__foo_vla* %0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%__foo_vla* getelementptr (%__foo_vla, %__foo_vla* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) %i = alloca i32, align 4 - store i32 0, i32* %i, align 4 - store i16 0, i16* %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 0 - %vla_arr_ptr = load i16*, i16** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, %__foo_vla* %vla, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 - %load_i = load i32, i32* %i, align 4 + store i32 0, ptr %i, align 4 + store i16 0, ptr %foo, align 2 + %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 + %load_i = load i32, ptr %i, align 4 %tmpVar = sub i32 %load_i, %start_idx_value0 - %arr_val = getelementptr inbounds i16, i16* %vla_arr_ptr, i32 %tmpVar - %load_tmpVar = load i16, i16* %arr_val, align 2 - store i16 %load_tmpVar, i16* %foo, align 2 - %foo_ret = load i16, i16* %foo, align 2 + %arr_val = getelementptr inbounds i16, ptr %vla_arr_ptr, i32 %tmpVar + %load_tmpVar = load i16, ptr %arr_val, align 2 + store i16 %load_tmpVar, ptr %foo, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } @@ -41,29 +39,28 @@ define i32 @main() { entry: %main = alloca i32, align 4 %arr = alloca [2 x i16], align 2 - %0 = bitcast [2 x i16]* %arr to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([2 x i16]* getelementptr ([2 x i16], [2 x i16]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %auto_deref = load [2 x i16], [2 x i16]* %arr, align 2 - %outer_arr_gep = getelementptr inbounds [2 x i16], [2 x i16]* %arr, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([2 x i16], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %auto_deref = load [2 x i16], ptr %arr, align 2 + %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, %__foo_vla* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 1], [2 x i32]* %vla_dimensions_gep, align 4 - store i16* %outer_arr_gep, i16** %vla_array_gep, align 8 - %1 = load %__foo_vla, %__foo_vla* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_vla, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_vla, align 8 - store %__foo_vla %1, %__foo_vla* %vla_struct_ptr, align 8 - %call = call i16 @foo(%__foo_vla* %vla_struct_ptr) - %main_ret = load i32, i32* %main, align 4 + store %__foo_vla %0, ptr %vla_struct_ptr, align 8 + %call = call i16 @foo(ptr %vla_struct_ptr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nofree nounwind willreturn writeonly -declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nofree nounwind willreturn } -attributes #1 = { argmemonly nofree nounwind willreturn writeonly } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } diff --git a/src/codegen/tests/statement_codegen_test.rs b/src/codegen/tests/statement_codegen_test.rs index 15be6329f6a..9ae7600a54e 100644 --- a/src/codegen/tests/statement_codegen_test.rs +++ b/src/codegen/tests/statement_codegen_test.rs @@ -209,11 +209,11 @@ fn ref_assignment() { define void @main() { entry: - %a = alloca i32*, align 8 + %a = alloca ptr, align 8 %b = alloca i32, align 4 - store i32* null, i32** %a, align 8 - store i32 0, i32* %b, align 4 - store i32* %b, i32** %a, align 8 + store ptr null, ptr %a, align 8 + store i32 0, ptr %b, align 4 + store ptr %b, ptr %a, align 8 ret void } "#); @@ -240,9 +240,9 @@ fn ref_assignment_to_null() { define void @main() { entry: - %a = alloca i32*, align 8 - store i32* null, i32** %a, align 8 - store i32 0, i32** %a, align 4 + %a = alloca ptr, align 8 + store ptr null, ptr %a, align 8 + store i32 0, ptr %a, align 4 ret void } "#); @@ -283,10 +283,10 @@ fn reference_to_assignment() { define void @main() { entry: - %a = alloca i32*, align 8 - store i32* null, i32** %a, align 8 - %deref = load i32*, i32** %a, align 8 - store i32 5, i32* %deref, align 4 + %a = alloca ptr, align 8 + store ptr null, ptr %a, align 8 + %deref = load ptr, ptr %a, align 8 + store i32 5, ptr %deref, align 4 ret void } "#); @@ -330,18 +330,17 @@ fn reference_to_string_assignment() { define void @main() { entry: - %a = alloca [81 x i8]*, align 8 - store [81 x i8]* null, [81 x i8]** %a, align 8 - %deref = load [81 x i8]*, [81 x i8]** %a, align 8 - %0 = bitcast [81 x i8]* %deref to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %0, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) + %a = alloca ptr, align 8 + store ptr null, ptr %a, align 8 + %deref = load ptr, ptr %a, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 6, i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -366,10 +365,10 @@ fn local_alias() { define void @main() { entry: - %foo = alloca i32*, align 8 + %foo = alloca ptr, align 8 %bar = alloca i32, align 4 - store i32* null, i32** %foo, align 8 - store i32 0, i32* %bar, align 4 + store ptr null, ptr %foo, align 8 + store i32 0, ptr %bar, align 4 ret void } "#); @@ -396,18 +395,17 @@ fn local_string_alias() { define void @main() { entry: - %foo = alloca [81 x i8]*, align 8 + %foo = alloca ptr, align 8 %bar = alloca [81 x i8], align 1 - store [81 x i8]* null, [81 x i8]** %foo, align 8 - %0 = bitcast [81 x i8]* %bar to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) + store ptr null, ptr %foo, align 8 + call void @llvm.memset.p0.i64(ptr align 1 %bar, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#); } diff --git a/src/codegen/tests/typesystem_test.rs b/src/codegen/tests/typesystem_test.rs index 1b532edcd6f..aea55167173 100644 --- a/src/codegen/tests/typesystem_test.rs +++ b/src/codegen/tests/typesystem_test.rs @@ -348,22 +348,22 @@ fn enum_typed_varargs_get_promoted() { @MyEnum.b = unnamed_addr constant i16 20 @utf08_literal_0 = private unnamed_addr constant [16 x i8] c"result : %d %d\0A\00" - declare i32 @printf(i8*, ...) + declare i32 @printf(ptr, ...) define i32 @main() { entry: %main = alloca i32, align 4 %e1 = alloca i16, align 2 %i1 = alloca i16, align 2 - store i16 10, i16* %e1, align 2 - store i16 10, i16* %i1, align 2 - store i32 0, i32* %main, align 4 - %load_e1 = load i16, i16* %e1, align 2 + store i16 10, ptr %e1, align 2 + store i16 10, ptr %i1, align 2 + store i32 0, ptr %main, align 4 + %load_e1 = load i16, ptr %e1, align 2 %0 = sext i16 %load_e1 to i32 - %load_i1 = load i16, i16* %i1, align 2 + %load_i1 = load i16, ptr %i1, align 2 %1 = sext i16 %load_i1 to i32 - %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @utf08_literal_0, i32 0, i32 0), i32 %0, i32 %1) - %main_ret = load i32, i32* %main, align 4 + %call = call i32 (ptr, ...) @printf(ptr @utf08_literal_0, i32 %0, i32 %1) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } "#); @@ -398,23 +398,23 @@ fn self_referential_struct_via_reference_codegen() { target triple = "[filtered]" %main = type { %Node, %Node } - %Node = type { i32, %Node* } + %Node = type { i32, ptr } @main_instance = global %main zeroinitializer @__Node__init = unnamed_addr constant %Node zeroinitializer - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %node1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %node2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %data = getelementptr inbounds %Node, %Node* %node1, i32 0, i32 0 - store i32 42, i32* %data, align 4 - %data1 = getelementptr inbounds %Node, %Node* %node2, i32 0, i32 0 - store i32 84, i32* %data1, align 4 - %next = getelementptr inbounds %Node, %Node* %node1, i32 0, i32 1 - store %Node* %node2, %Node** %next, align 8 - %next2 = getelementptr inbounds %Node, %Node* %node2, i32 0, i32 1 - store %Node* %node1, %Node** %next2, align 8 + %node1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %node2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %data = getelementptr inbounds %Node, ptr %node1, i32 0, i32 0 + store i32 42, ptr %data, align 4 + %data1 = getelementptr inbounds %Node, ptr %node2, i32 0, i32 0 + store i32 84, ptr %data1, align 4 + %next = getelementptr inbounds %Node, ptr %node1, i32 0, i32 1 + store ptr %node2, ptr %next, align 8 + %next2 = getelementptr inbounds %Node, ptr %node2, i32 0, i32 1 + store ptr %node1, ptr %next2, align 8 ret void } "#); diff --git a/src/linker.rs b/src/linker.rs index 0d4bd065310..13529779494 100644 --- a/src/linker.rs +++ b/src/linker.rs @@ -52,7 +52,7 @@ impl Linker { (_, "darwin") => Box::new(CcLinker::new("clang")), - _ => Box::new(LdLinker::new()), + _ => Box::new(CcLinker::new("ld.lld")), } } LinkerType::External(linker) => Box::new(CcLinker::new(&linker)), @@ -164,30 +164,31 @@ impl LinkerInterface for CcLinker { } } -struct LdLinker { - args: Vec, -} - -impl LdLinker { - fn new() -> LdLinker { - LdLinker { args: Vec::default() } - } -} - -impl LinkerInterface for LdLinker { - fn add_arg(&mut self, value: String) { - self.args.push(value) - } - - fn get_build_command(&self) -> Result { - Ok(format!("ld.lld {}", self.args.join(" "))) - } - - fn finalize(&mut self) -> Result<(), LinkerError> { - log::debug!("Linker arguments : {}", self.get_build_command()?); - lld_rs::link(lld_rs::LldFlavor::Elf, &self.args).ok().map_err(LinkerError::Link) - } -} +// // TODO: Might not be needed anymore +// struct LdLinker { +// args: Vec, +// } + +// impl LdLinker { +// fn new() -> LdLinker { +// LdLinker { args: Vec::default() } +// } +// } + +// impl LinkerInterface for LdLinker { +// fn add_arg(&mut self, value: String) { +// self.args.push(value) +// } + +// fn get_build_command(&self) -> Result { +// Ok(format!("ld.lld {}", self.args.join(" "))) +// } + +// fn finalize(&mut self) -> Result<(), LinkerError> { +// log::debug!("Linker arguments : {}", self.get_build_command()?); +// lld_rs::link(lld_rs::LldFlavor::Elf, &self.args).ok().map_err(LinkerError::Link) +// } +// } #[derive(Clone, Debug)] pub struct MockLinker { diff --git a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap index 8ee98ea91a9..dece08c2b8f 100644 --- a/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap +++ b/src/resolver/tests/snapshots/rusty__resolver__tests__const_resolver_tests__const_variables_default_value_compile_time_evaluation.snap @@ -1,7 +1,6 @@ --- source: src/resolver/tests/const_resolver_tests.rs expression: ir -snapshot_kind: text --- ; ModuleID = '' source_filename = "" @@ -12,7 +11,7 @@ target triple = "[filtered]" @zero_int = unnamed_addr constant i16 0 @zero_real = unnamed_addr constant double 0.000000e+00 @empty_string = unnamed_addr constant [81 x i8] zeroinitializer -@null_ptr = unnamed_addr constant i16* null +@null_ptr = unnamed_addr constant ptr null @zero_enum = unnamed_addr constant i32 0 @myEnum.a = unnamed_addr constant i32 0 @myEnum.b = unnamed_addr constant i32 1 diff --git a/src/test_utils.rs b/src/test_utils.rs index 58daa2a7b09..46b591395bb 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -213,15 +213,6 @@ pub mod tests { codegen_debug_without_unwrap(src, DebugLevel::None) } - pub fn codegen_with_online_change(src: &str) -> String { - codegen_debug_without_unwrap_oc( - src, - DebugLevel::None, - OnlineChange::Enabled { file_name: "test".into(), format: crate::ConfigFormat::JSON }, - ) - .unwrap() - } - pub fn codegen_debug_without_unwrap(src: &str, debug_level: DebugLevel) -> Result { codegen_debug_without_unwrap_oc(src, debug_level, OnlineChange::Disabled) } diff --git a/src/tests/adr/arrays_adr.rs b/src/tests/adr/arrays_adr.rs index ee3e5a1fbcc..f60e653238d 100644 --- a/src/tests/adr/arrays_adr.rs +++ b/src/tests/adr/arrays_adr.rs @@ -79,20 +79,18 @@ fn assigning_full_arrays() { @prg_instance = global %prg { [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9], [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] } @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [10 x i32]* %a to i8* - %2 = bitcast [10 x i32]* %b to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint ([10 x i32]* getelementptr ([10 x i32], [10 x i32]* null, i32 1) to i64), i1 false) + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a, ptr align 1 %b, i64 ptrtoint (ptr getelementptr ([10 x i32], ptr null, i32 1) to i64), i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -134,14 +132,14 @@ fn accessing_array_elements() { @__Data__init = unnamed_addr constant [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9] @__prg.b__init = unnamed_addr constant [3 x i32] [i32 3, i32 4, i32 5] - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %tmpVar = getelementptr inbounds [10 x i32], [10 x i32]* %a, i32 0, i32 2 - %tmpVar1 = getelementptr inbounds [3 x i32], [3 x i32]* %b, i32 0, i32 1 - %load_tmpVar = load i32, i32* %tmpVar1, align 4 - store i32 %load_tmpVar, i32* %tmpVar, align 4 + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %tmpVar = getelementptr inbounds [10 x i32], ptr %a, i32 0, i32 2 + %tmpVar1 = getelementptr inbounds [3 x i32], ptr %b, i32 0, i32 1 + %load_tmpVar = load i32, ptr %tmpVar1, align 4 + store i32 %load_tmpVar, ptr %tmpVar, align 4 ret void } "#); diff --git a/src/tests/adr/enum_adr.rs b/src/tests/adr/enum_adr.rs index 282f1ebca07..6651215bff9 100644 --- a/src/tests/adr/enum_adr.rs +++ b/src/tests/adr/enum_adr.rs @@ -137,14 +137,14 @@ fn using_enums() { @Door.open = unnamed_addr constant i32 8 @Door.closed = unnamed_addr constant i32 16 - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 2 - store i32 5, i32* %x, align 4 - store i32 4, i32* %y, align 4 - store i32 16, i32* %z, align 4 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + store i32 5, ptr %x, align 4 + store i32 4, ptr %y, align 4 + store i32 16, ptr %z, align 4 ret void } "#); diff --git a/src/tests/adr/initializer_functions_adr.rs b/src/tests/adr/initializer_functions_adr.rs index 956271e2af5..b08addfdcc2 100644 --- a/src/tests/adr/initializer_functions_adr.rs +++ b/src/tests/adr/initializer_functions_adr.rs @@ -657,44 +657,44 @@ fn generating_init_functions() { "; let res = generate_to_string("Test", vec![SourceCode::from(src)]).unwrap(); - filtered_assert_snapshot!(res, @r###" + filtered_assert_snapshot!(res, @r#" ; ModuleID = '' source_filename = "" target datalayout = "[filtered]" target triple = "[filtered]" %myStruct = type { i8, i8 } - %myRefStruct = type { %myStruct* } + %myRefStruct = type { ptr } @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer @__myRefStruct__init = unnamed_addr constant %myRefStruct zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_myrefstruct(%myRefStruct* %0) { + define void @__init_myrefstruct(ptr %0) { entry: - %self = alloca %myRefStruct*, align 8 - store %myRefStruct* %0, %myRefStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myRefStruct(%myRefStruct* %0) { + define void @__user_init_myRefStruct(ptr %0) { entry: - %self = alloca %myRefStruct*, align 8 - store %myRefStruct* %0, %myRefStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } @@ -702,7 +702,7 @@ fn generating_init_functions() { entry: ret void } - "###); + "#); // The second example shows how each initializer function delegates member-initialization to the respective member-init-function // The wrapping init function contains a single call-statement to `__init_baz`, since `baz` is the only global instance in need of @@ -745,13 +745,13 @@ fn generating_init_functions() { target triple = "[filtered]" %baz = type { %bar } - %bar = type { i32*, %foo } - %foo = type { i32*, %myStruct* } + %bar = type { ptr, %foo } + %foo = type { ptr, ptr } %myStruct = type { i8, i8 } - %__vtable_foo = type { void (%foo*)* } - %__vtable_bar = type { void (%bar*)* } + %__vtable_foo = type { ptr } + %__vtable_bar = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @baz_instance = global %baz zeroinitializer @__bar__init = unnamed_addr constant %bar zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @@ -762,151 +762,151 @@ fn generating_init_functions() { @__vtable_foo_instance = global %__vtable_foo zeroinitializer @__vtable_bar_instance = global %__vtable_bar zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %ps = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %ps = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @bar(%bar* %0) { + define void @bar(ptr %0) { entry: - %this = alloca %bar*, align 8 - store %bar* %0, %bar** %this, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %0, i32 0, i32 0 - %fb = getelementptr inbounds %bar, %bar* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %fb = getelementptr inbounds %bar, ptr %0, i32 0, i32 1 ret void } - define void @baz(%baz* %0) { + define void @baz(ptr %0) { entry: - %fb = getelementptr inbounds %baz, %baz* %0, i32 0, i32 0 + %fb = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init___vtable_bar(%__vtable_bar* %0) { + define void @__init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 - %deref = load %__vtable_bar*, %__vtable_bar** %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, %__vtable_bar* %deref, i32 0, i32 0 - store void (%bar*)* @bar, void (%bar*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @bar, ptr %__body, align 8 ret void } - define void @__init_bar(%bar* %0) { + define void @__init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %fb = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 1 - call void @__init_foo(%foo* %fb) - %deref1 = load %bar*, %bar** %self, align 8 - %__vtable = getelementptr inbounds %bar, %bar* %deref1, i32 0, i32 0 - store i32* bitcast (%__vtable_bar* @__vtable_bar_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %fb = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + call void @__init_foo(ptr %fb) + %deref1 = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %ps = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 1 - store %myStruct* @s, %myStruct** %ps, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %ps = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + store ptr @s, ptr %ps, align 8 ret void } - define void @__init_mystruct(%myStruct* %0) { + define void @__init_mystruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__init_baz(%baz* %0) { + define void @__init_baz(ptr %0) { entry: - %self = alloca %baz*, align 8 - store %baz* %0, %baz** %self, align 8 - %deref = load %baz*, %baz** %self, align 8 - %fb = getelementptr inbounds %baz, %baz* %deref, i32 0, i32 0 - call void @__init_bar(%bar* %fb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %fb = getelementptr inbounds %baz, ptr %deref, i32 0, i32 0 + call void @__init_bar(ptr %fb) ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init___vtable_bar(%__vtable_bar* %0) { + define void @__user_init___vtable_bar(ptr %0) { entry: - %self = alloca %__vtable_bar*, align 8 - store %__vtable_bar* %0, %__vtable_bar** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_baz(%baz* %0) { + define void @__user_init_baz(ptr %0) { entry: - %self = alloca %baz*, align 8 - store %baz* %0, %baz** %self, align 8 - %deref = load %baz*, %baz** %self, align 8 - %fb = getelementptr inbounds %baz, %baz* %deref, i32 0, i32 0 - call void @__user_init_bar(%bar* %fb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %fb = getelementptr inbounds %baz, ptr %deref, i32 0, i32 0 + call void @__user_init_bar(ptr %fb) ret void } - define void @__user_init_bar(%bar* %0) { + define void @__user_init_bar(ptr %0) { entry: - %self = alloca %bar*, align 8 - store %bar* %0, %bar** %self, align 8 - %deref = load %bar*, %bar** %self, align 8 - %fb = getelementptr inbounds %bar, %bar* %deref, i32 0, i32 1 - call void @__user_init_foo(%foo* %fb) + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %fb = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + call void @__user_init_foo(ptr %fb) ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_myStruct(%myStruct* %0) { + define void @__user_init_myStruct(ptr %0) { entry: - %self = alloca %myStruct*, align 8 - store %myStruct* %0, %myStruct** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init_baz(%baz* @baz_instance) - call void @__init_mystruct(%myStruct* @s) - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) - call void @__user_init_baz(%baz* @baz_instance) - call void @__user_init_myStruct(%myStruct* @s) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_bar(%__vtable_bar* @__vtable_bar_instance) + call void @__init_baz(ptr @baz_instance) + call void @__init_mystruct(ptr @s) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__init___vtable_bar(ptr @__vtable_bar_instance) + call void @__user_init_baz(ptr @baz_instance) + call void @__user_init_myStruct(ptr @s) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_bar(ptr @__vtable_bar_instance) ret void } "#); @@ -951,25 +951,25 @@ fn intializing_temporary_variables() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)* } - %foo = type { i32*, [81 x i8]* } + %__vtable_foo = type { ptr } + %foo = type { ptr, ptr } @ps2 = global [81 x i8] zeroinitializer @ps = global [81 x i8] zeroinitializer - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %s2 = alloca [81 x i8]*, align 8 - store [81 x i8]* @ps2, [81 x i8]** %s2, align 8 - store [81 x i8]* @ps2, [81 x i8]** %s2, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %s2 = alloca ptr, align 8 + store ptr @ps2, ptr %s2, align 8 + store ptr @ps2, ptr %s2, align 8 ret void } @@ -977,70 +977,69 @@ fn intializing_temporary_variables() { entry: %main = alloca i32, align 4 %fb = alloca %foo, align 8 - %s = alloca [81 x i8]*, align 8 - %s2 = alloca [81 x i8]*, align 8 - %0 = bitcast %foo* %fb to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false) - store [81 x i8]* null, [81 x i8]** %s, align 8 - store [81 x i8]* @ps2, [81 x i8]** %s2, align 8 - store i32 0, i32* %main, align 4 - store [81 x i8]* @ps, [81 x i8]** %s, align 8 - store [81 x i8]* @ps2, [81 x i8]** %s2, align 8 - call void @__init_foo(%foo* %fb) - call void @__user_init_foo(%foo* %fb) - call void @foo(%foo* %fb) - %main_ret = load i32, i32* %main, align 4 + %s = alloca ptr, align 8 + %s2 = alloca ptr, align 8 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) + store ptr null, ptr %s, align 8 + store ptr @ps2, ptr %s2, align 8 + store i32 0, ptr %main, align 4 + store ptr @ps, ptr %s, align 8 + store ptr @ps2, ptr %s2, align 8 + call void @__init_foo(ptr %fb) + call void @__user_init_foo(ptr %fb) + call void @foo(ptr %fb) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 - %deref1 = load %foo*, %foo** %self, align 8 - %s = getelementptr inbounds %foo, %foo* %deref1, i32 0, i32 1 - store [81 x i8]* @ps, [81 x i8]** %s, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 + %deref1 = load ptr, ptr %self, align 8 + %s = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + store ptr @ps, ptr %s, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#) } @@ -1070,76 +1069,76 @@ fn initializing_method_variables() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32* } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer @__foo__init = unnamed_addr constant %foo zeroinitializer @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 - %px = alloca i32*, align 8 - store i32 10, i32* %x, align 4 - store i32* %x, i32** %px, align 8 - store i32* %x, i32** %px, align 8 + %px = alloca ptr, align 8 + store i32 10, ptr %x, align 4 + store ptr %x, ptr %px, align 8 + store ptr %x, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -1177,92 +1176,92 @@ fn initializing_method_variables() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)*, void (%foo*)* } - %foo = type { i32*, i32 } + %__vtable_foo = type { ptr, ptr, ptr } + %foo = type { ptr, i32 } @y = global i32 0 - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer - @__foo__init = unnamed_addr constant %foo { i32* null, i32 5 } + @__foo__init = unnamed_addr constant %foo { ptr null, i32 5 } @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %px = alloca i32*, align 8 - store i32* %x, i32** %px, align 8 - store i32* %x, i32** %px, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %px = alloca ptr, align 8 + store ptr %x, ptr %px, align 8 + store ptr %x, ptr %px, align 8 ret void } - define void @foo__baz(%foo* %0) { + define void @foo__baz(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %px = alloca i32*, align 8 - store i32* @y, i32** %px, align 8 - store i32* @y, i32** %px, align 8 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %px = alloca ptr, align 8 + store ptr @y, ptr %px, align 8 + store ptr @y, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 - %deref2 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref2, i32 0, i32 2 - store void (%foo*)* @foo__baz, void (%foo*)** %baz, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 + %deref2 = load ptr, ptr %self, align 8 + %baz = getelementptr inbounds %__vtable_foo, ptr %deref2, i32 0, i32 2 + store ptr @foo__baz, ptr %baz, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); @@ -1290,78 +1289,78 @@ fn initializing_method_variables() { target datalayout = "[filtered]" target triple = "[filtered]" - %__vtable_foo = type { void (%foo*)*, void (%foo*)* } - %foo = type { i32*, i32 } + %__vtable_foo = type { ptr, ptr } + %foo = type { ptr, i32 } - @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___Test, i8* null }] + @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___Test, ptr null }] @____vtable_foo__init = unnamed_addr constant %__vtable_foo zeroinitializer - @__foo__init = unnamed_addr constant %foo { i32* null, i32 5 } + @__foo__init = unnamed_addr constant %foo { ptr null, i32 5 } @__vtable_foo_instance = global %__vtable_foo zeroinitializer - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 ret void } - define void @foo__bar(%foo* %0) { + define void @foo__bar(ptr %0) { entry: - %this = alloca %foo*, align 8 - store %foo* %0, %foo** %this, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 %x1 = alloca i32, align 4 - %px = alloca i32*, align 8 - store i32 10, i32* %x1, align 4 - store i32* %x1, i32** %px, align 8 - store i32* %x1, i32** %px, align 8 + %px = alloca ptr, align 8 + store i32 10, ptr %x1, align 4 + store ptr %x1, ptr %px, align 8 + store ptr %x1, ptr %px, align 8 ret void } - define void @__init___vtable_foo(%__vtable_foo* %0) { + define void @__init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 - %deref = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref, i32 0, i32 0 - store void (%foo*)* @foo, void (%foo*)** %__body, align 8 - %deref1 = load %__vtable_foo*, %__vtable_foo** %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, %__vtable_foo* %deref1, i32 0, i32 1 - store void (%foo*)* @foo__bar, void (%foo*)** %bar, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + store ptr @foo, ptr %__body, align 8 + %deref1 = load ptr, ptr %self, align 8 + %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + store ptr @foo__bar, ptr %bar, align 8 ret void } - define void @__init_foo(%foo* %0) { + define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 - %deref = load %foo*, %foo** %self, align 8 - %__vtable = getelementptr inbounds %foo, %foo* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_foo* @__vtable_foo_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } - define void @__user_init___vtable_foo(%__vtable_foo* %0) { + define void @__user_init___vtable_foo(ptr %0) { entry: - %self = alloca %__vtable_foo*, align 8 - store %__vtable_foo* %0, %__vtable_foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } - define void @__user_init_foo(%foo* %0) { + define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___Test() { entry: - call void @__init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) - call void @__user_init___vtable_foo(%__vtable_foo* @__vtable_foo_instance) + call void @__init___vtable_foo(ptr @__vtable_foo_instance) + call void @__user_init___vtable_foo(ptr @__vtable_foo_instance) ret void } "#); diff --git a/src/tests/adr/pou_adr.rs b/src/tests/adr/pou_adr.rs index ac1ef8c7069..9d2bc00bea1 100644 --- a/src/tests/adr/pou_adr.rs +++ b/src/tests/adr/pou_adr.rs @@ -195,18 +195,18 @@ fn codegen_of_a_program_pou() { target datalayout = "[filtered]" target triple = "[filtered]" - %main_prg = type { i16, i16*, i16, i16 } + %main_prg = type { i16, ptr, i16, i16 } @main_prg_instance = global %main_prg zeroinitializer - define void @main_prg(%main_prg* %0) { + define void @main_prg(ptr %0) { entry: - %i = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 0 - %io = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 1 - %o = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 2 - %v = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 3 + %i = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 - store i16 0, i16* %vt, align 2 + store i16 0, ptr %vt, align 2 ret void } "#); @@ -235,7 +235,7 @@ fn calling_a_program() { target datalayout = "[filtered]" target triple = "[filtered]" - %main_prg = type { i16, i16*, i16, i16 } + %main_prg = type { i16, ptr, i16, i16 } @main_prg_instance = global %main_prg zeroinitializer @@ -244,26 +244,26 @@ fn calling_a_program() { %foo = alloca i16, align 2 %x = alloca i16, align 2 %y = alloca i16, align 2 - store i16 0, i16* %x, align 2 - store i16 0, i16* %y, align 2 - store i16 0, i16* %foo, align 2 - store i16 1, i16* getelementptr inbounds (%main_prg, %main_prg* @main_prg_instance, i32 0, i32 0), align 2 - store i16* %y, i16** getelementptr inbounds (%main_prg, %main_prg* @main_prg_instance, i32 0, i32 1), align 8 - call void @main_prg(%main_prg* @main_prg_instance) - %0 = load i16, i16* getelementptr inbounds (%main_prg, %main_prg* @main_prg_instance, i32 0, i32 2), align 2 - store i16 %0, i16* %x, align 2 - %foo_ret = load i16, i16* %foo, align 2 + store i16 0, ptr %x, align 2 + store i16 0, ptr %y, align 2 + store i16 0, ptr %foo, align 2 + store i16 1, ptr @main_prg_instance, align 2 + store ptr %y, ptr getelementptr inbounds (%main_prg, ptr @main_prg_instance, i32 0, i32 1), align 8 + call void @main_prg(ptr @main_prg_instance) + %0 = load i16, ptr getelementptr inbounds (%main_prg, ptr @main_prg_instance, i32 0, i32 2), align 2 + store i16 %0, ptr %x, align 2 + %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret } - define void @main_prg(%main_prg* %0) { + define void @main_prg(ptr %0) { entry: - %i = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 0 - %io = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 1 - %o = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 2 - %v = getelementptr inbounds %main_prg, %main_prg* %0, i32 0, i32 3 + %i = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 - store i16 0, i16* %vt, align 2 + store i16 0, ptr %vt, align 2 ret void } "#); @@ -300,20 +300,20 @@ fn function_blocks_get_a_method_with_a_self_parameter() { target datalayout = "[filtered]" target triple = "[filtered]" - %main_fb = type { i16, i16*, i16, i16 } + %main_fb = type { i16, ptr, i16, i16 } - @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 } + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, ptr null, i16 0, i16 1 } - define void @main_fb(%main_fb* %0) { + define void @main_fb(ptr %0) { entry: - %this = alloca %main_fb*, align 8 - store %main_fb* %0, %main_fb** %this, align 8 - %i = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 0 - %io = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 1 - %o = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 2 - %v = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 3 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %i = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 - store i16 2, i16* %vt, align 2 + store i16 2, ptr %vt, align 2 ret void } "#); @@ -344,37 +344,37 @@ fn calling_a_function_block() { target triple = "[filtered]" %foo = type { i16, i16, %main_fb } - %main_fb = type { i16, i16*, i16, i16 } + %main_fb = type { i16, ptr, i16, i16 } - @foo_instance = global %foo { i16 0, i16 0, %main_fb { i16 6, i16* null, i16 0, i16 1 } } - @__main_fb__init = unnamed_addr constant %main_fb { i16 6, i16* null, i16 0, i16 1 } + @foo_instance = global %foo { i16 0, i16 0, %main_fb { i16 6, ptr null, i16 0, i16 1 } } + @__main_fb__init = unnamed_addr constant %main_fb { i16 6, ptr null, i16 0, i16 1 } - define void @foo(%foo* %0) { + define void @foo(ptr %0) { entry: - %x = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 - %y = getelementptr inbounds %foo, %foo* %0, i32 0, i32 1 - %fb = getelementptr inbounds %foo, %foo* %0, i32 0, i32 2 - %1 = getelementptr inbounds %main_fb, %main_fb* %fb, i32 0, i32 0 - store i16 1, i16* %1, align 2 - %2 = getelementptr inbounds %main_fb, %main_fb* %fb, i32 0, i32 1 - store i16* %y, i16** %2, align 8 - call void @main_fb(%main_fb* %fb) - %3 = getelementptr inbounds %main_fb, %main_fb* %fb, i32 0, i32 2 - %4 = load i16, i16* %3, align 2 - store i16 %4, i16* %x, align 2 + %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %fb = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %1 = getelementptr inbounds %main_fb, ptr %fb, i32 0, i32 0 + store i16 1, ptr %1, align 2 + %2 = getelementptr inbounds %main_fb, ptr %fb, i32 0, i32 1 + store ptr %y, ptr %2, align 8 + call void @main_fb(ptr %fb) + %3 = getelementptr inbounds %main_fb, ptr %fb, i32 0, i32 2 + %4 = load i16, ptr %3, align 2 + store i16 %4, ptr %x, align 2 ret void } - define void @main_fb(%main_fb* %0) { + define void @main_fb(ptr %0) { entry: - %this = alloca %main_fb*, align 8 - store %main_fb* %0, %main_fb** %this, align 8 - %i = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 0 - %io = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 1 - %o = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 2 - %v = getelementptr inbounds %main_fb, %main_fb* %0, i32 0, i32 3 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %i = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 - store i16 2, i16* %vt, align 2 + store i16 2, ptr %vt, align 2 ret void } "#); @@ -405,21 +405,21 @@ fn function_get_a_method_with_by_ref_parameters() { target datalayout = "[filtered]" target triple = "[filtered]" - define i32 @main_fun(i16 %0, i8* %1, i64* %2) { + define i32 @main_fun(i16 %0, ptr %1, ptr %2) { entry: %main_fun = alloca i32, align 4 %i = alloca i16, align 2 - store i16 %0, i16* %i, align 2 - %io = alloca i8*, align 8 - store i8* %1, i8** %io, align 8 - %o = alloca i64*, align 8 - store i64* %2, i64** %o, align 8 + store i16 %0, ptr %i, align 2 + %io = alloca ptr, align 8 + store ptr %1, ptr %io, align 8 + %o = alloca ptr, align 8 + store ptr %2, ptr %o, align 8 %v = alloca i16, align 2 %vt = alloca i16, align 2 - store i16 1, i16* %v, align 2 - store i16 2, i16* %vt, align 2 - store i32 0, i32* %main_fun, align 4 - %main_fun_ret = load i32, i32* %main_fun, align 4 + store i16 1, ptr %v, align 2 + store i16 2, ptr %vt, align 2 + store i32 0, ptr %main_fun, align 4 + %main_fun_ret = load i32, ptr %main_fun, align 4 ret i32 %main_fun_ret } "#); @@ -453,31 +453,31 @@ fn calling_a_function() { @prg_instance = global %prg zeroinitializer - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %load_x = load i16, i16* %x, align 2 + %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %load_x = load i16, ptr %x, align 2 %1 = alloca i64, align 8 - %call = call i32 @main_fun(i16 %load_x, i8* %z, i64* %1) + %call = call i32 @main_fun(i16 %load_x, ptr %z, ptr %1) ret void } - define i32 @main_fun(i16 %0, i8* %1, i64* %2) { + define i32 @main_fun(i16 %0, ptr %1, ptr %2) { entry: %main_fun = alloca i32, align 4 %i = alloca i16, align 2 - store i16 %0, i16* %i, align 2 - %io = alloca i8*, align 8 - store i8* %1, i8** %io, align 8 - %o = alloca i64*, align 8 - store i64* %2, i64** %o, align 8 + store i16 %0, ptr %i, align 2 + %io = alloca ptr, align 8 + store ptr %1, ptr %io, align 8 + %o = alloca ptr, align 8 + store ptr %2, ptr %o, align 8 %v = alloca i16, align 2 %vt = alloca i16, align 2 - store i16 1, i16* %v, align 2 - store i16 2, i16* %vt, align 2 - store i32 0, i32* %main_fun, align 4 - %main_fun_ret = load i32, i32* %main_fun, align 4 + store i16 1, ptr %v, align 2 + store i16 2, ptr %vt, align 2 + store i32 0, ptr %main_fun, align 4 + %main_fun_ret = load i32, ptr %main_fun, align 4 ret i32 %main_fun_ret } "#); @@ -518,37 +518,33 @@ fn return_a_complex_type_from_function() { @prg_instance = global %prg zeroinitializer @utf08_literal_0 = private unnamed_addr constant [13 x i8] c"hello world!\00" - define void @foo(i8* %0) { + define void @foo(ptr %0) { entry: - %foo = alloca i8*, align 8 - store i8* %0, i8** %foo, align 8 - %deref = load i8*, i8** %foo, align 8 - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %deref, i8* align 1 getelementptr inbounds ([13 x i8], [13 x i8]* @utf08_literal_0, i32 0, i32 0), i32 13, i1 false) + %foo = alloca ptr, align 8 + store ptr %0, ptr %foo, align 8 + %deref = load ptr, ptr %foo, align 8 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 13, i1 false) ret void } - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %s = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 + %s = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 %__foo0 = alloca [81 x i8], align 1 - %1 = bitcast [81 x i8]* %__foo0 to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %1, i8 0, i64 ptrtoint ([81 x i8]* getelementptr ([81 x i8], [81 x i8]* null, i32 1) to i64), i1 false) - %2 = bitcast [81 x i8]* %__foo0 to i8* - call void @foo(i8* %2) - %3 = bitcast [81 x i8]* %s to i8* - %4 = bitcast [81 x i8]* %__foo0 to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %4, i32 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %__foo0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) + call void @foo(ptr %__foo0) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 %__foo0, i32 80, i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn } - attributes #1 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#); } @@ -602,52 +598,39 @@ fn passing_aggregate_types_to_functions_by_value() { @__myStruct__init = unnamed_addr constant %myStruct zeroinitializer @main_instance = global %main zeroinitializer - define void @foo(i8* %0, i16* %1, i32* %2, %myStruct* %3) { + define void @foo(ptr %0, ptr %1, ptr %2, ptr %3) { entry: %s = alloca [81 x i8], align 1 - %bitcast = bitcast [81 x i8]* %s to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %bitcast, i8 0, i64 81, i1 false) - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %bitcast, i8* align 1 %0, i64 80, i1 false) + call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 81, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %s, ptr align 1 %0, i64 80, i1 false) %ws = alloca [81 x i16], align 2 - %bitcast1 = bitcast [81 x i16]* %ws to i16* - %4 = bitcast i16* %bitcast1 to i8* - call void @llvm.memset.p0i8.i64(i8* align 2 %4, i8 0, i64 162, i1 false) - %5 = bitcast i16* %bitcast1 to i8* - %6 = bitcast i16* %1 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 2 %5, i8* align 2 %6, i64 160, i1 false) + call void @llvm.memset.p0.i64(ptr align 2 %ws, i8 0, i64 162, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 2 %ws, ptr align 2 %1, i64 160, i1 false) %arr = alloca [30000 x i32], align 4 - %bitcast2 = bitcast [30000 x i32]* %arr to i32* - %7 = bitcast i32* %bitcast2 to i8* - %8 = bitcast i32* %2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %7, i8* align 1 %8, i64 ptrtoint ([30000 x i32]* getelementptr ([30000 x i32], [30000 x i32]* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr, ptr align 1 %2, i64 ptrtoint (ptr getelementptr ([30000 x i32], ptr null, i32 1) to i64), i1 false) %st = alloca %myStruct, align 8 - %9 = bitcast %myStruct* %st to i8* - %10 = bitcast %myStruct* %3 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %9, i8* align 1 %10, i64 ptrtoint (%myStruct* getelementptr (%myStruct, %myStruct* null, i32 1) to i64), i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %st, ptr align 1 %3, i64 ptrtoint (ptr getelementptr (%myStruct, ptr null, i32 1) to i64), i1 false) ret void } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %string1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %string2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %array1 = getelementptr inbounds %main, %main* %0, i32 0, i32 2 - %struct1 = getelementptr inbounds %main, %main* %0, i32 0, i32 3 - %1 = bitcast [81 x i8]* %string1 to i8* - %2 = bitcast [81 x i16]* %string2 to i16* - %3 = bitcast [30000 x i32]* %array1 to i32* - call void @foo(i8* %1, i16* %2, i32* %3, %myStruct* %struct1) + %string1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %string2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %array1 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %struct1 = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + call void @foo(ptr %string1, ptr %string2, ptr %array1, ptr %struct1) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #1 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #1 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -688,25 +671,23 @@ fn passing_by_ref_to_functions() { @main_instance = global %main zeroinitializer - define i8 @StrEqual(i8* %0, i8* %1) { + define i8 @StrEqual(ptr %0, ptr %1) { entry: %StrEqual = alloca i8, align 1 - %o1 = alloca i8*, align 8 - store i8* %0, i8** %o1, align 8 - %o2 = alloca i8*, align 8 - store i8* %1, i8** %o2, align 8 - store i8 0, i8* %StrEqual, align 1 - %StrEqual_ret = load i8, i8* %StrEqual, align 1 + %o1 = alloca ptr, align 8 + store ptr %0, ptr %o1, align 8 + %o2 = alloca ptr, align 8 + store ptr %1, ptr %o2, align 8 + store i8 0, ptr %StrEqual, align 1 + %StrEqual_ret = load i8, ptr %StrEqual, align 1 ret i8 %StrEqual_ret } - define void @main(%main* %0) { + define void @main(ptr %0) { entry: - %str1 = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %str2 = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %1 = bitcast [81 x i8]* %str1 to i8* - %2 = bitcast [81 x i8]* %str2 to i8* - %call = call i8 @StrEqual(i8* %1, i8* %2) + %str1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %str2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %call = call i8 @StrEqual(ptr %str1, ptr %str2) ret void } "#); diff --git a/src/tests/adr/strings_adr.rs b/src/tests/adr/strings_adr.rs index 888c98bda76..d5aa621ee75 100644 --- a/src/tests/adr/strings_adr.rs +++ b/src/tests/adr/strings_adr.rs @@ -76,20 +76,18 @@ fn assigning_strings() { @prg_instance = global %prg zeroinitializer - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [11 x i8]* %a to i8* - %2 = bitcast [11 x i8]* %b to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 %2, i32 10, i1 false) + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 10, i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -121,20 +119,18 @@ fn assigning_string_literals() { @utf08_literal_0 = private unnamed_addr constant [6 x i8] c"hello\00" @utf08_literal_1 = private unnamed_addr constant [6 x i8] c"world\00" - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast [11 x i8]* %a to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %1, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_0, i32 0, i32 0), i32 6, i1 false) - %2 = bitcast [11 x i8]* %b to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %2, i8* align 1 getelementptr inbounds ([6 x i8], [6 x i8]* @utf08_literal_1, i32 0, i32 0), i32 6, i1 false) + %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 6, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 1 %b, ptr align 1 @utf08_literal_1, i32 6, i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } diff --git a/src/tests/adr/structs_adr.rs b/src/tests/adr/structs_adr.rs index cda4ae35525..df3fffdc9bb 100644 --- a/src/tests/adr/structs_adr.rs +++ b/src/tests/adr/structs_adr.rs @@ -109,10 +109,10 @@ fn initializing_a_struct() { @__prg.rect1__init = unnamed_addr constant %Rect { %Point { i16 1, i16 5 }, %Point { i16 10, i16 15 } } @__prg.rect2__init = unnamed_addr constant %Rect { %Point { i16 4, i16 6 }, %Point { i16 16, i16 22 } } - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %rect1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %rect2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 + %rect1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %rect2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 ret void } "#); @@ -154,20 +154,18 @@ fn assigning_structs() { @prg_instance = global %prg zeroinitializer @__Point__init = unnamed_addr constant %Point zeroinitializer - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %p1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %p2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %1 = bitcast %Point* %p1 to i8* - %2 = bitcast %Point* %p2 to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %1, i8* align 1 %2, i64 ptrtoint (%Point* getelementptr (%Point, %Point* null, i32 1) to i64), i1 false) + %p1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %p2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %p1, ptr align 1 %p2, i64 ptrtoint (ptr getelementptr (%Point, ptr null, i32 1) to i64), i1 false) ret void } - ; Function Attrs: argmemonly nofree nounwind willreturn - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn } "#); } @@ -214,16 +212,16 @@ fn accessing_struct_members() { @__Rect__init = unnamed_addr constant %Rect zeroinitializer @__Point__init = unnamed_addr constant %Point zeroinitializer - define void @prg(%prg* %0) { + define void @prg(ptr %0) { entry: - %rect1 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 0 - %rect2 = getelementptr inbounds %prg, %prg* %0, i32 0, i32 1 - %topLeft = getelementptr inbounds %Rect, %Rect* %rect1, i32 0, i32 0 - %x = getelementptr inbounds %Point, %Point* %topLeft, i32 0, i32 0 - %bottomRight = getelementptr inbounds %Rect, %Rect* %rect2, i32 0, i32 1 - %x1 = getelementptr inbounds %Point, %Point* %bottomRight, i32 0, i32 0 - %load_x = load i16, i16* %x1, align 2 - store i16 %load_x, i16* %x, align 2 + %rect1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %rect2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %topLeft = getelementptr inbounds %Rect, ptr %rect1, i32 0, i32 0 + %x = getelementptr inbounds %Point, ptr %topLeft, i32 0, i32 0 + %bottomRight = getelementptr inbounds %Rect, ptr %rect2, i32 0, i32 1 + %x1 = getelementptr inbounds %Point, ptr %bottomRight, i32 0, i32 0 + %load_x = load i16, ptr %x1, align 2 + store i16 %load_x, ptr %x, align 2 ret void } "#); diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index 9e8ee65e644..3d9a76c9c87 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -183,7 +183,7 @@ fn declare() { END_FUNCTION "; - assert!(codegen(src).contains("%__foo_arr = type { i32*, [2 x i32] }")); + assert!(codegen(src).contains("%__foo_arr = type { ptr, [2 x i32] }")); } /// VLAs (in RuSTy) are defined to be always by-ref, meaning POUs accepting VLAs expect a pointer to a struct. @@ -314,7 +314,7 @@ fn pass() { target datalayout = "[filtered]" target triple = "[filtered]" - %__foo_arr = type { i32*, [2 x i32] } + %__foo_arr = type { ptr, [2 x i32] } @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer @@ -322,38 +322,37 @@ fn pass() { entry: %main = alloca i32, align 4 %local = alloca [6 x i32], align 4 - %0 = bitcast [6 x i32]* %local to i8* - call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 ptrtoint ([6 x i32]* getelementptr ([6 x i32], [6 x i32]* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - %auto_deref = load [6 x i32], [6 x i32]* %local, align 4 - %outer_arr_gep = getelementptr inbounds [6 x i32], [6 x i32]* %local, i32 0, i32 0 + call void @llvm.memset.p0.i64(ptr align 1 %local, i8 0, i64 ptrtoint (ptr getelementptr ([6 x i32], ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + %auto_deref = load [6 x i32], ptr %local, align 4 + %outer_arr_gep = getelementptr inbounds [6 x i32], ptr %local, i32 0, i32 0 %vla_struct = alloca %__foo_arr, align 8 - %vla_array_gep = getelementptr inbounds %__foo_arr, %__foo_arr* %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_arr, %__foo_arr* %vla_struct, i32 0, i32 1 - store [2 x i32] [i32 0, i32 5], [2 x i32]* %vla_dimensions_gep, align 4 - store i32* %outer_arr_gep, i32** %vla_array_gep, align 8 - %1 = load %__foo_arr, %__foo_arr* %vla_struct, align 8 + %vla_array_gep = getelementptr inbounds %__foo_arr, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds %__foo_arr, ptr %vla_struct, i32 0, i32 1 + store [2 x i32] [i32 0, i32 5], ptr %vla_dimensions_gep, align 4 + store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 + %0 = load %__foo_arr, ptr %vla_struct, align 8 %vla_struct_ptr = alloca %__foo_arr, align 8 - store %__foo_arr %1, %__foo_arr* %vla_struct_ptr, align 8 - %call = call i32 @foo(%__foo_arr* %vla_struct_ptr) - %main_ret = load i32, i32* %main, align 4 + store %__foo_arr %0, ptr %vla_struct_ptr, align 8 + %call = call i32 @foo(ptr %vla_struct_ptr) + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } - define i32 @foo(%__foo_arr* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 - %arr = alloca %__foo_arr*, align 8 - store %__foo_arr* %0, %__foo_arr** %arr, align 8 - store i32 0, i32* %foo, align 4 - %foo_ret = load i32, i32* %foo, align 4 + %arr = alloca ptr, align 8 + store ptr %0, ptr %arr, align 8 + store i32 0, ptr %foo, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } - ; Function Attrs: argmemonly nofree nounwind willreturn writeonly - declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #0 + ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - attributes #0 = { argmemonly nofree nounwind willreturn writeonly } + attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } "#); } @@ -382,28 +381,28 @@ fn access() { target datalayout = "[filtered]" target triple = "[filtered]" - %__foo_arr = type { i32*, [2 x i32] } + %__foo_arr = type { ptr, [2 x i32] } @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer - define i32 @foo(%__foo_arr* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 - %arr = alloca %__foo_arr*, align 8 - store %__foo_arr* %0, %__foo_arr** %arr, align 8 - store i32 0, i32* %foo, align 4 - %deref = load %__foo_arr*, %__foo_arr** %arr, align 8 - %vla_arr_gep = getelementptr inbounds %__foo_arr, %__foo_arr* %deref, i32 0, i32 0 - %vla_arr_ptr = load i32*, i32** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_arr, %__foo_arr* %deref, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 + %arr = alloca ptr, align 8 + store ptr %0, ptr %arr, align 8 + store i32 0, ptr %foo, align 4 + %deref = load ptr, ptr %arr, align 8 + %vla_arr_gep = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 %tmpVar = sub i32 0, %start_idx_value0 - %arr_val = getelementptr inbounds i32, i32* %vla_arr_ptr, i32 %tmpVar - store i32 12345, i32* %arr_val, align 4 - %foo_ret = load i32, i32* %foo, align 4 + %arr_val = getelementptr inbounds i32, ptr %vla_arr_ptr, i32 %tmpVar + store i32 12345, ptr %arr_val, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } "#); @@ -442,54 +441,54 @@ fn multi_dimensional() { target datalayout = "[filtered]" target triple = "[filtered]" - %__foo_arr = type { i32*, [4 x i32] } + %__foo_arr = type { ptr, [4 x i32] } @____foo_arr__init = unnamed_addr constant %__foo_arr zeroinitializer - define i32 @foo(%__foo_arr* %0) { + define i32 @foo(ptr %0) { entry: %foo = alloca i32, align 4 - %arr = alloca %__foo_arr*, align 8 - store %__foo_arr* %0, %__foo_arr** %arr, align 8 - store i32 0, i32* %foo, align 4 - %deref = load %__foo_arr*, %__foo_arr** %arr, align 8 - %vla_arr_gep = getelementptr inbounds %__foo_arr, %__foo_arr* %deref, i32 0, i32 0 - %vla_arr_ptr = load i32*, i32** %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_arr, %__foo_arr* %deref, i32 0, i32 1 - %start_idx_ptr0 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 0 - %end_idx_ptr0 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 1 - %start_idx_value0 = load i32, i32* %start_idx_ptr0, align 4 - %end_idx_value0 = load i32, i32* %end_idx_ptr0, align 4 - %start_idx_ptr1 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 2 - %end_idx_ptr1 = getelementptr inbounds [4 x i32], [4 x i32]* %dim_arr, i32 0, i32 3 - %start_idx_value1 = load i32, i32* %start_idx_ptr1, align 4 - %end_idx_value1 = load i32, i32* %end_idx_ptr1, align 4 + %arr = alloca ptr, align 8 + store ptr %0, ptr %arr, align 8 + store i32 0, ptr %foo, align 4 + %deref = load ptr, ptr %arr, align 8 + %vla_arr_gep = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 0 + %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 + %dim_arr = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 1 + %start_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 0 + %end_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 1 + %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 + %end_idx_value0 = load i32, ptr %end_idx_ptr0, align 4 + %start_idx_ptr1 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 2 + %end_idx_ptr1 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 3 + %start_idx_value1 = load i32, ptr %start_idx_ptr1, align 4 + %end_idx_value1 = load i32, ptr %end_idx_ptr1, align 4 %1 = sub i32 %end_idx_value0, %start_idx_value0 %len_dim0 = add i32 1, %1 %2 = sub i32 %end_idx_value1, %start_idx_value1 %len_dim1 = add i32 1, %2 %accum = alloca i32, align 4 - store i32 1, i32* %accum, align 4 - %load_accum = load i32, i32* %accum, align 4 + store i32 1, ptr %accum, align 4 + %load_accum = load i32, ptr %accum, align 4 %product = mul i32 %load_accum, %len_dim1 - store i32 %product, i32* %accum, align 4 - %accessor_factor = load i32, i32* %accum, align 4 + store i32 %product, ptr %accum, align 4 + %accessor_factor = load i32, ptr %accum, align 4 %adj_access0 = sub i32 0, %start_idx_value0 %adj_access1 = sub i32 1, %start_idx_value1 %accum1 = alloca i32, align 4 - store i32 0, i32* %accum1, align 4 + store i32 0, ptr %accum1, align 4 %multiply = mul i32 %adj_access0, %accessor_factor - %load_accum2 = load i32, i32* %accum1, align 4 + %load_accum2 = load i32, ptr %accum1, align 4 %accumulate = add i32 %load_accum2, %multiply - store i32 %accumulate, i32* %accum1, align 4 + store i32 %accumulate, ptr %accum1, align 4 %multiply3 = mul i32 %adj_access1, 1 - %load_accum4 = load i32, i32* %accum1, align 4 + %load_accum4 = load i32, ptr %accum1, align 4 %accumulate5 = add i32 %load_accum4, %multiply3 - store i32 %accumulate5, i32* %accum1, align 4 - %accessor = load i32, i32* %accum1, align 4 - %arr_val = getelementptr inbounds i32, i32* %vla_arr_ptr, i32 %accessor - store i32 12345, i32* %arr_val, align 4 - %foo_ret = load i32, i32* %foo, align 4 + store i32 %accumulate5, ptr %accum1, align 4 + %accessor = load i32, ptr %accum1, align 4 + %arr_val = getelementptr inbounds i32, ptr %vla_arr_ptr, i32 %accessor + store i32 12345, ptr %arr_val, align 4 + %foo_ret = load i32, ptr %foo, align 4 ret i32 %foo_ret } "#); diff --git a/tests/integration/linking.rs b/tests/integration/linking.rs index 29b20241749..68a6e533fd9 100644 --- a/tests/integration/linking.rs +++ b/tests/integration/linking.rs @@ -140,14 +140,15 @@ fn link_missing_file() { let res = compile(&["plc", file1.as_str(), "-o", out.to_str().unwrap(), "--target", TARGET.unwrap()]); - match res { - Err(err) => { - assert!(err - .to_string() - .contains("An error occurred during linking: lld: error: undefined symbol: func")); - } - _ => panic!("Expected link failure"), - } + // lld will return something like: + // ``` + // ld.lld: error: undefined symbol: func2 + // >>> referenced by file1.st + // >>> /tmp/.tmpvZqPnA/tests/integration/data/linking/file1.st.o:(func1) + // >>> did you mean: func1 + // >>> defined in: /tmp/.tmpvZqPnA/tests/integration/data/linking/file1.st.o + // ``` + assert!(res.is_err()); } // TODO: Ghaith please fix this :) diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap index 9c379db6637..5474dc76f38 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap @@ -6,67 +6,67 @@ target triple = "[filtered]" %main = type { i32, i32 } -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] @main_instance = global %main zeroinitializer, !dbg !0 -define void @main(%main* %0) !dbg !12 { +define void @main(ptr %0) !dbg !12 { entry: - call void @llvm.dbg.declare(metadata %main* %0, metadata !16, metadata !DIExpression()), !dbg !17 - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - store i32 0, i32* %a, align 4, !dbg !18 - call void @main__newAction(%main* %0), !dbg !17 - call void @main__newAction2(%main* %0), !dbg !19 + call void @llvm.dbg.declare(metadata ptr %0, metadata !16, metadata !DIExpression()), !dbg !17 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + store i32 0, ptr %a, align 4, !dbg !18 + call void @main__newAction(ptr %0), !dbg !17 + call void @main__newAction2(ptr %0), !dbg !19 ret void, !dbg !20 } -define void @main__newAction(%main* %0) { +define void @main__newAction(ptr %0) { entry: - call void @llvm.dbg.declare(metadata %main* %0, metadata !15, metadata !DIExpression()), !dbg !21 - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %load_a = load i32, i32* %a, align 4, !dbg !21 + call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !21 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %load_a = load i32, ptr %a, align 4, !dbg !21 %tmpVar = add i32 %load_a, 1, !dbg !21 - store i32 %tmpVar, i32* %a, align 4, !dbg !21 + store i32 %tmpVar, ptr %a, align 4, !dbg !21 ret void, !dbg !22 } -define void @main__newAction2(%main* %0) { +define void @main__newAction2(ptr %0) { entry: - call void @llvm.dbg.declare(metadata %main* %0, metadata !15, metadata !DIExpression()), !dbg !21 - %a = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - %b = getelementptr inbounds %main, %main* %0, i32 0, i32 1 - %load_b = load i32, i32* %b, align 4, !dbg !23 + call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !21 + %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %load_b = load i32, ptr %b, align 4, !dbg !23 %tmpVar = add i32 %load_b, 2, !dbg !23 - store i32 %tmpVar, i32* %b, align 4, !dbg !23 + store i32 %tmpVar, ptr %b, align 4, !dbg !23 ret void, !dbg !22 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -define void @__init_main(%main* %0) { +define void @__init_main(ptr %0) { entry: - %self = alloca %main*, align 8 - store %main* %0, %main** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_main(%main* %0) { +define void @__user_init_main(ptr %0) { entry: - %self = alloca %main*, align 8 - store %main* %0, %main** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___plc() { entry: - call void @__init_main(%main* @main_instance) - call void @__user_init_main(%main* @main_instance) + call void @__init_main(ptr @main_instance) + call void @__user_init_main(ptr @main_instance) ret void } -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!8, !9} !llvm.dbg.cu = !{!10} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap index 00cde4aeb9c..5a988f63c40 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap @@ -4,21 +4,21 @@ expression: output_file_content_without_headers --- target triple = "[filtered]" -%__vtable_conditional_return = type { void (%conditional_return*)* } -%conditional_return = type { i32*, i32 } +%__vtable_conditional_return = type { ptr } +%conditional_return = type { ptr, i32 } -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] @____vtable_conditional_return__init = unnamed_addr constant %__vtable_conditional_return zeroinitializer @__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer @__vtable_conditional_return_instance = global %__vtable_conditional_return zeroinitializer -define void @conditional_return(%conditional_return* %0) { +define void @conditional_return(ptr %0) { entry: - %this = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %this, align 8 - %__vtable = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 - %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 1 - %load_val = load i32, i32* %val, align 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 1 + %load_val = load i32, ptr %val, align 4 %tmpVar = icmp eq i32 %load_val, 5 br i1 %tmpVar, label %then_block, label %else_block @@ -26,47 +26,47 @@ then_block: ; preds = %entry ret void else_block: ; preds = %entry - store i32 10, i32* %val, align 4 + store i32 10, ptr %val, align 4 ret void } -define void @__init___vtable_conditional_return(%__vtable_conditional_return* %0) { +define void @__init___vtable_conditional_return(ptr %0) { entry: - %self = alloca %__vtable_conditional_return*, align 8 - store %__vtable_conditional_return* %0, %__vtable_conditional_return** %self, align 8 - %deref = load %__vtable_conditional_return*, %__vtable_conditional_return** %self, align 8 - %__body = getelementptr inbounds %__vtable_conditional_return, %__vtable_conditional_return* %deref, i32 0, i32 0 - store void (%conditional_return*)* @conditional_return, void (%conditional_return*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_conditional_return, ptr %deref, i32 0, i32 0 + store ptr @conditional_return, ptr %__body, align 8 ret void } -define void @__init_conditional_return(%conditional_return* %0) { +define void @__init_conditional_return(ptr %0) { entry: - %self = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %self, align 8 - %deref = load %conditional_return*, %conditional_return** %self, align 8 - %__vtable = getelementptr inbounds %conditional_return, %conditional_return* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_conditional_return* @__vtable_conditional_return_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %conditional_return, ptr %deref, i32 0, i32 0 + store ptr @__vtable_conditional_return_instance, ptr %__vtable, align 8 ret void } -define void @__user_init___vtable_conditional_return(%__vtable_conditional_return* %0) { +define void @__user_init___vtable_conditional_return(ptr %0) { entry: - %self = alloca %__vtable_conditional_return*, align 8 - store %__vtable_conditional_return* %0, %__vtable_conditional_return** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_conditional_return(%conditional_return* %0) { +define void @__user_init_conditional_return(ptr %0) { entry: - %self = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___plc() { entry: - call void @__init___vtable_conditional_return(%__vtable_conditional_return* @__vtable_conditional_return_instance) - call void @__user_init___vtable_conditional_return(%__vtable_conditional_return* @__vtable_conditional_return_instance) + call void @__init___vtable_conditional_return(ptr @__vtable_conditional_return_instance) + call void @__user_init___vtable_conditional_return(ptr @__vtable_conditional_return_instance) ret void } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap index 09ce6001209..53a35603202 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap @@ -1,35 +1,34 @@ --- source: tests/integration/cfc.rs expression: output_file_content_without_headers -snapshot_kind: text --- target triple = "[filtered]" -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] define i32 @foo(i32 %0) !dbg !4 { entry: %foo = alloca i32, align 4 %val = alloca i32, align 4 - call void @llvm.dbg.declare(metadata i32* %val, metadata !9, metadata !DIExpression()), !dbg !10 - store i32 %0, i32* %val, align 4 - call void @llvm.dbg.declare(metadata i32* %foo, metadata !11, metadata !DIExpression()), !dbg !12 - store i32 0, i32* %foo, align 4 - %load_val = load i32, i32* %val, align 4, !dbg !13 + call void @llvm.dbg.declare(metadata ptr %val, metadata !9, metadata !DIExpression()), !dbg !10 + store i32 %0, ptr %val, align 4 + call void @llvm.dbg.declare(metadata ptr %foo, metadata !11, metadata !DIExpression()), !dbg !12 + store i32 0, ptr %foo, align 4 + %load_val = load i32, ptr %val, align 4, !dbg !13 %tmpVar = icmp eq i32 %load_val, 5, !dbg !13 br i1 %tmpVar, label %then_block, label %else_block, !dbg !13 then_block: ; preds = %entry - %foo_ret = load i32, i32* %foo, align 4, !dbg !14 + %foo_ret = load i32, ptr %foo, align 4, !dbg !14 ret i32 %foo_ret, !dbg !14 else_block: ; preds = %entry - store i32 10, i32* %val, align 4, !dbg !15 - %foo_ret1 = load i32, i32* %foo, align 4, !dbg !16 + store i32 10, ptr %val, align 4, !dbg !15 + %foo_ret1 = load i32, ptr %foo, align 4, !dbg !16 ret i32 %foo_ret1, !dbg !16 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___plc() { @@ -37,7 +36,7 @@ entry: ret void } -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap index caba3519446..40067d0dc2b 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap @@ -4,10 +4,10 @@ expression: output_file_content_without_headers --- target triple = "[filtered]" -%__vtable_conditional_return = type { void (%conditional_return*)* } -%conditional_return = type { i32*, i32 } +%__vtable_conditional_return = type { ptr } +%conditional_return = type { ptr, i32 } -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] @____vtable_conditional_return__init = unnamed_addr constant %__vtable_conditional_return zeroinitializer @__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer @__vtable_conditional_return_instance = global %__vtable_conditional_return zeroinitializer @@ -17,33 +17,32 @@ entry: %main = alloca i32, align 4 %my_val = alloca i32, align 4 %conditional = alloca %conditional_return, align 8 - store i32 5, i32* %my_val, align 4 - %0 = bitcast %conditional_return* %conditional to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%conditional_return* @__conditional_return__init to i8*), i64 ptrtoint (%conditional_return* getelementptr (%conditional_return, %conditional_return* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - call void @__init_conditional_return(%conditional_return* %conditional) - call void @__user_init_conditional_return(%conditional_return* %conditional) - %val = getelementptr inbounds %conditional_return, %conditional_return* %conditional, i32 0, i32 1 - %load_my_val = load i32, i32* %my_val, align 4 - store i32 %load_my_val, i32* %val, align 4 - call void @conditional_return(%conditional_return* %conditional) - %val1 = getelementptr inbounds %conditional_return, %conditional_return* %conditional, i32 0, i32 1 - %load_val = load i32, i32* %val1, align 4 - store i32 %load_val, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 5, ptr %my_val, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %conditional, ptr align 1 @__conditional_return__init, i64 ptrtoint (ptr getelementptr (%conditional_return, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + call void @__init_conditional_return(ptr %conditional) + call void @__user_init_conditional_return(ptr %conditional) + %val = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %load_my_val = load i32, ptr %my_val, align 4 + store i32 %load_my_val, ptr %val, align 4 + call void @conditional_return(ptr %conditional) + %val1 = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %load_val = load i32, ptr %val1, align 4 + store i32 %load_val, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -define void @conditional_return(%conditional_return* %0) { +define void @conditional_return(ptr %0) { entry: - %this = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %this, align 8 - %__vtable = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 - %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 1 - %load_val = load i32, i32* %val, align 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 1 + %load_val = load i32, ptr %val, align 4 %tmpVar = icmp eq i32 %load_val, 5 br i1 %tmpVar, label %then_block, label %else_block @@ -51,49 +50,49 @@ then_block: ; preds = %entry ret void else_block: ; preds = %entry - store i32 10, i32* %val, align 4 + store i32 10, ptr %val, align 4 ret void } -define void @__init___vtable_conditional_return(%__vtable_conditional_return* %0) { +define void @__init___vtable_conditional_return(ptr %0) { entry: - %self = alloca %__vtable_conditional_return*, align 8 - store %__vtable_conditional_return* %0, %__vtable_conditional_return** %self, align 8 - %deref = load %__vtable_conditional_return*, %__vtable_conditional_return** %self, align 8 - %__body = getelementptr inbounds %__vtable_conditional_return, %__vtable_conditional_return* %deref, i32 0, i32 0 - store void (%conditional_return*)* @conditional_return, void (%conditional_return*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_conditional_return, ptr %deref, i32 0, i32 0 + store ptr @conditional_return, ptr %__body, align 8 ret void } -define void @__init_conditional_return(%conditional_return* %0) { +define void @__init_conditional_return(ptr %0) { entry: - %self = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %self, align 8 - %deref = load %conditional_return*, %conditional_return** %self, align 8 - %__vtable = getelementptr inbounds %conditional_return, %conditional_return* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_conditional_return* @__vtable_conditional_return_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %conditional_return, ptr %deref, i32 0, i32 0 + store ptr @__vtable_conditional_return_instance, ptr %__vtable, align 8 ret void } -define void @__user_init___vtable_conditional_return(%__vtable_conditional_return* %0) { +define void @__user_init___vtable_conditional_return(ptr %0) { entry: - %self = alloca %__vtable_conditional_return*, align 8 - store %__vtable_conditional_return* %0, %__vtable_conditional_return** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_conditional_return(%conditional_return* %0) { +define void @__user_init_conditional_return(ptr %0) { entry: - %self = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___plc() { entry: - call void @__init___vtable_conditional_return(%__vtable_conditional_return* @__vtable_conditional_return_instance) - call void @__user_init___vtable_conditional_return(%__vtable_conditional_return* @__vtable_conditional_return_instance) + call void @__init___vtable_conditional_return(ptr @__vtable_conditional_return_instance) + call void @__user_init___vtable_conditional_return(ptr @__vtable_conditional_return_instance) ret void } -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap index 57a6a546d0e..6969b30ffa9 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap @@ -4,10 +4,10 @@ expression: output_file_content_without_headers --- target triple = "[filtered]" -%__vtable_conditional_return = type { void (%conditional_return*)* } -%conditional_return = type { i32*, i32 } +%__vtable_conditional_return = type { ptr } +%conditional_return = type { ptr, i32 } -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] @____vtable_conditional_return__init = unnamed_addr constant %__vtable_conditional_return zeroinitializer @__conditional_return__init = unnamed_addr constant %conditional_return zeroinitializer @__vtable_conditional_return_instance = global %__vtable_conditional_return zeroinitializer @@ -17,33 +17,32 @@ entry: %main = alloca i32, align 4 %my_val = alloca i32, align 4 %conditional = alloca %conditional_return, align 8 - store i32 5, i32* %my_val, align 4 - %0 = bitcast %conditional_return* %conditional to i8* - call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%conditional_return* @__conditional_return__init to i8*), i64 ptrtoint (%conditional_return* getelementptr (%conditional_return, %conditional_return* null, i32 1) to i64), i1 false) - store i32 0, i32* %main, align 4 - call void @__init_conditional_return(%conditional_return* %conditional) - call void @__user_init_conditional_return(%conditional_return* %conditional) - %val = getelementptr inbounds %conditional_return, %conditional_return* %conditional, i32 0, i32 1 - %load_my_val = load i32, i32* %my_val, align 4 - store i32 %load_my_val, i32* %val, align 4 - call void @conditional_return(%conditional_return* %conditional) - %val1 = getelementptr inbounds %conditional_return, %conditional_return* %conditional, i32 0, i32 1 - %load_val = load i32, i32* %val1, align 4 - store i32 %load_val, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 5, ptr %my_val, align 4 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %conditional, ptr align 1 @__conditional_return__init, i64 ptrtoint (ptr getelementptr (%conditional_return, ptr null, i32 1) to i64), i1 false) + store i32 0, ptr %main, align 4 + call void @__init_conditional_return(ptr %conditional) + call void @__user_init_conditional_return(ptr %conditional) + %val = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %load_my_val = load i32, ptr %my_val, align 4 + store i32 %load_my_val, ptr %val, align 4 + call void @conditional_return(ptr %conditional) + %val1 = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %load_val = load i32, ptr %val1, align 4 + store i32 %load_val, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } -; Function Attrs: argmemonly nofree nounwind willreturn -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0 +; Function Attrs: argmemonly nocallback nofree nounwind willreturn +declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -define void @conditional_return(%conditional_return* %0) { +define void @conditional_return(ptr %0) { entry: - %this = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %this, align 8 - %__vtable = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 0 - %val = getelementptr inbounds %conditional_return, %conditional_return* %0, i32 0, i32 1 - %load_val = load i32, i32* %val, align 4 + %this = alloca ptr, align 8 + store ptr %0, ptr %this, align 8 + %__vtable = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 1 + %load_val = load i32, ptr %val, align 4 %tmpVar = icmp eq i32 %load_val, 5 %tmpVar1 = xor i1 %tmpVar, true br i1 %tmpVar1, label %then_block, label %else_block @@ -52,49 +51,49 @@ then_block: ; preds = %entry ret void else_block: ; preds = %entry - store i32 10, i32* %val, align 4 + store i32 10, ptr %val, align 4 ret void } -define void @__init___vtable_conditional_return(%__vtable_conditional_return* %0) { +define void @__init___vtable_conditional_return(ptr %0) { entry: - %self = alloca %__vtable_conditional_return*, align 8 - store %__vtable_conditional_return* %0, %__vtable_conditional_return** %self, align 8 - %deref = load %__vtable_conditional_return*, %__vtable_conditional_return** %self, align 8 - %__body = getelementptr inbounds %__vtable_conditional_return, %__vtable_conditional_return* %deref, i32 0, i32 0 - store void (%conditional_return*)* @conditional_return, void (%conditional_return*)** %__body, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__body = getelementptr inbounds %__vtable_conditional_return, ptr %deref, i32 0, i32 0 + store ptr @conditional_return, ptr %__body, align 8 ret void } -define void @__init_conditional_return(%conditional_return* %0) { +define void @__init_conditional_return(ptr %0) { entry: - %self = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %self, align 8 - %deref = load %conditional_return*, %conditional_return** %self, align 8 - %__vtable = getelementptr inbounds %conditional_return, %conditional_return* %deref, i32 0, i32 0 - store i32* bitcast (%__vtable_conditional_return* @__vtable_conditional_return_instance to i32*), i32** %__vtable, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 + %deref = load ptr, ptr %self, align 8 + %__vtable = getelementptr inbounds %conditional_return, ptr %deref, i32 0, i32 0 + store ptr @__vtable_conditional_return_instance, ptr %__vtable, align 8 ret void } -define void @__user_init___vtable_conditional_return(%__vtable_conditional_return* %0) { +define void @__user_init___vtable_conditional_return(ptr %0) { entry: - %self = alloca %__vtable_conditional_return*, align 8 - store %__vtable_conditional_return* %0, %__vtable_conditional_return** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_conditional_return(%conditional_return* %0) { +define void @__user_init_conditional_return(ptr %0) { entry: - %self = alloca %conditional_return*, align 8 - store %conditional_return* %0, %conditional_return** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___plc() { entry: - call void @__init___vtable_conditional_return(%__vtable_conditional_return* @__vtable_conditional_return_instance) - call void @__user_init___vtable_conditional_return(%__vtable_conditional_return* @__vtable_conditional_return_instance) + call void @__init___vtable_conditional_return(ptr @__vtable_conditional_return_instance) + call void @__user_init___vtable_conditional_return(ptr @__vtable_conditional_return_instance) ret void } -attributes #0 = { argmemonly nofree nounwind willreturn } +attributes #0 = { argmemonly nocallback nofree nounwind willreturn } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap index 5079d6481e2..dbd4bf9dab8 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap @@ -1,56 +1,55 @@ --- source: tests/integration/cfc.rs expression: output_file_content_without_headers -snapshot_kind: text --- target triple = "[filtered]" %foo = type { i32 } -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] @foo_instance = global %foo zeroinitializer, !dbg !0 -define void @foo(%foo* %0) !dbg !11 { +define void @foo(ptr %0) !dbg !11 { entry: - call void @llvm.dbg.declare(metadata %foo* %0, metadata !15, metadata !DIExpression()), !dbg !16 - %val = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 + call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !16 + %val = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 br label %lbl, !dbg !17 lbl: ; preds = %lbl, %entry - %load_val = load i32, i32* %val, align 4, !dbg !16 + %load_val = load i32, ptr %val, align 4, !dbg !16 %tmpVar = icmp eq i32 %load_val, 0, !dbg !16 br i1 %tmpVar, label %lbl, label %else_block, !dbg !18 else_block: ; preds = %lbl - store i32 1, i32* %val, align 4, !dbg !19 + store i32 1, ptr %val, align 4, !dbg !19 ret void, !dbg !20 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -define void @__init_foo(%foo* %0) { +define void @__init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_foo(%foo* %0) { +define void @__user_init_foo(ptr %0) { entry: - %self = alloca %foo*, align 8 - store %foo* %0, %foo** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___plc() { entry: - call void @__init_foo(%foo* @foo_instance) - call void @__user_init_foo(%foo* @foo_instance) + call void @__init_foo(ptr @foo_instance) + call void @__user_init_foo(ptr @foo_instance) ret void } -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap index 8703789d524..c1c92ce6770 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_false.snap @@ -1,35 +1,34 @@ --- source: tests/integration/cfc.rs expression: output_file_content_without_headers -snapshot_kind: text --- target triple = "[filtered]" -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] define i32 @main() { entry: %main = alloca i32, align 4 %x = alloca i8, align 1 %a = alloca i32, align 4 - store i8 0, i8* %x, align 1 - store i32 0, i32* %a, align 4 - store i32 0, i32* %main, align 4 - store i8 0, i8* %x, align 1 - %load_x = load i8, i8* %x, align 1 + store i8 0, ptr %x, align 1 + store i32 0, ptr %a, align 4 + store i32 0, ptr %main, align 4 + store i8 0, ptr %x, align 1 + %load_x = load i8, ptr %x, align 1 br i8 %load_x, label %lbl, label %else_block else_block: ; preds = %entry - store i32 2, i32* %a, align 4 + store i32 2, ptr %a, align 4 br label %lbl lbl: ; preds = %else_block, %entry - %load_a = load i32, i32* %a, align 4 + %load_a = load i32, ptr %a, align 4 %tmpVar = add i32 %load_a, 3 - store i32 %tmpVar, i32* %a, align 4 - %load_a1 = load i32, i32* %a, align 4 - store i32 %load_a1, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 %tmpVar, ptr %a, align 4 + %load_a1 = load i32, ptr %a, align 4 + store i32 %load_a1, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap index c5fa1c00a80..da083d9f752 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_to_label_with_true.snap @@ -1,35 +1,34 @@ --- source: tests/integration/cfc.rs expression: output_file_content_without_headers -snapshot_kind: text --- target triple = "[filtered]" -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] define i32 @main() { entry: %main = alloca i32, align 4 %x = alloca i8, align 1 %a = alloca i32, align 4 - store i8 0, i8* %x, align 1 - store i32 0, i32* %a, align 4 - store i32 0, i32* %main, align 4 - store i8 1, i8* %x, align 1 - %load_x = load i8, i8* %x, align 1 + store i8 0, ptr %x, align 1 + store i32 0, ptr %a, align 4 + store i32 0, ptr %main, align 4 + store i8 1, ptr %x, align 1 + %load_x = load i8, ptr %x, align 1 br i8 %load_x, label %lbl, label %else_block else_block: ; preds = %entry - store i32 2, i32* %a, align 4 + store i32 2, ptr %a, align 4 br label %lbl lbl: ; preds = %else_block, %entry - %load_a = load i32, i32* %a, align 4 + %load_a = load i32, ptr %a, align 4 %tmpVar = add i32 %load_a, 3 - store i32 %tmpVar, i32* %a, align 4 - %load_a1 = load i32, i32* %a, align 4 - store i32 %load_a1, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 %tmpVar, ptr %a, align 4 + %load_a1 = load i32, ptr %a, align 4 + store i32 %load_a1, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap index fb480bfabf9..7c0a00d59ee 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap @@ -1,48 +1,47 @@ --- source: tests/integration/cfc.rs expression: output_file_content_without_headers -snapshot_kind: text --- target triple = "[filtered]" %main = type { i32 } -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] @main_instance = global %main zeroinitializer, !dbg !0 -define void @main(%main* %0) !dbg !11 { +define void @main(ptr %0) !dbg !11 { entry: - call void @llvm.dbg.declare(metadata %main* %0, metadata !15, metadata !DIExpression()), !dbg !16 - %x = getelementptr inbounds %main, %main* %0, i32 0, i32 0 - store i32 5, i32* %x, align 4, !dbg !17 + call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !16 + %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + store i32 5, ptr %x, align 4, !dbg !17 ret void, !dbg !18 } -; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -define void @__init_main(%main* %0) { +define void @__init_main(ptr %0) { entry: - %self = alloca %main*, align 8 - store %main* %0, %main** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } -define void @__user_init_main(%main* %0) { +define void @__user_init_main(ptr %0) { entry: - %self = alloca %main*, align 8 - store %main* %0, %main** %self, align 8 + %self = alloca ptr, align 8 + store ptr %0, ptr %self, align 8 ret void } define void @__init___plc() { entry: - call void @__init_main(%main* @main_instance) - call void @__user_init_main(%main* @main_instance) + call void @__init_main(ptr @main_instance) + call void @__user_init_main(ptr @main_instance) ret void } -attributes #0 = { nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap b/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap index ba1b24a31e2..de90fcff0e2 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__variable_source_to_variable_and_block_sink.snap @@ -1,22 +1,21 @@ --- source: tests/integration/cfc.rs expression: output_file_content_without_headers -snapshot_kind: text --- target triple = "[filtered]" -@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___plc, i8* null }] +@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___plc, ptr null }] define i32 @main() { entry: %main = alloca i32, align 4 %value = alloca i32, align 4 - store i32 2, i32* %value, align 4 - store i32 0, i32* %main, align 4 - %load_value = load i32, i32* %value, align 4 + store i32 2, ptr %value, align 4 + store i32 0, ptr %main, align 4 + %load_value = load i32, ptr %value, align 4 %call = call i32 @myConnection(i32 %load_value) - store i32 %call, i32* %main, align 4 - %main_ret = load i32, i32* %main, align 4 + store i32 %call, ptr %main, align 4 + %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret } @@ -24,15 +23,15 @@ define i32 @myAdd(i32 %0, i32 %1) { entry: %myAdd = alloca i32, align 4 %a = alloca i32, align 4 - store i32 %0, i32* %a, align 4 + store i32 %0, ptr %a, align 4 %b = alloca i32, align 4 - store i32 %1, i32* %b, align 4 - store i32 0, i32* %myAdd, align 4 - %load_a = load i32, i32* %a, align 4 - %load_b = load i32, i32* %b, align 4 + store i32 %1, ptr %b, align 4 + store i32 0, ptr %myAdd, align 4 + %load_a = load i32, ptr %a, align 4 + %load_b = load i32, ptr %b, align 4 %tmpVar = add i32 %load_a, %load_b - store i32 %tmpVar, i32* %myAdd, align 4 - %myAdd_ret = load i32, i32* %myAdd, align 4 + store i32 %tmpVar, ptr %myAdd, align 4 + %myAdd_ret = load i32, ptr %myAdd, align 4 ret i32 %myAdd_ret } @@ -40,17 +39,17 @@ define i32 @myConnection(i32 %0) { entry: %myConnection = alloca i32, align 4 %x = alloca i32, align 4 - store i32 %0, i32* %x, align 4 + store i32 %0, ptr %x, align 4 %y = alloca i32, align 4 - store i32 0, i32* %y, align 4 - store i32 0, i32* %myConnection, align 4 - %load_x = load i32, i32* %x, align 4 - store i32 %load_x, i32* %y, align 4 - %load_y = load i32, i32* %y, align 4 - %load_x1 = load i32, i32* %x, align 4 + store i32 0, ptr %y, align 4 + store i32 0, ptr %myConnection, align 4 + %load_x = load i32, ptr %x, align 4 + store i32 %load_x, ptr %y, align 4 + %load_y = load i32, ptr %y, align 4 + %load_x1 = load i32, ptr %x, align 4 %call = call i32 @myAdd(i32 %load_y, i32 %load_x1) - store i32 %call, i32* %myConnection, align 4 - %myConnection_ret = load i32, i32* %myConnection, align 4 + store i32 %call, ptr %myConnection, align 4 + %myConnection_ret = load i32, ptr %myConnection, align 4 ret i32 %myConnection_ret } diff --git a/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap b/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap index f151ac3254d..3a02485678a 100644 --- a/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap +++ b/tests/integration/snapshots/tests__integration__command_line_compile__ir_generation_full_pass.snap @@ -1,6 +1,5 @@ --- source: tests/integration/command_line_compile.rs expression: content -snapshot_kind: text --- -target datalayout = "[filtered]"@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__init___command_line_st, i8* null }]define void @__init___command_line_st() {entry: ret void}define i32 @myFunc(i32 %0, i32 %1, i32 %2) {entry: %myFunc = alloca i32, align 4 %a = alloca i32, align 4 store i32 %0, i32* %a, align 4 %b = alloca i32, align 4 store i32 %1, i32* %b, align 4 %c = alloca i32, align 4 store i32 %2, i32* %c, align 4 store i32 0, i32* %myFunc, align 4 %myFunc_ret = load i32, i32* %myFunc, align 4 ret i32 %myFunc_ret} +target datalayout = "[filtered]"@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @__init___command_line_st, ptr null }]define void @__init___command_line_st() {entry: ret void}define i32 @myFunc(i32 %0, i32 %1, i32 %2) {entry: %myFunc = alloca i32, align 4 %a = alloca i32, align 4 store i32 %0, ptr %a, align 4 %b = alloca i32, align 4 store i32 %1, ptr %b, align 4 %c = alloca i32, align 4 store i32 %2, ptr %c, align 4 store i32 0, ptr %myFunc, align 4 %myFunc_ret = load i32, ptr %myFunc, align 4 ret i32 %myFunc_ret} diff --git a/tests/lit/lit.cfg b/tests/lit/lit.cfg index 6b07c4aa42a..4dfedc3eba3 100644 --- a/tests/lit/lit.cfg +++ b/tests/lit/lit.cfg @@ -17,4 +17,4 @@ print(f'Compile command: {compile}') config.substitutions.append(('%COMPILE', f'{compile}')) config.substitutions.append(('%RUN', f'LD_LIBRARY_PATH="{stdlibLocation}/lib" /tmp/%basename_t.out')) -config.substitutions.append(('%CHECK', f'FileCheck-14 --check-prefixes CHECK --allow-unused-prefixes --match-full-lines')) \ No newline at end of file +config.substitutions.append(('%CHECK', f'FileCheck-15 --check-prefixes CHECK --allow-unused-prefixes --match-full-lines')) From f4b5ed10bcc8b95b4a2191aed26ad8e99e393e36 Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Wed, 10 Dec 2025 09:52:04 +0100 Subject: [PATCH 2/8] chore: update to LLVM 16 --- Cargo.lock | 4 +- Cargo.toml | 2 +- Makefile | 2 +- ...n_different_locations_with_debug_info.snap | 8 +- ...files__multiple_files_with_debug_info.snap | 8 +- src/codegen/tests/code_gen_tests.rs | 8 +- src/codegen/tests/debug_tests.rs | 58 ++++++------ ...ate_return_value_variable_in_function.snap | 8 +- ...rray_size_correctly_set_in_dwarf_info.snap | 8 +- ...g__assignment_statement_have_location.snap | 4 +- ...ging__case_conditions_location_marked.snap | 4 +- ...bugging__exit_statement_have_location.snap | 4 +- ...gging__for_conditions_location_marked.snap | 4 +- ...bugging__function_calls_have_location.snap | 4 +- ...on_calls_in_expressions_have_location.snap | 4 +- ...ugging__if_conditions_location_marked.snap | 4 +- ...g__implementation_added_as_subroutine.snap | 4 +- ...g__nested_function_calls_get_location.snap | 4 +- ...callable_expressions_have_no_location.snap | 4 +- ...on_function_pous_have_struct_as_param.snap | 4 +- ...ng__repeat_conditions_location_marked.snap | 4 +- ...gging__return_statement_have_location.snap | 4 +- ...temp_variables_in_pous_added_as_local.snap | 4 +- ...out_inout_in_function_added_as_params.snap | 4 +- ...ing__while_conditions_location_marked.snap | 4 +- src/codegen/tests/directaccess_test.rs | 16 ++-- src/codegen/tests/fnptr.rs | 30 +++---- .../complex_initializers.rs | 12 +-- ...initializer_gets_declared_initializer.snap | 4 +- ..._initializer_gets_default_initializer.snap | 8 +- ..._class_struct_initialized_in_function.snap | 4 +- ...ues_for_not_initialized_function_vars.snap | 4 +- ..._block_struct_initialized_in_function.snap | 4 +- ..._is_initialized_with_type_initializer.snap | 4 +- ...lizers__initialized_array_in_function.snap | 4 +- ...s__initialized_array_type_in_function.snap | 4 +- ...for_struct_initialization_in_function.snap | 4 +- src/codegen/tests/oop_tests.rs | 22 ++--- src/codegen/tests/oop_tests/debug_tests.rs | 50 +++++------ src/codegen/tests/oop_tests/super_tests.rs | 8 +- src/codegen/tests/parameters_tests.rs | 90 +++++++++---------- src/codegen/tests/polymorphism.rs | 4 +- ...ues_for_not_initialized_function_vars.snap | 4 +- ...ts__method_with_aggregate_return_type.snap | 10 +-- ...s__code_gen_tests__methods_var_output.snap | 10 +-- ..._program_with_special_chars_in_string.snap | 4 +- ...tests__program_with_string_assignment.snap | 4 +- ...uctions_tests__string_comparison_test.snap | 8 +- ...ests__string_equal_with_constant_test.snap | 8 +- ...g_greater_or_equal_with_constant_test.snap | 8 +- ...ts__string_greater_with_constant_test.snap | 8 +- ...tests__string_less_with_constant_test.snap | 8 +- ...__string_not_equal_with_constant_test.snap | 8 +- ...g_smaller_or_equal_with_constant_test.snap | 8 +- ...tests__assigning_const_array_variable.snap | 4 +- ...ests__assigning_const_string_variable.snap | 4 +- ...ests__assigning_const_struct_variable.snap | 4 +- ..._test__qualified_reference_assignment.snap | 4 +- ...function_call_mux_with_aggregate_type.snap | 4 +- ...s__calling_strings_in_function_return.snap | 8 +- ...ion_tests__strings_in_function_return.snap | 4 +- ...ests__argument_fed_by_ref_then_by_val.snap | 8 +- ...ests__function_call_with_array_access.snap | 4 +- ...literal_string_argument_passed_by_ref.snap | 8 +- ...tests__passing_a_string_to_a_function.snap | 8 +- ...generic_codegen_with_aggregate_return.snap | 8 +- ...eneric_function_with_aggregate_return.snap | 4 +- ...n_result_assignment_on_aliased_string.snap | 10 +-- ..._function_result_assignment_on_string.snap | 10 +-- ..._casted_string_assignment_uses_memcpy.snap | 4 +- ...g_generic_string_should_return_by_ref.snap | 8 +- ...ts__function_returns_a_literal_string.snap | 8 +- ...es_string_paramter_and_returns_string.snap | 10 +-- ...rings_should_be_collected_as_literals.snap | 6 +- ...__string_tests__program_string_output.snap | 4 +- ...program_with_casted_string_assignment.snap | 4 +- ...__program_with_string_type_assignment.snap | 4 +- ...ing_tests__string_function_parameters.snap | 10 +-- ...stant_var_string_should_be_memcpyable.snap | 8 +- ...ar_string_should_be_memcpyable_nonref.snap | 8 +- ...ariable_length_strings_can_be_created.snap | 4 +- ...trings_using_constants_can_be_created.snap | 4 +- ...ests__variable_string_assignment_test.snap | 4 +- ...string_tests__vartmp_string_init_test.snap | 8 +- ...ariadic_functions_without_declaration.snap | 4 +- ...e_calls_with_differently_sized_arrays.snap | 8 +- ...al_variable_passed_to_function_as_vla.snap | 4 +- ...ruct_is_generated_for_call_statements.snap | 8 +- ...sts__vla_tests__multi_dimensional_vla.snap | 8 +- ...en__tests__vla_tests__vla_read_access.snap | 8 +- ..._vla_tests__vla_read_access_with_expr.snap | 8 +- ..._vla_tests__vla_read_access_with_lint.snap | 8 +- ...__vla_tests__vla_read_access_with_var.snap | 8 +- src/codegen/tests/statement_codegen_test.rs | 8 +- src/tests/adr/arrays_adr.rs | 4 +- src/tests/adr/initializer_functions_adr.rs | 4 +- src/tests/adr/pou_adr.rs | 16 ++-- src/tests/adr/strings_adr.rs | 8 +- src/tests/adr/structs_adr.rs | 4 +- src/tests/adr/vla_adr.rs | 4 +- ...__integration__cfc__ir__actions_debug.snap | 4 +- ...on__cfc__ir__conditional_return_debug.snap | 4 +- ...r__conditional_return_evaluating_true.snap | 4 +- ...tional_return_evaluating_true_negated.snap | 4 +- ...sts__integration__cfc__ir__jump_debug.snap | 4 +- ...tegration__cfc__ir__sink_source_debug.snap | 4 +- 106 files changed, 426 insertions(+), 426 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29e2d9b7414..643298ab7a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2158,9 +2158,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "llvm-sys" -version = "150.2.1" +version = "160.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa55828745895d37233756307ded95a235b058aeb89cd12717ec7c3912089ee9" +checksum = "e73861901245d32e1c3d8b35b639cf100859b4cd0c9da56fe0273040acbb3ea4" dependencies = [ "cc", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index 09ae4704a25..0973cac4cdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.6", features = ["llvm15-0"] } +inkwell = { version = "0.6", features = ["llvm16-0"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" diff --git a/Makefile b/Makefile index fd5e4a4735b..ed8aab2a7b3 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ test: @clear - cargo nextest run --no-fail-fast --workspace + cargo nextest run --no-fail-fast --workspace && ./scripts/build.sh --lit report: @clear diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap index 5b6a728b830..679b5af52bd 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap @@ -23,10 +23,10 @@ entry: declare !dbg !14 void @mainProg(ptr) -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -66,10 +66,10 @@ entry: ret void, !dbg !14 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap index aaf81d6074b..532342ab4b6 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap @@ -23,10 +23,10 @@ entry: declare !dbg !14 void @mainProg(ptr) -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -66,10 +66,10 @@ entry: ret void, !dbg !14 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} diff --git a/src/codegen/tests/code_gen_tests.rs b/src/codegen/tests/code_gen_tests.rs index f6e7f82185d..f434d7e393f 100644 --- a/src/codegen/tests/code_gen_tests.rs +++ b/src/codegen/tests/code_gen_tests.rs @@ -1155,10 +1155,10 @@ fn fb_method_called_locally() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) } @@ -1245,10 +1245,10 @@ fn fb_local_method_var_shadows_parent_var() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) } diff --git a/src/codegen/tests/debug_tests.rs b/src/codegen/tests/debug_tests.rs index 285a448ef5a..198c1b9667f 100644 --- a/src/codegen/tests/debug_tests.rs +++ b/src/codegen/tests/debug_tests.rs @@ -293,7 +293,7 @@ fn switch_case_debug_info() { br label %condition_check, !dbg !18 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___Test() { @@ -301,7 +301,7 @@ fn switch_case_debug_info() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -383,7 +383,7 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { ret void, !dbg !22 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___vtable_fb(ptr %0) { @@ -430,7 +430,7 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!10, !11} !llvm.dbg.cu = !{!12} @@ -530,7 +530,7 @@ fn action_with_var_temp() { ret void, !dbg !31 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_plc_prg(ptr %0) { @@ -554,7 +554,7 @@ fn action_with_var_temp() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -719,16 +719,16 @@ END_FUNCTION ret void, !dbg !65 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 define void @__init_struct_(ptr %0) { @@ -794,9 +794,9 @@ END_FUNCTION ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } - attributes #2 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!35, !36} !llvm.dbg.cu = !{!37} @@ -936,7 +936,7 @@ fn constants_are_tagged_as_such() { ret i32 %bar_ret, !dbg !45 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_foo(ptr %0) { @@ -976,7 +976,7 @@ fn constants_are_tagged_as_such() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -1173,7 +1173,7 @@ fn test_debug_info_auto_deref_parameters() { ret void, !dbg !46 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_mystruct(ptr %0) { @@ -1211,7 +1211,7 @@ fn test_debug_info_auto_deref_parameters() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!37, !38} !llvm.dbg.cu = !{!39} @@ -1400,7 +1400,7 @@ fn test_debug_info_mixed_pointer_types() { ret void, !dbg !43 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_mixed_ptr(ptr %0) { @@ -1425,7 +1425,7 @@ fn test_debug_info_mixed_pointer_types() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1530,7 +1530,7 @@ fn test_debug_info_auto_deref_reference_to_pointers() { ret void, !dbg !59 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_mystruct(ptr %0) { @@ -1568,7 +1568,7 @@ fn test_debug_info_auto_deref_reference_to_pointers() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!50, !51} !llvm.dbg.cu = !{!52} @@ -1676,7 +1676,7 @@ fn range_datatype_debug() { ret i32 %main_ret, !dbg !16 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___Test() { @@ -1684,7 +1684,7 @@ fn range_datatype_debug() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -1754,7 +1754,7 @@ fn range_datatype_reference_expr_bounds_debug() { ret i32 %main_ret, !dbg !20 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___Test() { @@ -1762,7 +1762,7 @@ fn range_datatype_reference_expr_bounds_debug() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -1828,7 +1828,7 @@ fn range_datatype_fqn_reference_bounds_debug() { ret void, !dbg !19 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_prog(ptr %0) { @@ -1852,7 +1852,7 @@ fn range_datatype_fqn_reference_bounds_debug() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!10, !11} !llvm.dbg.cu = !{!12} @@ -1921,7 +1921,7 @@ fn range_datatype_debug_alias_reused() { ret void, !dbg !21 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_prog(ptr %0) { @@ -1945,7 +1945,7 @@ fn range_datatype_debug_alias_reused() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!12, !13} !llvm.dbg.cu = !{!14} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap index 7b746b4c470..047b5c413e9 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap @@ -19,14 +19,14 @@ entry: ret void, !dbg !19 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap index 35a9d2c4e81..4efb47a899c 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap @@ -19,14 +19,14 @@ entry: ret i32 %foo_ret, !dbg !17 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap index 544a15d4dad..62080071e1a 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap @@ -17,10 +17,10 @@ entry: ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap index 07025be71f8..d2782f48726 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap @@ -36,10 +36,10 @@ continue: ; preds = %else, %case1, %case ret i32 %myFunc_ret, !dbg !19 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap index 5395e3b368f..de2268792b9 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap @@ -35,10 +35,10 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap index 869d1ae4858..b17027ae8db 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap @@ -40,10 +40,10 @@ continue: ; preds = %predicate_sge, %pre ret i32 %myFunc_ret, !dbg !15 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap index 2a2f4e585e0..916387a0d8f 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap @@ -17,10 +17,10 @@ entry: ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap index a64348845ca..681b1b121b8 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap @@ -18,10 +18,10 @@ entry: ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap index c9e3cc07651..10233dfafa3 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap @@ -35,10 +35,10 @@ continue: ; preds = %else, %condition_bo ret i32 %myFunc_ret, !dbg !19 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap index 8747b01598e..aca50fce04d 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap @@ -36,10 +36,10 @@ entry: ret void, !dbg !30 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!9, !10} !llvm.dbg.cu = !{!11} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap index d6e5a35af88..a1b7495e5c4 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap @@ -21,10 +21,10 @@ entry: ret i32 %myFunc_ret, !dbg !16 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap index f724d10003a..e4563647dd5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap @@ -17,10 +17,10 @@ entry: ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap index 43b7e967264..b31fef717c5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap @@ -35,10 +35,10 @@ entry: ret void, !dbg !30 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!13, !14} !llvm.dbg.cu = !{!15} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap index 027b8f979f1..56a91d42f38 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap @@ -40,10 +40,10 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap index dcb5d17777a..1f7c6768bce 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap @@ -20,10 +20,10 @@ buffer_block: ; No predecessors! ret i32 %myFunc_ret1, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap index 07a3241524f..e8cc13272a5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap @@ -63,10 +63,10 @@ entry: ret void, !dbg !42 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!9, !10} !llvm.dbg.cu = !{!11} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap index 1ec837ab299..88184dc1769 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap @@ -24,10 +24,10 @@ entry: ret i32 %myFunc_ret, !dbg !18 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap index 891f290dc2b..258793709ee 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap @@ -41,10 +41,10 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/directaccess_test.rs b/src/codegen/tests/directaccess_test.rs index 2378647b054..58faa8184d5 100644 --- a/src/codegen/tests/directaccess_test.rs +++ b/src/codegen/tests/directaccess_test.rs @@ -217,10 +217,10 @@ fn direct_acess_in_output_assignment_implicit_explicit_and_mixed() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -283,10 +283,10 @@ fn direct_acess_in_output_assignment_with_simple_expression() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -349,10 +349,10 @@ fn direct_acess_in_output_assignment_with_simple_expression_implicit() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -442,9 +442,9 @@ fn direct_acess_in_output_assignment_with_complexe_expression() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/codegen/tests/fnptr.rs b/src/codegen/tests/fnptr.rs index c5d126fa842..a76aeda0d8b 100644 --- a/src/codegen/tests/fnptr.rs +++ b/src/codegen/tests/fnptr.rs @@ -56,10 +56,10 @@ fn function_pointer_method_no_parameters() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -121,10 +121,10 @@ fn function_pointer_method_with_return_type() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -216,17 +216,17 @@ fn function_pointer_method_with_return_type_aggregate() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); } @@ -317,14 +317,14 @@ fn function_pointer_method_with_all_variable_parameter_types() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); } @@ -411,10 +411,10 @@ fn function_block_body() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/codegen/tests/initialization_test/complex_initializers.rs b/src/codegen/tests/initialization_test/complex_initializers.rs index 52ed1cc1926..ac75476bacd 100644 --- a/src/codegen/tests/initialization_test/complex_initializers.rs +++ b/src/codegen/tests/initialization_test/complex_initializers.rs @@ -852,7 +852,7 @@ fn user_init_called_for_variables_on_stack() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { @@ -901,7 +901,7 @@ fn user_init_called_for_variables_on_stack() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -2193,7 +2193,7 @@ fn temporary_variable_ref_to_temporary_variable() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 define void @__init___Test() { @@ -2201,7 +2201,7 @@ fn temporary_variable_ref_to_temporary_variable() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#) } @@ -2883,7 +2883,7 @@ fn methods_call_init_functions_for_their_members() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { @@ -2971,7 +2971,7 @@ fn methods_call_init_functions_for_their_members() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap index 1833b5faab2..acfffce7c8f 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap @@ -27,7 +27,7 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap index 18b1eb22864..dd70fa52db9 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap @@ -30,11 +30,11 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap index 723d02d09b7..8de963ffbd2 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap @@ -38,7 +38,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap index f9f3de75beb..f6e05137832 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap @@ -23,7 +23,7 @@ entry: ret i16 %func_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap index 9823693b393..48373738b8b 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap @@ -39,7 +39,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap index 2688a2cf9cd..bb73dfeeed8 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap @@ -34,7 +34,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap index 8d150aafb54..2fe04095af6 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap @@ -19,7 +19,7 @@ entry: ret i16 %func_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap index 1461a446685..29b2b8c23a2 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap @@ -19,7 +19,7 @@ entry: ret i16 %func_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap index ab467ffc588..bbc2f1fae2e 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap @@ -21,7 +21,7 @@ entry: ret i16 %func_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/oop_tests.rs b/src/codegen/tests/oop_tests.rs index e824392448f..6b8643f0438 100644 --- a/src/codegen/tests/oop_tests.rs +++ b/src/codegen/tests/oop_tests.rs @@ -439,13 +439,13 @@ fn write_to_parent_variable_in_instance() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { @@ -538,8 +538,8 @@ fn write_to_parent_variable_in_instance() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); } @@ -663,7 +663,7 @@ fn array_in_parent_generated() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 define void @__init___vtable_grandparent(ptr %0) { @@ -794,7 +794,7 @@ fn array_in_parent_generated() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); } @@ -1394,7 +1394,7 @@ fn pass_this_to_method() { ret i16 %FB_Test2__bar_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_fb_test(ptr %0) { @@ -1480,7 +1480,7 @@ fn pass_this_to_method() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -2503,7 +2503,7 @@ fn function_with_output_used_in_main_by_extension() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { @@ -2596,6 +2596,6 @@ fn function_with_output_used_in_main_by_extension() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/codegen/tests/oop_tests/debug_tests.rs b/src/codegen/tests/oop_tests/debug_tests.rs index 29d3ed8e16c..fabe05e263d 100644 --- a/src/codegen/tests/oop_tests/debug_tests.rs +++ b/src/codegen/tests/oop_tests/debug_tests.rs @@ -57,7 +57,7 @@ fn members_from_base_class_are_available_in_subclasses() { ret void, !dbg !42 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___vtable_foo(ptr %0) { @@ -144,7 +144,7 @@ fn members_from_base_class_are_available_in_subclasses() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -275,7 +275,7 @@ fn write_to_parent_variable_qualified_access() { ret void, !dbg !48 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___vtable_fb(ptr %0) { @@ -404,7 +404,7 @@ fn write_to_parent_variable_qualified_access() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -557,16 +557,16 @@ fn write_to_parent_variable_in_instance() { ret void, !dbg !52 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 define void @__init___vtable_foo(ptr %0) { @@ -659,9 +659,9 @@ fn write_to_parent_variable_in_instance() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } - attributes #2 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!22, !23} !llvm.dbg.cu = !{!24} @@ -846,10 +846,10 @@ fn array_in_parent_generated() { ret void, !dbg !65 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 define void @__init___vtable_grandparent(ptr %0) { @@ -980,8 +980,8 @@ fn array_in_parent_generated() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1162,7 +1162,7 @@ fn complex_array_access_generated() { ret void, !dbg !54 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___vtable_grandparent(ptr %0) { @@ -1293,7 +1293,7 @@ fn complex_array_access_generated() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1415,7 +1415,7 @@ fn function_block_method_debug_info() { ret void, !dbg !33 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___vtable_foo(ptr %0) { @@ -1508,7 +1508,7 @@ fn function_block_method_debug_info() { ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!16, !17} !llvm.dbg.cu = !{!18} @@ -1781,13 +1781,13 @@ END_FUNCTION ret i32 %main_ret, !dbg !93 } - ; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 define void @__init___vtable_parent(ptr %0) { @@ -1918,9 +1918,9 @@ END_FUNCTION ret void } - attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } - attributes #2 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } !llvm.module.flags = !{!26, !27} !llvm.dbg.cu = !{!28} diff --git a/src/codegen/tests/oop_tests/super_tests.rs b/src/codegen/tests/oop_tests/super_tests.rs index aff334f152c..e82d534971b 100644 --- a/src/codegen/tests/oop_tests/super_tests.rs +++ b/src/codegen/tests/oop_tests/super_tests.rs @@ -1681,7 +1681,7 @@ fn super_as_function_parameter() { ret i16 %process_val_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_parent(ptr %0) { @@ -1771,7 +1771,7 @@ fn super_as_function_parameter() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -2706,7 +2706,7 @@ fn super_with_structured_types() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_parent(ptr %0) { @@ -2816,7 +2816,7 @@ fn super_with_structured_types() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index ba6b10f698d..d82b0940f0a 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -735,14 +735,14 @@ fn by_value_function_arg_builtin_type_strings_are_memcopied() { ret i32 %foo_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -793,14 +793,14 @@ fn by_value_function_arg_user_type_strings_are_memcopied() { ret i32 %foo_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -850,14 +850,14 @@ fn by_value_function_arg_arrays_are_memcopied() { ret i32 %foo_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -917,10 +917,10 @@ fn by_value_function_arg_structs_are_memcopied() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -989,10 +989,10 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -1056,17 +1056,17 @@ fn by_value_fb_arg_aggregates_are_memcopied() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -1151,13 +1151,13 @@ fn var_output_aggregate_types_are_memcopied() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -1212,14 +1212,14 @@ fn array_of_string_parameter_with_stride_calculation() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#) } @@ -1283,10 +1283,10 @@ fn array_of_array_integer_parameter_with_stride_calculation() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#) } @@ -1342,14 +1342,14 @@ fn mixed_string_lengths_parameter_compatibility() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#) } @@ -1413,10 +1413,10 @@ fn program_with_array_of_string_parameter_stride_calculation() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) } @@ -1556,10 +1556,10 @@ fn method_with_var_in_out_array_of_strings() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) } @@ -1726,10 +1726,10 @@ fn method_with_mixed_array_types() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) } @@ -1860,16 +1860,16 @@ fn function_with_array_of_array_return() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/codegen/tests/polymorphism.rs b/src/codegen/tests/polymorphism.rs index fc2e3d7a057..e247c76d274 100644 --- a/src/codegen/tests/polymorphism.rs +++ b/src/codegen/tests/polymorphism.rs @@ -145,7 +145,7 @@ fn simple_overridden_method() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_a(ptr %0) { @@ -238,7 +238,7 @@ fn simple_overridden_method() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap index 88494b8f2f6..6e2b7e9ca65 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap @@ -23,7 +23,7 @@ entry: ret i16 %func_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap index c38df8c1475..1bf154b9c9a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap @@ -40,14 +40,14 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap index e632a948929..58818a0bc58 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap @@ -41,14 +41,14 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap index c4f3214c17c..dc4549c68ae 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap @@ -28,7 +28,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap index 532ea6ba044..88b04a84a0d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap @@ -22,7 +22,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap index f2895a770fb..0fe152bb878 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap @@ -42,11 +42,11 @@ entry: ret i16 %baz_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap index 50456f10aa7..73de2394330 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap @@ -42,11 +42,11 @@ entry: ret i16 %baz_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap index 67c2ebe6d20..adfc1e51e28 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap @@ -64,11 +64,11 @@ entry: ret i16 %baz_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap index 2c34cd23396..c912abd138b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap @@ -37,11 +37,11 @@ entry: ret i16 %baz_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap index 223d63ee679..744a0359d6d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap @@ -37,11 +37,11 @@ entry: ret i16 %baz_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap index 694618d8f6e..f305ba18cc6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap @@ -40,11 +40,11 @@ entry: ret i16 %baz_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap index 84f67d3e707..eb3ff346998 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap @@ -64,11 +64,11 @@ entry: ret i16 %baz_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap index f9cd99b11a8..b2a21d167d6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap @@ -19,7 +19,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap index 97c2af33b75..f3e9a74deca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap @@ -19,7 +19,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap index a42d25363b0..32548439569 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap @@ -21,7 +21,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap index 4f421f28e9f..caf445534f2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap @@ -31,7 +31,7 @@ entry: ret i16 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap index 5ec12cf9f7f..79ae8156740 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap @@ -47,7 +47,7 @@ continue_block: ; preds = %entry, %5, %4, %3, ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap index a05da8b50af..7f48234ffb5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap @@ -31,11 +31,11 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap index f982b848e72..df2a2268acc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap @@ -22,7 +22,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap index f909a97b1c2..34ce23cfc7a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap @@ -40,11 +40,11 @@ entry: ret i32 %fn_by_val_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap index 03af2c64f53..fac9fbf3fb1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap @@ -29,7 +29,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap index 69644891bbe..54873ba96fe 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap @@ -24,11 +24,11 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap index bd7445aac6a..b9c24bd4420 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap @@ -31,11 +31,11 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap index 130b62caa67..258c6e86ab1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap @@ -31,11 +31,11 @@ entry: declare void @MID__STRING(ptr, ptr, i32, i32) -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap index 028f6b374e8..08b261e1171 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap @@ -20,7 +20,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap index d049b98fd2d..93d0a46df00 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap @@ -27,14 +27,14 @@ entry: ret i8 %LIST_ADD_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap index d049b98fd2d..93d0a46df00 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap @@ -27,14 +27,14 @@ entry: ret i8 %LIST_ADD_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap index 3bd3d3e0767..e4af56d96d6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap @@ -24,7 +24,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap index f59ab48d42d..c8bf6cbe1b8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap @@ -38,11 +38,11 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap index 7ca1bfff202..978d83148f8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap @@ -31,11 +31,11 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap index aaebdcc194d..c593912f5da 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap @@ -34,14 +34,14 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap index 3ebc9f289a8..6bc03ab7617 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap @@ -26,10 +26,10 @@ entry: ret i64 %FSTRING_TO_DT_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap index 21cf612e42d..a5bb211e80c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap @@ -34,7 +34,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap index 5502ba12b7a..f4112f36b39 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap @@ -24,7 +24,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap index cac4c5c2a9c..7d3d8705e3e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap @@ -27,7 +27,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap index 6719647fbc9..445f0d05ee8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap @@ -39,14 +39,14 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap index 4ce9685a2ee..e8dd12bc444 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap @@ -44,11 +44,11 @@ continue: ; preds = %condition_body, %en ret i64 %FSTRING_TO_DT_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap index ea64aee7b06..db7fc849ade 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap @@ -46,11 +46,11 @@ continue: ; preds = %condition_body, %en ret i64 %FSTRING_TO_DT_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap index 9a0d0fd2749..e58c2c03730 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap @@ -26,7 +26,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap index cc8d239a95a..1856d2572f7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap @@ -28,7 +28,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap index acb997da913..b0d4e78cbd3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap @@ -21,7 +21,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap index e0567c84a81..7cab6157be2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap @@ -21,11 +21,11 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap index e943f57ca9a..cd1f75ee508 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap @@ -33,7 +33,7 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap index c67bdfc0cc1..311a3dda097 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap @@ -91,11 +91,11 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap index 10ddb5af928..50c148459be 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap @@ -50,7 +50,7 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap index 0a004ac677d..2eca19b5c8a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap @@ -36,11 +36,11 @@ entry: ret void } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap index 69880c99b1d..37ac74606fa 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap @@ -78,11 +78,11 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap index 525e98bc0e5..a13e2e0f1dc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap @@ -53,11 +53,11 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap index c47aecd0e37..0a2f384f047 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap @@ -57,11 +57,11 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap index 525e98bc0e5..a13e2e0f1dc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap @@ -53,11 +53,11 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap index 4489e428cf0..005ea7f7389 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap @@ -56,11 +56,11 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 -; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } -attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/statement_codegen_test.rs b/src/codegen/tests/statement_codegen_test.rs index 9ae7600a54e..bb15a7c4782 100644 --- a/src/codegen/tests/statement_codegen_test.rs +++ b/src/codegen/tests/statement_codegen_test.rs @@ -337,10 +337,10 @@ fn reference_to_string_assignment() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -402,10 +402,10 @@ fn local_string_alias() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); } diff --git a/src/tests/adr/arrays_adr.rs b/src/tests/adr/arrays_adr.rs index f60e653238d..49012a361c1 100644 --- a/src/tests/adr/arrays_adr.rs +++ b/src/tests/adr/arrays_adr.rs @@ -87,10 +87,10 @@ fn assigning_full_arrays() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/tests/adr/initializer_functions_adr.rs b/src/tests/adr/initializer_functions_adr.rs index b08addfdcc2..20f38761c93 100644 --- a/src/tests/adr/initializer_functions_adr.rs +++ b/src/tests/adr/initializer_functions_adr.rs @@ -992,7 +992,7 @@ fn intializing_temporary_variables() { ret i32 %main_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { @@ -1039,7 +1039,7 @@ fn intializing_temporary_variables() { ret void } - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) } diff --git a/src/tests/adr/pou_adr.rs b/src/tests/adr/pou_adr.rs index 9d2bc00bea1..9b3d5dac32c 100644 --- a/src/tests/adr/pou_adr.rs +++ b/src/tests/adr/pou_adr.rs @@ -537,14 +537,14 @@ fn return_a_complex_type_from_function() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); } @@ -623,14 +623,14 @@ fn passing_aggregate_types_to_functions_by_value() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } - attributes #1 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/tests/adr/strings_adr.rs b/src/tests/adr/strings_adr.rs index d5aa621ee75..489e28614c4 100644 --- a/src/tests/adr/strings_adr.rs +++ b/src/tests/adr/strings_adr.rs @@ -84,10 +84,10 @@ fn assigning_strings() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } @@ -128,9 +128,9 @@ fn assigning_string_literals() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/tests/adr/structs_adr.rs b/src/tests/adr/structs_adr.rs index df3fffdc9bb..84056b5ebe5 100644 --- a/src/tests/adr/structs_adr.rs +++ b/src/tests/adr/structs_adr.rs @@ -162,10 +162,10 @@ fn assigning_structs() { ret void } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); } diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index 3d9a76c9c87..9910c68f9b7 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -349,10 +349,10 @@ fn pass() { ret i32 %foo_ret } - ; Function Attrs: argmemonly nocallback nofree nounwind willreturn writeonly + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 - attributes #0 = { argmemonly nocallback nofree nounwind willreturn writeonly } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap index 5474dc76f38..aac28a5efce 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap @@ -42,7 +42,7 @@ entry: ret void, !dbg !22 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_main(ptr %0) { @@ -66,7 +66,7 @@ entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!8, !9} !llvm.dbg.cu = !{!10} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap index 53a35603202..684cec39496 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap @@ -28,7 +28,7 @@ else_block: ; preds = %entry ret i32 %foo_ret1, !dbg !16 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init___plc() { @@ -36,7 +36,7 @@ entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap index 40067d0dc2b..ebd3af30335 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap @@ -33,7 +33,7 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @conditional_return(ptr %0) { @@ -95,4 +95,4 @@ entry: ret void } -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap index 6969b30ffa9..ddf18e96f6a 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap @@ -33,7 +33,7 @@ entry: ret i32 %main_ret } -; Function Attrs: argmemonly nocallback nofree nounwind willreturn +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @conditional_return(ptr %0) { @@ -96,4 +96,4 @@ entry: ret void } -attributes #0 = { argmemonly nocallback nofree nounwind willreturn } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap index dbd4bf9dab8..a8ee95a0d87 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap @@ -25,7 +25,7 @@ else_block: ; preds = %lbl ret void, !dbg !20 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_foo(ptr %0) { @@ -49,7 +49,7 @@ entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap index 7c0a00d59ee..e160e90d12e 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap @@ -17,7 +17,7 @@ entry: ret void, !dbg !18 } -; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 define void @__init_main(ptr %0) { @@ -41,7 +41,7 @@ entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } +attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} From fc4b9cef224ba7438febf4c2a058b129ed26126e Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Wed, 10 Dec 2025 09:57:59 +0100 Subject: [PATCH 3/8] chore: update to LLVM 17 --- Cargo.lock | 13 ++++++++++--- Cargo.toml | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 643298ab7a8..ba5c2f8b48d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2158,14 +2158,15 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "llvm-sys" -version = "160.2.1" +version = "170.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73861901245d32e1c3d8b35b639cf100859b4cd0c9da56fe0273040acbb3ea4" +checksum = "ff1ee92492ae76bb6e24495ce15e311ba13ffb58c0140d89ac9910b92477cec8" dependencies = [ + "anyhow", "cc", "lazy_static", "libc", - "regex", + "regex-lite", "semver", ] @@ -3307,6 +3308,12 @@ dependencies = [ "regex-syntax 0.8.6", ] +[[package]] +name = "regex-lite" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943f41321c63ef1c92fd763bfe054d2668f7f225a5c29f0105903dc2fc04ba30" + [[package]] name = "regex-syntax" version = "0.6.29" diff --git a/Cargo.toml b/Cargo.toml index 0973cac4cdd..a8ce97813cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.6", features = ["llvm16-0"] } +inkwell = { version = "0.6", features = ["llvm17-0"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" From 61e1b8983cdd001327d8899ea2d4fbaff16a85f2 Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Wed, 10 Dec 2025 10:01:56 +0100 Subject: [PATCH 4/8] chore: update to LLVM 18 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba5c2f8b48d..1afff8e0ca6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2158,9 +2158,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "llvm-sys" -version = "170.2.0" +version = "181.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1ee92492ae76bb6e24495ce15e311ba13ffb58c0140d89ac9910b92477cec8" +checksum = "d320f9d2723c97d4b78f9190a61ed25cc7cfbe456668c08e6e7dd8e50ceb8500" dependencies = [ "anyhow", "cc", diff --git a/Cargo.toml b/Cargo.toml index a8ce97813cb..72a84dfe7dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.6", features = ["llvm17-0"] } +inkwell = { version = "0.6", features = ["llvm18-1"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" From 81e610c95043e27266dbc1c143bf82234e7292d9 Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Wed, 10 Dec 2025 15:40:50 +0100 Subject: [PATCH 5/8] chore: update to LLVM 19 --- Cargo.lock | 51 +++---- Cargo.toml | 2 +- ...n_different_locations_with_debug_info.snap | 14 +- ...files__multiple_files_with_debug_info.snap | 14 +- src/codegen/debug.rs | 41 +++++- .../generators/expression_generator.rs | 31 ++--- src/codegen/tests/debug_tests.rs | 125 +++++------------- ...ate_return_value_variable_in_function.snap | 10 +- ...rray_size_correctly_set_in_dwarf_info.snap | 12 +- ...g__assignment_statement_have_location.snap | 7 +- ...ging__case_conditions_location_marked.snap | 7 +- ...bugging__exit_statement_have_location.snap | 7 +- ...gging__for_conditions_location_marked.snap | 7 +- ...bugging__function_calls_have_location.snap | 7 +- ...on_calls_in_expressions_have_location.snap | 7 +- ...ugging__if_conditions_location_marked.snap | 7 +- ...g__implementation_added_as_subroutine.snap | 11 +- ...g__nested_function_calls_get_location.snap | 9 +- ...callable_expressions_have_no_location.snap | 7 +- ...on_function_pous_have_struct_as_param.snap | 9 +- ...ng__repeat_conditions_location_marked.snap | 7 +- ...gging__return_statement_have_location.snap | 7 +- ...temp_variables_in_pous_added_as_local.snap | 29 ++-- ...out_inout_in_function_added_as_params.snap | 9 +- ...ing__while_conditions_location_marked.snap | 7 +- .../complex_initializers.rs | 2 +- src/codegen/tests/oop_tests/debug_tests.rs | 114 ++++++---------- ...__integration__cfc__ir__actions_debug.snap | 9 +- ...on__cfc__ir__conditional_return_debug.snap | 9 +- ...sts__integration__cfc__ir__jump_debug.snap | 7 +- ...tegration__cfc__ir__sink_source_debug.snap | 7 +- 31 files changed, 190 insertions(+), 402 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1afff8e0ca6..6d7d2ff9178 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1412,7 +1412,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror 2.0.17", + "thiserror", ] [[package]] @@ -1864,23 +1864,22 @@ dependencies = [ [[package]] name = "inkwell" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67349bd7578d4afebbe15eaa642a80b884e8623db74b1716611b131feb1deef" +checksum = "39457e8611219cf690f862a470575f5c06862910d03ea3c3b187ad7abc44b4e2" dependencies = [ - "either", "inkwell_internals", "libc", "llvm-sys", "once_cell", - "thiserror 1.0.69", + "thiserror", ] [[package]] name = "inkwell_internals" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f365c8de536236cfdebd0ba2130de22acefed18b1fb99c32783b3840aec5fb46" +checksum = "ad9a7dd586b00f2b20e0b9ae3c6faa351fbfd56d15d63bbce35b13bece682eda" dependencies = [ "proc-macro2 1.0.101", "quote 1.0.41", @@ -2158,9 +2157,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "llvm-sys" -version = "181.2.0" +version = "191.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320f9d2723c97d4b78f9190a61ed25cc7cfbe456668c08e6e7dd8e50ceb8500" +checksum = "d0ad1fffbdac72a40b55aa58b31aa0efe925e277941b6705f128692b27f1d506" dependencies = [ "anyhow", "cc", @@ -2719,7 +2718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21e0a3a33733faeaf8651dfee72dd0f388f0c8e5ad496a3478fa5a922f49cfa8" dependencies = [ "memchr", - "thiserror 2.0.17", + "thiserror", "ucd-trie", ] @@ -3826,7 +3825,7 @@ dependencies = [ "serde_json", "sha2", "smallvec", - "thiserror 2.0.17", + "thiserror", "tracing", "url", ] @@ -3906,7 +3905,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.17", + "thiserror", "tracing", "whoami", ] @@ -3943,7 +3942,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.17", + "thiserror", "tracing", "whoami", ] @@ -3967,7 +3966,7 @@ dependencies = [ "serde", "serde_urlencoded", "sqlx-core", - "thiserror 2.0.17", + "thiserror", "tracing", "url", ] @@ -4222,33 +4221,13 @@ version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" dependencies = [ - "thiserror-impl 2.0.17", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "thiserror-impl", ] [[package]] @@ -4491,7 +4470,7 @@ dependencies = [ "log", "rand 0.9.2", "sha1", - "thiserror 2.0.17", + "thiserror", "utf-8", ] diff --git a/Cargo.toml b/Cargo.toml index 72a84dfe7dc..01305973f85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.6", features = ["llvm18-1"] } +inkwell = { version = "0.7", features = ["llvm19-1"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap index 679b5af52bd..2bc8d7fb35d 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_in_different_locations_with_debug_info.snap @@ -14,7 +14,7 @@ target triple = "[filtered]" define i16 @main() !dbg !4 { entry: %main = alloca i16, align 2 - call void @llvm.dbg.declare(metadata ptr %main, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %main, !9, !DIExpression(), !11) store i16 0, ptr %main, align 2 call void @mainProg(ptr @mainProg_instance), !dbg !12 %main_ret = load i16, ptr %main, align 2, !dbg !13 @@ -23,11 +23,6 @@ entry: declare !dbg !14 void @mainProg(ptr) -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -62,15 +57,10 @@ target triple = "[filtered]" define void @mainProg(ptr %0) !dbg !10 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !13, metadata !DIExpression()), !dbg !14 + #dbg_declare(ptr %0, !13, !DIExpression(), !14) ret void, !dbg !14 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} diff --git a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap index 532342ab4b6..2ff6905879e 100644 --- a/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap +++ b/compiler/plc_driver/src/tests/snapshots/plc_driver__tests__multi_files__multiple_files_with_debug_info.snap @@ -14,7 +14,7 @@ target triple = "[filtered]" define i16 @main() !dbg !4 { entry: %main = alloca i16, align 2 - call void @llvm.dbg.declare(metadata ptr %main, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %main, !9, !DIExpression(), !11) store i16 0, ptr %main, align 2 call void @mainProg(ptr @mainProg_instance), !dbg !12 %main_ret = load i16, ptr %main, align 2, !dbg !13 @@ -23,11 +23,6 @@ entry: declare !dbg !14 void @mainProg(ptr) -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -62,15 +57,10 @@ target triple = "[filtered]" define void @mainProg(ptr %0) !dbg !10 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !13, metadata !DIExpression()), !dbg !14 + #dbg_declare(ptr %0, !13, !DIExpression(), !14) ret void, !dbg !14 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} diff --git a/src/codegen/debug.rs b/src/codegen/debug.rs index e5488e99c9b..6cce16285fc 100644 --- a/src/codegen/debug.rs +++ b/src/codegen/debug.rs @@ -288,7 +288,7 @@ impl<'ink> DebugBuilder<'ink> { let res = self .debug_info .create_basic_type(name, size, encoding as u32, DIFlagsConstants::PUBLIC) - .map_err(|err| Diagnostic::codegen_error(err, location))?; + .map_err(|err| Diagnostic::codegen_error(err.to_string(), location))?; self.register_concrete_type(name, DebugType::Basic(res)); Ok(()) } @@ -435,7 +435,7 @@ impl<'ink> DebugBuilder<'ink> { DebugEncoding::DW_ATE_unsigned as u32, DIFlagsConstants::PUBLIC, ) - .map_err(|err| Diagnostic::codegen_error(err, SourceLocation::undefined()))?, + .map_err(|err| Diagnostic::codegen_error(err.to_string(), SourceLocation::undefined()))?, ) } else { self.get_or_create_debug_type(inner_type, index, types_index)? @@ -1048,9 +1048,44 @@ impl<'ink> Debug<'ink> for DebugBuilder<'ink> { scope, None, ); + let key = VariableKey::new(name, Some(&function_scope.linking_context.get_call_name_for_ir())); let variable = self.variables.get(&key); - self.debug_info.insert_declare_at_end(value, variable.copied(), None, location, block); + + if variable.is_none() { + // LLVM 19+ crashes with a segfault when `LLVMDIBuilderInsertDeclareRecordAtEnd` receives + // a null DILocalVariable pointer. Skip inserting the debug declare if the variable + // wasn't registered. To test, the unit test`actions_debug` should segfault when not + // early-returning here. + return; + } + + // Workaround until inkwell 0.8 is released, see https://github.com/TheDan64/inkwell/issues/613 + fn insert_declare_at_end_raw( + debug_info: &DebugInfoBuilder, + storage: PointerValue, + var_info: Option, + expr: Option, + debug_loc: inkwell::debug_info::DILocation, + block: BasicBlock, + ) { + // When expr is None, we create an empty expression (same as inkwell does internally). + let expr = expr.unwrap_or_else(|| debug_info.create_expression(vec![])); + unsafe { + inkwell::llvm_sys::debuginfo::LLVMDIBuilderInsertDeclareRecordAtEnd( + debug_info.as_mut_ptr(), + inkwell::values::AsValueRef::as_value_ref(&storage), + var_info.map(|v| v.as_mut_ptr()).unwrap_or(std::ptr::null_mut()), + expr.as_mut_ptr(), + debug_loc.as_mut_ptr(), + block.as_mut_ptr(), + ); + } + } + + // TODO: Replace function call below with `self.debug_info.insert_declare_at_end(value, variable.copied(), None, location, block);` + // once inkwell 0.8 is released. + insert_declare_at_end_raw(&self.debug_info, value, variable.copied(), None, location, block); } fn finalize(&self) { diff --git a/src/codegen/generators/expression_generator.rs b/src/codegen/generators/expression_generator.rs index c065ad308a6..ef96ac599b3 100644 --- a/src/codegen/generators/expression_generator.rs +++ b/src/codegen/generators/expression_generator.rs @@ -5,11 +5,10 @@ use inkwell::{ types::{BasicType, BasicTypeEnum}, values::{ ArrayValue, BasicMetadataValueEnum, BasicValue, BasicValueEnum, CallSiteValue, FloatValue, IntValue, - PointerValue, ScalableVectorValue, StructValue, VectorValue, + PointerValue, ScalableVectorValue, StructValue, ValueKind, VectorValue, }, AddressSpace, FloatPredicate, IntPredicate, }; -use itertools::Either; use rustc_hash::FxHashSet; use plc_ast::{ @@ -520,19 +519,15 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { // so grab either: // - the call's return value // - or a null-ptr - let value = call - .try_as_basic_value() - .either(Ok, |_| { - // we return an uninitialized int pointer for void methods :-/ - // dont deref it!! - Ok(self - .llvm - .context - .ptr_type(AddressSpace::from(ADDRESS_SPACE_CONST)) - .const_null() - .as_basic_value_enum()) - }) - .map(ExpressionValue::RValue); + let value = match call.try_as_basic_value() { + ValueKind::Basic(value) => value, + ValueKind::Instruction(_) => self + .llvm + .context + .ptr_type(AddressSpace::from(ADDRESS_SPACE_CONST)) + .const_null() + .as_basic_value_enum(), + }; // after the call we need to copy the values for assigned outputs // this is only necessary for outputs defined as `rusty::index::ArgumentType::ByVal` (PROGRAM, FUNCTION_BLOCK) @@ -546,7 +541,7 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { self.assign_output_values(parameter_struct, implementation_name, parameters_list)? } - value + Ok(ExpressionValue::RValue(value)) } fn generate_fnptr_call( @@ -629,8 +624,8 @@ impl<'ink, 'b> ExpressionCodeGenerator<'ink, 'b> { .map_err(CodegenError::from)?; let value = match call.try_as_basic_value() { - Either::Left(value) => value, - Either::Right(_) => self + ValueKind::Basic(value) => value, + ValueKind::Instruction(_) => self .llvm .context .ptr_type(AddressSpace::from(ADDRESS_SPACE_CONST)) diff --git a/src/codegen/tests/debug_tests.rs b/src/codegen/tests/debug_tests.rs index 198c1b9667f..603d00f0596 100644 --- a/src/codegen/tests/debug_tests.rs +++ b/src/codegen/tests/debug_tests.rs @@ -232,13 +232,13 @@ fn switch_case_debug_info() { %x1 = alloca i16, align 2 %x2 = alloca i16, align 2 %x3 = alloca i16, align 2 - call void @llvm.dbg.declare(metadata ptr %x1, metadata !8, metadata !DIExpression()), !dbg !10 + #dbg_declare(ptr %x1, !8, !DIExpression(), !10) store i16 0, ptr %x1, align 2 - call void @llvm.dbg.declare(metadata ptr %x2, metadata !11, metadata !DIExpression()), !dbg !12 + #dbg_declare(ptr %x2, !11, !DIExpression(), !12) store i16 0, ptr %x2, align 2 - call void @llvm.dbg.declare(metadata ptr %x3, metadata !13, metadata !DIExpression()), !dbg !14 + #dbg_declare(ptr %x3, !13, !DIExpression(), !14) store i16 0, ptr %x3, align 2 - call void @llvm.dbg.declare(metadata ptr %main, metadata !15, metadata !DIExpression()), !dbg !17 + #dbg_declare(ptr %main, !15, !DIExpression(), !17) store i32 0, ptr %main, align 4 br label %condition_check, !dbg !18 @@ -293,16 +293,11 @@ fn switch_case_debug_info() { br label %condition_check, !dbg !18 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___Test() { entry: ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -367,7 +362,7 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { define void @fb(ptr %0) !dbg !14 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !18, metadata !DIExpression()), !dbg !19 + #dbg_declare(ptr %0, !18, !DIExpression(), !19) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 @@ -376,16 +371,13 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { define void @fb__foo(ptr %0) !dbg !20 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !21, metadata !DIExpression()), !dbg !22 + #dbg_declare(ptr %0, !21, !DIExpression(), !22) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 ret void, !dbg !22 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_fb(ptr %0) { entry: %self = alloca ptr, align 8 @@ -430,8 +422,6 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!10, !11} !llvm.dbg.cu = !{!12} @@ -500,7 +490,7 @@ fn action_with_var_temp() { define i32 @main() !dbg !9 { entry: %main = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %main, metadata !12, metadata !DIExpression()), !dbg !14 + #dbg_declare(ptr %main, !12, !DIExpression(), !14) store i32 0, ptr %main, align 4 call void @PLC_PRG(ptr @PLC_PRG_instance), !dbg !15 call void @PLC_PRG__act(ptr @PLC_PRG_instance), !dbg !16 @@ -510,9 +500,9 @@ fn action_with_var_temp() { define void @PLC_PRG(ptr %0) !dbg !18 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !21, metadata !DIExpression()), !dbg !22 + #dbg_declare(ptr %0, !21, !DIExpression(), !22) %x = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %x, metadata !23, metadata !DIExpression()), !dbg !24 + #dbg_declare(ptr %x, !23, !DIExpression(), !24) store i32 0, ptr %x, align 4 store i32 0, ptr %x, align 4, !dbg !22 ret void, !dbg !25 @@ -520,9 +510,9 @@ fn action_with_var_temp() { define void @PLC_PRG__act(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !27, metadata !DIExpression()), !dbg !28 + #dbg_declare(ptr %0, !27, !DIExpression(), !28) %x = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %x, metadata !29, metadata !DIExpression()), !dbg !30 + #dbg_declare(ptr %x, !29, !DIExpression(), !30) store i32 0, ptr %x, align 4 %load_x = load i32, ptr %x, align 4, !dbg !28 %tmpVar = add i32 %load_x, 1, !dbg !28 @@ -530,9 +520,6 @@ fn action_with_var_temp() { ret void, !dbg !31 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_plc_prg(ptr %0) { entry: %self = alloca ptr, align 8 @@ -554,8 +541,6 @@ fn action_with_var_temp() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -666,15 +651,15 @@ END_FUNCTION %b = alloca i8, align 1 %arr = alloca [3 x [81 x i8]], align 1 %i = alloca i16, align 2 - call void @llvm.dbg.declare(metadata ptr %st, metadata !43, metadata !DIExpression()), !dbg !44 + #dbg_declare(ptr %st, !43, !DIExpression(), !44) call void @llvm.memcpy.p0.p0.i64(ptr align 1 %st, ptr align 1 @__struct___init, i64 ptrtoint (ptr getelementptr (%struct_, ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %s, metadata !45, metadata !DIExpression()), !dbg !46 + #dbg_declare(ptr %s, !45, !DIExpression(), !46) call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %b, metadata !47, metadata !DIExpression()), !dbg !48 + #dbg_declare(ptr %b, !47, !DIExpression(), !48) store i8 0, ptr %b, align 1 - call void @llvm.dbg.declare(metadata ptr %arr, metadata !49, metadata !DIExpression()), !dbg !50 + #dbg_declare(ptr %arr, !49, !DIExpression(), !50) call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([3 x [81 x i8]], ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %i, metadata !51, metadata !DIExpression()), !dbg !52 + #dbg_declare(ptr %i, !51, !DIExpression(), !52) store i16 0, ptr %i, align 2 call void @__init_struct_(ptr %st), !dbg !53 call void @__user_init_struct_(ptr %st), !dbg !53 @@ -719,17 +704,14 @@ END_FUNCTION ret void, !dbg !65 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 define void @__init_struct_(ptr %0) { entry: @@ -794,9 +776,8 @@ END_FUNCTION ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } - attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!35, !36} !llvm.dbg.cu = !{!37} @@ -917,7 +898,7 @@ fn constants_are_tagged_as_such() { define void @prog(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !36, metadata !DIExpression()), !dbg !37 + #dbg_declare(ptr %0, !36, !DIExpression(), !37) %a = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 %b = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 %c = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 @@ -928,17 +909,14 @@ fn constants_are_tagged_as_such() { entry: %bar = alloca i32, align 4 %d = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %d, metadata !41, metadata !DIExpression()), !dbg !42 + #dbg_declare(ptr %d, !41, !DIExpression(), !42) store i32 42, ptr %d, align 4 - call void @llvm.dbg.declare(metadata ptr %bar, metadata !43, metadata !DIExpression()), !dbg !44 + #dbg_declare(ptr %bar, !43, !DIExpression(), !44) store i32 0, ptr %bar, align 4 %bar_ret = load i32, ptr %bar, align 4, !dbg !45 ret i32 %bar_ret, !dbg !45 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_foo(ptr %0) { entry: %self = alloca ptr, align 8 @@ -976,8 +954,6 @@ fn constants_are_tagged_as_such() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -1164,7 +1140,7 @@ fn test_debug_info_auto_deref_parameters() { define void @test_with_ref_params(ptr %0) !dbg !41 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !45, metadata !DIExpression()), !dbg !46 + #dbg_declare(ptr %0, !45, !DIExpression(), !46) %input_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 0 %array_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 1 %inout_value = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 2 @@ -1173,9 +1149,6 @@ fn test_debug_info_auto_deref_parameters() { ret void, !dbg !46 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_mystruct(ptr %0) { entry: %self = alloca ptr, align 8 @@ -1211,8 +1184,6 @@ fn test_debug_info_auto_deref_parameters() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!37, !38} !llvm.dbg.cu = !{!39} @@ -1392,7 +1363,7 @@ fn test_debug_info_mixed_pointer_types() { define void @mixed_ptr(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !42, metadata !DIExpression()), !dbg !43 + #dbg_declare(ptr %0, !42, !DIExpression(), !43) %ref_param = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 0 %inout_param = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 1 %local_ptr = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 2 @@ -1400,9 +1371,6 @@ fn test_debug_info_mixed_pointer_types() { ret void, !dbg !43 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_mixed_ptr(ptr %0) { entry: %self = alloca ptr, align 8 @@ -1425,8 +1393,6 @@ fn test_debug_info_mixed_pointer_types() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1523,16 +1489,13 @@ fn test_debug_info_auto_deref_reference_to_pointers() { define void @test_with_reference_params(ptr %0) !dbg !54 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !58, metadata !DIExpression()), !dbg !59 + #dbg_declare(ptr %0, !58, !DIExpression(), !59) %ref_param = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 0 %array_ref_param = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 1 %local_reference = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 2 ret void, !dbg !59 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_mystruct(ptr %0) { entry: %self = alloca ptr, align 8 @@ -1568,8 +1531,6 @@ fn test_debug_info_auto_deref_reference_to_pointers() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!50, !51} !llvm.dbg.cu = !{!52} @@ -1665,9 +1626,9 @@ fn range_datatype_debug() { entry: %main = alloca i32, align 4 %r = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %r, metadata !8, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %r, !8, !DIExpression(), !11) store i32 0, ptr %r, align 4 - call void @llvm.dbg.declare(metadata ptr %main, metadata !12, metadata !DIExpression()), !dbg !13 + #dbg_declare(ptr %main, !12, !DIExpression(), !13) store i32 0, ptr %main, align 4 store i32 50, ptr %r, align 4, !dbg !14 %load_r = load i32, ptr %r, align 4, !dbg !15 @@ -1676,16 +1637,11 @@ fn range_datatype_debug() { ret i32 %main_ret, !dbg !16 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___Test() { entry: ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} @@ -1743,9 +1699,9 @@ fn range_datatype_reference_expr_bounds_debug() { entry: %main = alloca i32, align 4 %r = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %r, metadata !13, metadata !DIExpression()), !dbg !15 + #dbg_declare(ptr %r, !13, !DIExpression(), !15) store i32 0, ptr %r, align 4 - call void @llvm.dbg.declare(metadata ptr %main, metadata !16, metadata !DIExpression()), !dbg !17 + #dbg_declare(ptr %main, !16, !DIExpression(), !17) store i32 0, ptr %main, align 4 store i32 50, ptr %r, align 4, !dbg !18 %load_r = load i32, ptr %r, align 4, !dbg !19 @@ -1754,16 +1710,11 @@ fn range_datatype_reference_expr_bounds_debug() { ret i32 %main_ret, !dbg !20 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___Test() { entry: ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!5, !6} !llvm.dbg.cu = !{!7} @@ -1822,15 +1773,12 @@ fn range_datatype_fqn_reference_bounds_debug() { define void @prog(ptr %0) !dbg !14 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !18, metadata !DIExpression()), !dbg !19 + #dbg_declare(ptr %0, !18, !DIExpression(), !19) %TEN = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 %r = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 ret void, !dbg !19 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_prog(ptr %0) { entry: %self = alloca ptr, align 8 @@ -1852,8 +1800,6 @@ fn range_datatype_fqn_reference_bounds_debug() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!10, !11} !llvm.dbg.cu = !{!12} @@ -1913,7 +1859,7 @@ fn range_datatype_debug_alias_reused() { define void @prog(ptr %0) !dbg !16 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !20, metadata !DIExpression()), !dbg !21 + #dbg_declare(ptr %0, !20, !DIExpression(), !21) %ZERO = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 %u = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 %v = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 @@ -1921,9 +1867,6 @@ fn range_datatype_debug_alias_reused() { ret void, !dbg !21 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_prog(ptr %0) { entry: %self = alloca ptr, align 8 @@ -1945,8 +1888,6 @@ fn range_datatype_debug_alias_reused() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!12, !13} !llvm.dbg.cu = !{!14} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap index 047b5c413e9..1efff7f938d 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap @@ -12,21 +12,17 @@ target triple = "[filtered]" define void @myFunc(ptr %0) !dbg !4 { entry: %myFunc = alloca ptr, align 8 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !16, metadata !DIExpression()), !dbg !17 + #dbg_declare(ptr %myFunc, !16, !DIExpression(), !17) store ptr %0, ptr %myFunc, align 8 %deref = load ptr, ptr %myFunc, align 8, !dbg !18 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %deref, ptr align 1 @utf08_literal_0, i32 6, i1 false), !dbg !18 ret void, !dbg !19 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap index 4efb47a899c..09758ceb288 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap @@ -11,22 +11,18 @@ define i32 @foo() !dbg !4 { entry: %foo = alloca i32, align 4 %a = alloca [64 x i32], align 4 - call void @llvm.dbg.declare(metadata ptr %a, metadata !9, metadata !DIExpression()), !dbg !14 + #dbg_declare(ptr %a, !9, !DIExpression(), !14) call void @llvm.memset.p0.i64(ptr align 1 %a, i8 0, i64 ptrtoint (ptr getelementptr ([64 x i32], ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %foo, metadata !15, metadata !DIExpression()), !dbg !16 + #dbg_declare(ptr %foo, !15, !DIExpression(), !16) store i32 0, ptr %foo, align 4 %foo_ret = load i32, ptr %foo, align 4, !dbg !17 ret i32 %foo_ret, !dbg !17 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap index 62080071e1a..5a95a0e2c35 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__assignment_statement_have_location.snap @@ -10,18 +10,13 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 store i32 3, ptr %myFunc, align 4, !dbg !12 %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap index d2782f48726..f9cf0d23aa4 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__case_conditions_location_marked.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 %load_myFunc = load i32, ptr %myFunc, align 4, !dbg !12 switch i32 %load_myFunc, label %else [ @@ -36,11 +36,6 @@ continue: ; preds = %else, %case1, %case ret i32 %myFunc_ret, !dbg !19 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap index de2268792b9..de0a0dd8c83 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__exit_statement_have_location.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 br label %condition_check, !dbg !12 @@ -35,11 +35,6 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap index b17027ae8db..f5a1189e40d 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__for_conditions_location_marked.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 store i32 1, ptr %myFunc, align 4, !dbg !12 br i1 true, label %predicate_sle, label %predicate_sge, !dbg !12 @@ -40,11 +40,6 @@ continue: ; preds = %predicate_sge, %pre ret i32 %myFunc_ret, !dbg !15 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap index 916387a0d8f..9e3ffb9265e 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_have_location.snap @@ -10,18 +10,13 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 %call = call i32 @myFunc(), !dbg !12 %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap index 681b1b121b8..12809603aa6 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__function_calls_in_expressions_have_location.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 %call = call i32 @myFunc(), !dbg !12 %tmpVar = add i32 1, %call, !dbg !12 @@ -18,11 +18,6 @@ entry: ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap index 10233dfafa3..2ff1fcd08a5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__if_conditions_location_marked.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 br i1 true, label %condition_body, label %branch, !dbg !12 @@ -35,11 +35,6 @@ continue: ; preds = %else, %condition_bo ret i32 %myFunc_ret, !dbg !19 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap index aca50fce04d..2e77db8186a 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__implementation_added_as_subroutine.snap @@ -16,7 +16,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !14 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !17, metadata !DIExpression()), !dbg !19 + #dbg_declare(ptr %myFunc, !17, !DIExpression(), !19) store i32 0, ptr %myFunc, align 4 %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !20 ret i32 %myFunc_ret, !dbg !20 @@ -24,23 +24,18 @@ entry: define void @myPrg(ptr %0) !dbg !21 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !24, metadata !DIExpression()), !dbg !25 + #dbg_declare(ptr %0, !24, !DIExpression(), !25) ret void, !dbg !25 } define void @myFb(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !29, metadata !DIExpression()), !dbg !30 + #dbg_declare(ptr %0, !29, !DIExpression(), !30) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 ret void, !dbg !30 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!9, !10} !llvm.dbg.cu = !{!11} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap index a1b7495e5c4..c1235b690d2 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__nested_function_calls_get_location.snap @@ -11,9 +11,9 @@ define i32 @myFunc(i32 %0) !dbg !4 { entry: %myFunc = alloca i32, align 4 %x = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %x, metadata !10, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %x, !10, !DIExpression(), !11) store i32 %0, ptr %x, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !12, metadata !DIExpression()), !dbg !13 + #dbg_declare(ptr %myFunc, !12, !DIExpression(), !13) store i32 0, ptr %myFunc, align 4 %call = call i32 @myFunc(i32 1), !dbg !14 %call1 = call i32 @myFunc(i32 %call), !dbg !15 @@ -21,11 +21,6 @@ entry: ret i32 %myFunc_ret, !dbg !16 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap index e4563647dd5..8e81f73207a 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_callable_expressions_have_no_location.snap @@ -10,18 +10,13 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 %load_myFunc = load i32, ptr %myFunc, align 4, !dbg !12 %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !13 ret i32 %myFunc_ret, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap index b31fef717c5..d1bad8eef35 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap @@ -15,7 +15,7 @@ target triple = "[filtered]" define void @myProg(ptr %0) !dbg !18 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !22, metadata !DIExpression()), !dbg !23 + #dbg_declare(ptr %0, !22, !DIExpression(), !23) %x = getelementptr inbounds %myProg, ptr %0, i32 0, i32 0 %load_x = load i32, ptr %x, align 4, !dbg !23 %tmpVar = add i32 %load_x, 2, !dbg !23 @@ -25,7 +25,7 @@ entry: define void @fb(ptr %0) !dbg !25 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !28, metadata !DIExpression()), !dbg !29 + #dbg_declare(ptr %0, !28, !DIExpression(), !29) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 @@ -35,11 +35,6 @@ entry: ret void, !dbg !30 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!13, !14} !llvm.dbg.cu = !{!15} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap index 56a91d42f38..90be5723607 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__repeat_conditions_location_marked.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 br label %condition_check, !dbg !12 @@ -40,11 +40,6 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap index 1f7c6768bce..9ed1e0ace1f 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__return_statement_have_location.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !12 ret i32 %myFunc_ret, !dbg !12 @@ -20,11 +20,6 @@ buffer_block: ; No predecessors! ret i32 %myFunc_ret1, !dbg !13 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap index e8cc13272a5..43408fb55b7 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_and_vartemp_variables_in_pous_added_as_local.snap @@ -19,13 +19,13 @@ entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %a, metadata !17, metadata !DIExpression()), !dbg !19 + #dbg_declare(ptr %a, !17, !DIExpression(), !19) store i32 0, ptr %a, align 4 - call void @llvm.dbg.declare(metadata ptr %b, metadata !20, metadata !DIExpression()), !dbg !21 + #dbg_declare(ptr %b, !20, !DIExpression(), !21) store i32 0, ptr %b, align 4 - call void @llvm.dbg.declare(metadata ptr %c, metadata !22, metadata !DIExpression()), !dbg !23 + #dbg_declare(ptr %c, !22, !DIExpression(), !23) store i32 0, ptr %c, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !24, metadata !DIExpression()), !dbg !25 + #dbg_declare(ptr %myFunc, !24, !DIExpression(), !25) store i32 0, ptr %myFunc, align 4 %myFunc_ret = load i32, ptr %myFunc, align 4, !dbg !26 ret i32 %myFunc_ret, !dbg !26 @@ -33,41 +33,36 @@ entry: define void @myPrg(ptr %0) !dbg !27 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !30, metadata !DIExpression()), !dbg !31 + #dbg_declare(ptr %0, !30, !DIExpression(), !31) %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %a, metadata !32, metadata !DIExpression()), !dbg !33 + #dbg_declare(ptr %a, !32, !DIExpression(), !33) store i32 0, ptr %a, align 4 - call void @llvm.dbg.declare(metadata ptr %b, metadata !34, metadata !DIExpression()), !dbg !35 + #dbg_declare(ptr %b, !34, !DIExpression(), !35) store i32 0, ptr %b, align 4 - call void @llvm.dbg.declare(metadata ptr %c, metadata !36, metadata !DIExpression()), !dbg !37 + #dbg_declare(ptr %c, !36, !DIExpression(), !37) store i32 0, ptr %c, align 4 ret void, !dbg !31 } define void @myFb(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !41, metadata !DIExpression()), !dbg !42 + #dbg_declare(ptr %0, !41, !DIExpression(), !42) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %a, metadata !43, metadata !DIExpression()), !dbg !44 + #dbg_declare(ptr %a, !43, !DIExpression(), !44) store i32 0, ptr %a, align 4 - call void @llvm.dbg.declare(metadata ptr %b, metadata !45, metadata !DIExpression()), !dbg !46 + #dbg_declare(ptr %b, !45, !DIExpression(), !46) store i32 0, ptr %b, align 4 - call void @llvm.dbg.declare(metadata ptr %c, metadata !47, metadata !DIExpression()), !dbg !48 + #dbg_declare(ptr %c, !47, !DIExpression(), !48) store i32 0, ptr %c, align 4 ret void, !dbg !42 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!9, !10} !llvm.dbg.cu = !{!11} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap index 88184dc1769..3853e894fc5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__var_in_out_inout_in_function_added_as_params.snap @@ -11,9 +11,9 @@ define i32 @myFunc(ptr %0) !dbg !4 { entry: %myFunc = alloca i32, align 4 %x = alloca ptr, align 8 - call void @llvm.dbg.declare(metadata ptr %x, metadata !12, metadata !DIExpression()), !dbg !13 + #dbg_declare(ptr %x, !12, !DIExpression(), !13) store ptr %0, ptr %x, align 8 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !14, metadata !DIExpression()), !dbg !16 + #dbg_declare(ptr %myFunc, !14, !DIExpression(), !16) store i32 0, ptr %myFunc, align 4 %deref = load ptr, ptr %x, align 8, !dbg !17 %load_x = load i16, ptr %deref, align 2, !dbg !17 @@ -24,11 +24,6 @@ entry: ret i32 %myFunc_ret, !dbg !18 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap index 258793709ee..2225aa7dca7 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__while_conditions_location_marked.snap @@ -10,7 +10,7 @@ target triple = "[filtered]" define i32 @myFunc() !dbg !4 { entry: %myFunc = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %myFunc, metadata !9, metadata !DIExpression()), !dbg !11 + #dbg_declare(ptr %myFunc, !9, !DIExpression(), !11) store i32 0, ptr %myFunc, align 4 br label %condition_check, !dbg !12 @@ -41,11 +41,6 @@ continue1: ; preds = %buffer_block, %whil br label %condition_check, !dbg !12 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/src/codegen/tests/initialization_test/complex_initializers.rs b/src/codegen/tests/initialization_test/complex_initializers.rs index ac75476bacd..dba22197975 100644 --- a/src/codegen/tests/initialization_test/complex_initializers.rs +++ b/src/codegen/tests/initialization_test/complex_initializers.rs @@ -1739,7 +1739,7 @@ fn var_config_aliased_variables_initialized() { define void @__init___var_config() { entry: store ptr @__PI_1_2_1, ptr getelementptr inbounds (%FB, ptr @prog_instance, i32 0, i32 1), align 8 - store ptr @__PI_1_2_2, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1, i32 1), align 8 + store ptr @__PI_1_2_2, ptr getelementptr inbounds (%FB, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), i32 0, i32 1), align 8 ret void } "#); diff --git a/src/codegen/tests/oop_tests/debug_tests.rs b/src/codegen/tests/oop_tests/debug_tests.rs index fabe05e263d..d9bc7cc90c7 100644 --- a/src/codegen/tests/oop_tests/debug_tests.rs +++ b/src/codegen/tests/oop_tests/debug_tests.rs @@ -38,7 +38,7 @@ fn members_from_base_class_are_available_in_subclasses() { define void @foo(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !36, metadata !DIExpression()), !dbg !37 + #dbg_declare(ptr %0, !36, !DIExpression(), !37) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 @@ -50,16 +50,13 @@ fn members_from_base_class_are_available_in_subclasses() { define void @bar(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !41, metadata !DIExpression()), !dbg !42 + #dbg_declare(ptr %0, !41, !DIExpression(), !42) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 ret void, !dbg !42 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_foo(ptr %0) { entry: %self = alloca ptr, align 8 @@ -144,8 +141,6 @@ fn members_from_base_class_are_available_in_subclasses() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -244,7 +239,7 @@ fn write_to_parent_variable_qualified_access() { define void @fb(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !36, metadata !DIExpression()), !dbg !37 + #dbg_declare(ptr %0, !36, !DIExpression(), !37) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 @@ -255,7 +250,7 @@ fn write_to_parent_variable_qualified_access() { define void @fb2(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !41, metadata !DIExpression()), !dbg !42 + #dbg_declare(ptr %0, !41, !DIExpression(), !42) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__fb = getelementptr inbounds %fb2, ptr %0, i32 0, i32 0 @@ -264,7 +259,7 @@ fn write_to_parent_variable_qualified_access() { define void @foo(ptr %0) !dbg !43 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !46, metadata !DIExpression()), !dbg !47 + #dbg_declare(ptr %0, !46, !DIExpression(), !47) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 @@ -275,9 +270,6 @@ fn write_to_parent_variable_qualified_access() { ret void, !dbg !48 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_fb(ptr %0) { entry: %self = alloca ptr, align 8 @@ -404,8 +396,6 @@ fn write_to_parent_variable_qualified_access() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!28, !29} !llvm.dbg.cu = !{!30} @@ -511,7 +501,7 @@ fn write_to_parent_variable_in_instance() { define void @foo(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !30, metadata !DIExpression()), !dbg !31 + #dbg_declare(ptr %0, !30, !DIExpression(), !31) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 @@ -521,7 +511,7 @@ fn write_to_parent_variable_in_instance() { define void @foo__baz(ptr %0) !dbg !32 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !33, metadata !DIExpression()), !dbg !34 + #dbg_declare(ptr %0, !33, !DIExpression(), !34) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 @@ -532,7 +522,7 @@ fn write_to_parent_variable_in_instance() { define void @bar(ptr %0) !dbg !36 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !39, metadata !DIExpression()), !dbg !40 + #dbg_declare(ptr %0, !39, !DIExpression(), !40) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 @@ -545,9 +535,9 @@ fn write_to_parent_variable_in_instance() { entry: %s = alloca [81 x i8], align 1 %fb = alloca %bar, align 8 - call void @llvm.dbg.declare(metadata ptr %s, metadata !45, metadata !DIExpression()), !dbg !46 + #dbg_declare(ptr %s, !45, !DIExpression(), !46) call void @llvm.memset.p0.i64(ptr align 1 %s, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %fb, metadata !47, metadata !DIExpression()), !dbg !48 + #dbg_declare(ptr %fb, !47, !DIExpression(), !48) call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__bar__init, i64 ptrtoint (ptr getelementptr (%bar, ptr null, i32 1) to i64), i1 false) call void @__init_bar(ptr %fb), !dbg !49 call void @__user_init_bar(ptr %fb), !dbg !49 @@ -557,17 +547,14 @@ fn write_to_parent_variable_in_instance() { ret void, !dbg !52 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { entry: @@ -659,9 +646,8 @@ fn write_to_parent_variable_in_instance() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } - attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!22, !23} !llvm.dbg.cu = !{!24} @@ -784,7 +770,7 @@ fn array_in_parent_generated() { define void @grandparent(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !42, metadata !DIExpression()), !dbg !43 + #dbg_declare(ptr %0, !42, !DIExpression(), !43) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 @@ -795,7 +781,7 @@ fn array_in_parent_generated() { define void @parent(ptr %0) !dbg !44 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !47, metadata !DIExpression()), !dbg !48 + #dbg_declare(ptr %0, !47, !DIExpression(), !48) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 @@ -806,7 +792,7 @@ fn array_in_parent_generated() { define void @child(ptr %0) !dbg !49 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !52, metadata !DIExpression()), !dbg !53 + #dbg_declare(ptr %0, !52, !DIExpression(), !53) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 @@ -817,7 +803,7 @@ fn array_in_parent_generated() { define void @main() !dbg !54 { entry: %arr = alloca [11 x %child], align 8 - call void @llvm.dbg.declare(metadata ptr %arr, metadata !57, metadata !DIExpression()), !dbg !59 + #dbg_declare(ptr %arr, !57, !DIExpression(), !59) call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([11 x %child], ptr null, i32 1) to i64), i1 false) %tmpVar = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0, !dbg !60 %__parent = getelementptr inbounds %child, ptr %tmpVar, i32 0, i32 0, !dbg !60 @@ -846,11 +832,8 @@ fn array_in_parent_generated() { ret void, !dbg !65 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 define void @__init___vtable_grandparent(ptr %0) { entry: @@ -980,8 +963,7 @@ fn array_in_parent_generated() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1108,7 +1090,7 @@ fn complex_array_access_generated() { define void @grandparent(ptr %0) !dbg !38 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !42, metadata !DIExpression()), !dbg !43 + #dbg_declare(ptr %0, !42, !DIExpression(), !43) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 @@ -1119,7 +1101,7 @@ fn complex_array_access_generated() { define void @parent(ptr %0) !dbg !44 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !47, metadata !DIExpression()), !dbg !48 + #dbg_declare(ptr %0, !47, !DIExpression(), !48) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 @@ -1130,7 +1112,7 @@ fn complex_array_access_generated() { define void @child(ptr %0) !dbg !49 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !52, metadata !DIExpression()), !dbg !53 + #dbg_declare(ptr %0, !52, !DIExpression(), !53) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 @@ -1162,9 +1144,6 @@ fn complex_array_access_generated() { ret void, !dbg !54 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_grandparent(ptr %0) { entry: %self = alloca ptr, align 8 @@ -1293,8 +1272,6 @@ fn complex_array_access_generated() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!34, !35} !llvm.dbg.cu = !{!36} @@ -1390,7 +1367,7 @@ fn function_block_method_debug_info() { define void @foo(ptr %0) !dbg !20 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !24, metadata !DIExpression()), !dbg !25 + #dbg_declare(ptr %0, !24, !DIExpression(), !25) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 @@ -1399,7 +1376,7 @@ fn function_block_method_debug_info() { define void @foo__baz(ptr %0) !dbg !26 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !27, metadata !DIExpression()), !dbg !28 + #dbg_declare(ptr %0, !27, !DIExpression(), !28) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 @@ -1408,16 +1385,13 @@ fn function_block_method_debug_info() { define void @bar(ptr %0) !dbg !29 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !32, metadata !DIExpression()), !dbg !33 + #dbg_declare(ptr %0, !32, !DIExpression(), !33) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 ret void, !dbg !33 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___vtable_foo(ptr %0) { entry: %self = alloca ptr, align 8 @@ -1508,8 +1482,6 @@ fn function_block_method_debug_info() { ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!16, !17} !llvm.dbg.cu = !{!18} @@ -1638,7 +1610,7 @@ END_FUNCTION define void @parent(ptr %0) !dbg !30 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !34, metadata !DIExpression()), !dbg !35 + #dbg_declare(ptr %0, !34, !DIExpression(), !35) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 @@ -1648,7 +1620,7 @@ END_FUNCTION define void @child(ptr %0) !dbg !36 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !39, metadata !DIExpression()), !dbg !40 + #dbg_declare(ptr %0, !39, !DIExpression(), !40) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 @@ -1658,7 +1630,7 @@ END_FUNCTION define void @grandchild(ptr %0) !dbg !41 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !44, metadata !DIExpression()), !dbg !45 + #dbg_declare(ptr %0, !44, !DIExpression(), !45) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 %__child = getelementptr inbounds %grandchild, ptr %0, i32 0, i32 0 @@ -1675,19 +1647,19 @@ END_FUNCTION %parent1 = alloca %parent, align 8 %child1 = alloca %child, align 8 %grandchild1 = alloca %grandchild, align 8 - call void @llvm.dbg.declare(metadata ptr %array_of_parent, metadata !49, metadata !DIExpression()), !dbg !53 + #dbg_declare(ptr %array_of_parent, !49, !DIExpression(), !53) call void @llvm.memset.p0.i64(ptr align 1 %array_of_parent, i8 0, i64 ptrtoint (ptr getelementptr ([3 x %parent], ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %array_of_child, metadata !54, metadata !DIExpression()), !dbg !56 + #dbg_declare(ptr %array_of_child, !54, !DIExpression(), !56) call void @llvm.memset.p0.i64(ptr align 1 %array_of_child, i8 0, i64 ptrtoint (ptr getelementptr ([3 x %child], ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %array_of_grandchild, metadata !57, metadata !DIExpression()), !dbg !59 + #dbg_declare(ptr %array_of_grandchild, !57, !DIExpression(), !59) call void @llvm.memset.p0.i64(ptr align 1 %array_of_grandchild, i8 0, i64 ptrtoint (ptr getelementptr ([3 x %grandchild], ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %parent1, metadata !60, metadata !DIExpression()), !dbg !61 + #dbg_declare(ptr %parent1, !60, !DIExpression(), !61) call void @llvm.memcpy.p0.p0.i64(ptr align 1 %parent1, ptr align 1 @__parent__init, i64 ptrtoint (ptr getelementptr (%parent, ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %child1, metadata !62, metadata !DIExpression()), !dbg !63 + #dbg_declare(ptr %child1, !62, !DIExpression(), !63) call void @llvm.memcpy.p0.p0.i64(ptr align 1 %child1, ptr align 1 @__child__init, i64 ptrtoint (ptr getelementptr (%child, ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %grandchild1, metadata !64, metadata !DIExpression()), !dbg !65 + #dbg_declare(ptr %grandchild1, !64, !DIExpression(), !65) call void @llvm.memcpy.p0.p0.i64(ptr align 1 %grandchild1, ptr align 1 @__grandchild__init, i64 ptrtoint (ptr getelementptr (%grandchild, ptr null, i32 1) to i64), i1 false) - call void @llvm.dbg.declare(metadata ptr %main, metadata !66, metadata !DIExpression()), !dbg !67 + #dbg_declare(ptr %main, !66, !DIExpression(), !67) store i32 0, ptr %main, align 4 call void @__init_parent(ptr %parent1), !dbg !68 call void @__init_child(ptr %child1), !dbg !68 @@ -1781,14 +1753,11 @@ END_FUNCTION ret i32 %main_ret, !dbg !93 } - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) - declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 define void @__init___vtable_parent(ptr %0) { entry: @@ -1918,9 +1887,8 @@ END_FUNCTION ret void } - attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } - attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } + attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } + attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } !llvm.module.flags = !{!26, !27} !llvm.dbg.cu = !{!28} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap index aac28a5efce..a53d895feed 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap @@ -11,7 +11,7 @@ target triple = "[filtered]" define void @main(ptr %0) !dbg !12 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !16, metadata !DIExpression()), !dbg !17 + #dbg_declare(ptr %0, !16, !DIExpression(), !17) %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 store i32 0, ptr %a, align 4, !dbg !18 @@ -22,7 +22,6 @@ entry: define void @main__newAction(ptr %0) { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !21 %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 %load_a = load i32, ptr %a, align 4, !dbg !21 @@ -33,7 +32,6 @@ entry: define void @main__newAction2(ptr %0) { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !21 %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 %load_b = load i32, ptr %b, align 4, !dbg !23 @@ -42,9 +40,6 @@ entry: ret void, !dbg !22 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_main(ptr %0) { entry: %self = alloca ptr, align 8 @@ -66,8 +61,6 @@ entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!8, !9} !llvm.dbg.cu = !{!10} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap index 684cec39496..08f0ae62270 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_debug.snap @@ -10,9 +10,9 @@ define i32 @foo(i32 %0) !dbg !4 { entry: %foo = alloca i32, align 4 %val = alloca i32, align 4 - call void @llvm.dbg.declare(metadata ptr %val, metadata !9, metadata !DIExpression()), !dbg !10 + #dbg_declare(ptr %val, !9, !DIExpression(), !10) store i32 %0, ptr %val, align 4 - call void @llvm.dbg.declare(metadata ptr %foo, metadata !11, metadata !DIExpression()), !dbg !12 + #dbg_declare(ptr %foo, !11, !DIExpression(), !12) store i32 0, ptr %foo, align 4 %load_val = load i32, ptr %val, align 4, !dbg !13 %tmpVar = icmp eq i32 %load_val, 5, !dbg !13 @@ -28,16 +28,11 @@ else_block: ; preds = %entry ret i32 %foo_ret1, !dbg !16 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init___plc() { entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!0, !1} !llvm.dbg.cu = !{!2} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap index a8ee95a0d87..5a69ca30f82 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap @@ -11,7 +11,7 @@ target triple = "[filtered]" define void @foo(ptr %0) !dbg !11 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !16 + #dbg_declare(ptr %0, !15, !DIExpression(), !16) %val = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 br label %lbl, !dbg !17 @@ -25,9 +25,6 @@ else_block: ; preds = %lbl ret void, !dbg !20 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_foo(ptr %0) { entry: %self = alloca ptr, align 8 @@ -49,8 +46,6 @@ entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap index e160e90d12e..d1cd19e3ce8 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap @@ -11,15 +11,12 @@ target triple = "[filtered]" define void @main(ptr %0) !dbg !11 { entry: - call void @llvm.dbg.declare(metadata ptr %0, metadata !15, metadata !DIExpression()), !dbg !16 + #dbg_declare(ptr %0, !15, !DIExpression(), !16) %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 store i32 5, ptr %x, align 4, !dbg !17 ret void, !dbg !18 } -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 - define void @__init_main(ptr %0) { entry: %self = alloca ptr, align 8 @@ -41,8 +38,6 @@ entry: ret void } -attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } - !llvm.module.flags = !{!7, !8} !llvm.dbg.cu = !{!9} From 9772844daf46c807f2f97f68bf52f0bc2af94d73 Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Wed, 10 Dec 2025 16:02:29 +0100 Subject: [PATCH 6/8] chore: update to LLVM 20 --- Cargo.lock | 4 +- Cargo.toml | 2 +- src/codegen/tests/code_gen_tests.rs | 24 +- src/codegen/tests/debug_tests.rs | 106 ++-- ...on_function_pous_have_struct_as_param.snap | 4 +- src/codegen/tests/directaccess_test.rs | 40 +- src/codegen/tests/expression_tests.rs | 50 +- src/codegen/tests/fnptr.rs | 14 +- .../complex_initializers.rs | 414 ++++++------- .../initialization_test/pou_initializers.rs | 4 +- ...lues_in_global_variables_out_of_order.snap | 4 +- ..._class_struct_initialized_in_function.snap | 4 +- ..._block_struct_initialized_in_function.snap | 2 +- ..._is_initialized_with_type_initializer.snap | 4 +- ...tial_constant_values_in_pou_variables.snap | 4 +- ..._initial_values_in_function_block_pou.snap | 14 +- ...lizers__initial_values_in_program_pou.snap | 12 +- ..._for_struct_initialization_in_program.snap | 2 +- ...izers__array_of_struct_initialization.snap | 4 +- ...lizers__initial_values_in_fb_variable.snap | 10 +- ...array_of_structs_are_zero_initialized.snap | 2 +- src/codegen/tests/oop_tests.rs | 430 +++++++------- src/codegen/tests/oop_tests/debug_tests.rs | 354 +++++------ src/codegen/tests/oop_tests/super_tests.rs | 552 +++++++++--------- src/codegen/tests/parameters_tests.rs | 70 +-- src/codegen/tests/polymorphism.rs | 156 ++--- ...sts__accessing_nested_array_in_struct.snap | 4 +- ...e_gen_tests__accessing_nested_structs.snap | 10 +- ...e_gen_tests__action_called_in_program.snap | 4 +- ...sts__array_of_cast_int_type_generated.snap | 2 +- ..._int_non_zero_negative_type_generated.snap | 2 +- ..._array_of_int_non_zero_type_generated.snap | 2 +- ...en_tests__array_of_int_type_generated.snap | 2 +- ...ode_gen_tests__array_of_int_type_used.snap | 2 +- ...ype_with_non_zero_negative_start_used.snap | 2 +- ..._of_int_type_with_non_zero_start_used.snap | 2 +- ...d_variable_declaration_is_initialized.snap | 2 +- ...mber_of_another_struct_is_initialized.snap | 2 +- ...__case_with_multiple_labels_statement.snap | 4 +- ...gen_tests__case_with_ranges_statement.snap | 4 +- ...s__casted_literals_bool_code_gen_test.snap | 2 +- ..._tests__casted_literals_code_gen_test.snap | 4 +- ...ts__casted_literals_hex_code_gen_test.snap | 4 +- ...asted_literals_hex_ints_code_gen_test.snap | 2 +- ...__casted_literals_lreal_code_gen_test.snap | 4 +- ...s__casted_literals_real_code_gen_test.snap | 4 +- ...ests__class_member_access_from_method.snap | 8 +- ...__code_gen_tests__class_method_in_pou.snap | 14 +- ...sts__code_gen_tests__complex_pointers.snap | 8 +- ...ion_in_function_blocks_are_propagated.snap | 4 +- ...anged_type_declaration_are_propagated.snap | 2 +- ..._contants_in_case_statements_resolved.snap | 4 +- ...sts__code_gen_tests__date_comparisons.snap | 8 +- ..._gen_tests__different_case_references.snap | 6 +- ...pty_statements_dont_generate_anything.snap | 4 +- ...num_members_can_be_used_in_asignments.snap | 2 +- ...ests__enums_custom_type_are_generated.snap | 2 +- ...n_tests__fb_method_called_as_function.snap | 8 +- ...sts__code_gen_tests__fb_method_in_pou.snap | 14 +- ..._gen_tests__fb_method_with_var_in_out.snap | 12 +- ...ts__fb_method_with_var_input_defaults.snap | 10 +- ...ode_gen_tests__for_statement_continue.snap | 2 +- ...ts__code_gen_tests__for_statement_int.snap | 2 +- ...s__code_gen_tests__for_statement_lint.snap | 2 +- ...s__code_gen_tests__for_statement_sint.snap | 2 +- ...en_tests__for_statement_with_continue.snap | 2 +- ...de_gen_tests__for_statement_with_exit.snap | 2 +- ..._statement_with_references_steps_test.snap | 8 +- ..._tests__for_statement_with_steps_test.snap | 2 +- ...sts__for_statement_without_steps_test.snap | 2 +- ...n_tests__function_block_instance_call.snap | 6 +- ...unction_block_qualified_instance_call.snap | 6 +- ...gen_tests__function_called_in_program.snap | 2 +- ..._tests__function_called_when_shadowed.snap | 2 +- ...ion_with_parameters_called_in_program.snap | 2 +- ...with_two_parameters_called_in_program.snap | 2 +- ...lobal_variable_reference_is_generated.snap | 2 +- ...n_tests__if_elsif_else_generator_test.snap | 14 +- ...ts__code_gen_tests__if_generator_test.snap | 4 +- ...ts__if_with_expression_generator_test.snap | 4 +- ...rray_size_from_local_scoped_constants.snap | 8 +- ...do_not_result_in_an_under_or_overflow.snap | 8 +- ...code_gen_tests__multidim_array_access.snap | 2 +- ...gen_tests__multidim_array_declaration.snap | 2 +- ...__code_gen_tests__nested_array_access.snap | 2 +- ...e_gen_tests__nested_array_cube_writes.snap | 8 +- ...sted_array_cube_writes_negative_start.snap | 8 +- ...e_gen_tests__nested_array_declaration.snap | 2 +- ...ts__nested_function_called_in_program.snap | 2 +- ...n_tests__order_var_and_var_temp_block.snap | 2 +- ...__code_gen_tests__pass_inout_to_inout.snap | 10 +- ...s__code_gen_tests__pointers_generated.snap | 6 +- ...gen_tests__program_with_and_statement.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ..._program_with_casted_chars_assignment.snap | 4 +- ...s__code_gen_tests__program_with_chars.snap | 4 +- ...n_tests__program_with_date_assignment.snap | 8 +- ..._assignment_whit_short_datatype_names.snap | 8 +- ...arison_assignment_generates_correctly.snap | 4 +- ...am_with_local_temp_var_initialization.snap | 2 +- ...ts__program_with_long_date_assignment.snap | 8 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ..._gen_tests__program_with_or_statement.snap | 4 +- ...en_tests__program_with_real_additions.snap | 6 +- ...n_tests__program_with_real_assignment.snap | 2 +- ...ts__program_with_real_cast_assignment.snap | 4 +- ...gram_with_signed_combined_expressions.snap | 4 +- ..._program_with_special_chars_in_string.snap | 8 +- ...tests__program_with_string_assignment.snap | 4 +- ...n_tests__program_with_time_assignment.snap | 2 +- ...__program_with_time_of_day_assignment.snap | 2 +- ...explicit_parameters_called_in_program.snap | 6 +- ...with_two_parameters_called_in_program.snap | 6 +- ...gram_with_var_inout_called_in_program.snap | 4 +- ...rogram_with_var_out_called_in_program.snap | 8 +- ..._with_var_out_called_mixed_in_program.snap | 8 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 2 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...tes_void_function_and_struct_and_body.snap | 4 +- ...es_generates_void_function_and_struct.snap | 4 +- ...gen_tests__program_with_xor_statement.snap | 6 +- ...fied_action_from_fb_called_in_program.snap | 6 +- ...fied_foreign_action_called_in_program.snap | 4 +- ...lified_local_action_called_in_program.snap | 4 +- ...ests__real_function_called_in_program.snap | 2 +- ...e_gen_tests__reference_qualified_name.snap | 14 +- ...nce_assignments_in_function_arguments.snap | 8 +- ...sts__code_gen_tests__repeat_statement.snap | 2 +- ...ts__returning_early_in_function_block.snap | 2 +- ...e_gen_tests__simple_case_i8_statement.snap | 4 +- ...code_gen_tests__simple_case_statement.snap | 4 +- ...ts__structs_members_can_be_referenced.snap | 4 +- ..._gen_tests__sub_range_check_functions.snap | 20 +- ...nge_type_calls_check_function_missing.snap | 2 +- ...ype_calls_check_function_on_assigment.snap | 2 +- ...ariables_have_nano_seconds_resolution.snap | 2 +- ..._tests__typed_enums_are_used_properly.snap | 6 +- ...ng_cast_statement_as_const_expression.snap | 2 +- ..._using_const_expression_in_range_type.snap | 2 +- ...s__using_global_consts_in_expressions.snap | 2 +- ..._variable_with_same_name_as_data_type.snap | 2 +- ...de_gen_tests__while_loop_with_if_exit.snap | 2 +- ...ests__code_gen_tests__while_statement.snap | 2 +- ...ests__while_with_expression_statement.snap | 2 +- ...uctions_tests__compare_datetime_types.snap | 8 +- ...uction_functions_with_different_types.snap | 26 +- ...are_instructions_with_different_types.snap | 22 +- ...s_tests__pointer_compare_instructions.snap | 8 +- ...er_function_call_compare_instructions.snap | 6 +- ...tests__assigning_const_array_variable.snap | 2 +- ...ests__assigning_const_string_variable.snap | 2 +- ...ests__assigning_const_struct_variable.snap | 2 +- ...var_nested_struct_added_to_debug_info.snap | 4 +- ..._test__qualified_reference_assignment.snap | 4 +- ...n_tests__access_string_via_byte_array.snap | 6 +- ...ssion_tests__allowed_assignable_types.snap | 8 +- ...sion_tests__builtin_function_call_mux.snap | 10 +- ...function_call_mux_with_aggregate_type.snap | 2 +- ...iltin_function_call_sel_as_expression.snap | 6 +- ...uiltin_function_call_upper_bound_expr.snap | 12 +- ...s__calling_strings_in_function_return.snap | 2 +- ...ion_tests__cast_between_pointer_types.snap | 4 +- ...expression_tests__pointer_arithmetics.snap | 6 +- ...ts__pointer_arithmetics_function_call.snap | 4 +- ..._tests__unary_expressions_can_be_real.snap | 4 +- ...necessary_casts_between_pointer_types.snap | 8 +- ...argument_references_for_function_call.snap | 24 +- ...ized_string_varargs_called_in_program.snap | 2 +- ..._with_sized_varargs_called_in_program.snap | 2 +- ...nction_with_varargs_called_in_program.snap | 2 +- ...literal_string_argument_passed_by_ref.snap | 2 +- ...tests__passing_a_string_to_a_function.snap | 2 +- ...g_a_string_to_a_function_as_reference.snap | 2 +- ...n__tests__function_tests__simple_call.snap | 2 +- ...on_tests__var_output_in_function_call.snap | 2 +- ...t__any_real_function_called_with_ints.snap | 16 +- ...unction_call_generates_real_type_call.snap | 4 +- ...nerics_test__generic_output_parameter.snap | 6 +- ...pe_defined_in_external_file_in_module.snap | 2 +- ...ed_in_external_file_no_deps_in_module.snap | 2 +- ...nitialized_in_external_file_in_module.snap | 2 +- ...n_tests__enum_referenced_in_fb_nested.snap | 4 +- ...ts__function_defined_in_external_file.snap | 6 +- ...ct_with_custom_init_in_different_file.snap | 4 +- ...ccepts_empty_statement_as_input_param.snap | 8 +- ...cepts_empty_statement_as_output_param.snap | 10 +- ...cepts_empty_statement_as_output_param.snap | 2 +- ...sts__function_all_parameters_assigned.snap | 6 +- ...function_default_value_parameter_type.snap | 6 +- ...ests__function_empty_inout_assignment.snap | 6 +- ...ests__function_empty_input_assignment.snap | 6 +- ...sts__function_empty_output_assignment.snap | 6 +- ...empty_output_default_value_assignment.snap | 6 +- ...ts__function_missing_inout_assignment.snap | 6 +- ...ts__function_missing_input_assignment.snap | 6 +- ...issing_input_default_value_assignment.snap | 6 +- ...s__function_missing_output_assignment.snap | 6 +- ...ssing_output_default_value_assignment.snap | 6 +- ...unction_block_pointer_are_assigned_to.snap | 10 +- ...ccepts_empty_statement_as_input_param.snap | 4 +- ...cepts_empty_statement_as_output_param.snap | 6 +- ...gram_all_parameters_assigned_explicit.snap | 20 +- ...gram_all_parameters_assigned_implicit.snap | 16 +- ...tests__program_empty_inout_assignment.snap | 16 +- ...sts__program_missing_input_assignment.snap | 16 +- ...ts__program_missing_output_assignment.snap | 14 +- ...var_in_out_params_can_be_out_of_order.snap | 34 +- ...taccess_generated_as_rsh_and_trunc_i1.snap | 6 +- ...eaccess_generated_as_rsh_and_trunc_i8.snap | 6 +- ...access_generated_as_rsh_and_trunc_i32.snap | 6 +- ...t_codegen_test__nested_bitwise_access.snap | 4 +- ...n_test__variable_based_bitwise_access.snap | 8 +- ...access_generated_as_rsh_and_trunc_i16.snap | 6 +- ..._casted_string_assignment_uses_memcpy.snap | 4 +- ...g_generic_string_should_return_by_ref.snap | 4 +- ...ts__function_returns_a_literal_string.snap | 2 +- ...es_string_paramter_and_returns_string.snap | 2 +- ...__string_tests__program_string_output.snap | 10 +- ...program_with_casted_string_assignment.snap | 4 +- ...__program_with_string_type_assignment.snap | 6 +- ...ing_tests__string_function_parameters.snap | 4 +- ...ariable_length_strings_can_be_created.snap | 8 +- ...trings_using_constants_can_be_created.snap | 8 +- ...ests__variable_string_assignment_test.snap | 4 +- ...ed_datatypes_respect_conversion_rules.snap | 6 +- ...r_than_int_promote_the_second_operand.snap | 6 +- ...es_smaller_than_dint_promoted_to_dint.snap | 6 +- ...all_sint_expressions_fallback_to_dint.snap | 6 +- ...at_and_double_mix_converted_to_double.snap | 6 +- ...m_test__float_assigned_to_int_is_cast.snap | 6 +- ...t__float_assinged_to_double_to_double.snap | 4 +- ...m_test__int_assigned_to_float_is_cast.snap | 6 +- ...an_byte_promoted_on_compare_statement.snap | 4 +- ...bigger_than_float_converted_to_double.snap | 4 +- ..._or_equal_to_float_converted_to_float.snap | 6 +- ...es_smaller_than_dint_promoted_to_dint.snap | 6 +- ...e_calls_with_differently_sized_arrays.snap | 12 +- ...al_variable_passed_to_function_as_vla.snap | 8 +- ...ruct_is_generated_for_call_statements.snap | 4 +- ...sts__vla_tests__multi_dimensional_vla.snap | 8 +- ...en__tests__vla_tests__vla_read_access.snap | 8 +- ..._vla_tests__vla_read_access_with_expr.snap | 8 +- ..._vla_tests__vla_read_access_with_lint.snap | 8 +- ...__vla_tests__vla_read_access_with_var.snap | 8 +- src/codegen/tests/typesystem_test.rs | 12 +- src/tests/adr/arrays_adr.rs | 8 +- src/tests/adr/enum_adr.rs | 6 +- src/tests/adr/initializer_functions_adr.rs | 82 +-- src/tests/adr/pou_adr.rs | 66 +-- src/tests/adr/strings_adr.rs | 8 +- src/tests/adr/structs_adr.rs | 20 +- src/tests/adr/vla_adr.rs | 12 +- ...__integration__cfc__ir__actions_debug.snap | 12 +- ...egration__cfc__ir__conditional_return.snap | 8 +- ...r__conditional_return_evaluating_true.snap | 12 +- ...tional_return_evaluating_true_negated.snap | 12 +- ...sts__integration__cfc__ir__jump_debug.snap | 2 +- ...tegration__cfc__ir__sink_source_debug.snap | 2 +- 263 files changed, 1893 insertions(+), 1893 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d7d2ff9178..e457444e37a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2157,9 +2157,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "llvm-sys" -version = "191.1.0" +version = "201.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ad1fffbdac72a40b55aa58b31aa0efe925e277941b6705f128692b27f1d506" +checksum = "9bb947e8b79254ca10d496d0798a9ba1287dcf68e50a92b016fec1cc45bef447" dependencies = [ "anyhow", "cc", diff --git a/Cargo.toml b/Cargo.toml index 01305973f85..ce6c6ec95be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.7", features = ["llvm19-1"] } +inkwell = { version = "0.7", features = ["llvm20-1"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" diff --git a/src/codegen/tests/code_gen_tests.rs b/src/codegen/tests/code_gen_tests.rs index f434d7e393f..3cb02273add 100644 --- a/src/codegen/tests/code_gen_tests.rs +++ b/src/codegen/tests/code_gen_tests.rs @@ -1119,7 +1119,7 @@ fn fb_method_called_locally() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } @@ -1128,7 +1128,7 @@ fn fb_method_called_locally() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 store i16 %1, ptr %in, align 2 @@ -1207,7 +1207,7 @@ fn fb_local_method_var_shadows_parent_var() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } @@ -1216,7 +1216,7 @@ fn fb_local_method_var_shadows_parent_var() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 store i16 %1, ptr %in, align 2 @@ -1292,14 +1292,14 @@ fn prog_method_called_locally() { define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } define i32 @foo__addToBar(ptr %0, i16 %1) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 store i16 %1, ptr %in, align 2 @@ -1368,14 +1368,14 @@ fn prog_local_method_var_shadows_parent_var() { define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %call = call i32 @foo__addToBar(ptr %0, i16 42) ret void } define i32 @foo__addToBar(ptr %0, i16 %1) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %foo.addToBar = alloca i32, align 4 %in = alloca i16, align 2 store i16 %1, ptr %in, align 2 @@ -1623,10 +1623,10 @@ fn for_statement_with_binary_expressions() { define void @prg(ptr %0) { entry: - %step = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %step = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 %load_y = load i32, ptr %y, align 4 %tmpVar = add i32 %load_y, 1 store i32 %tmpVar, ptr %x, align 4 diff --git a/src/codegen/tests/debug_tests.rs b/src/codegen/tests/debug_tests.rs index 603d00f0596..843a0f0fd01 100644 --- a/src/codegen/tests/debug_tests.rs +++ b/src/codegen/tests/debug_tests.rs @@ -365,7 +365,7 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { #dbg_declare(ptr %0, !18, !DIExpression(), !19) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void, !dbg !19 } @@ -374,7 +374,7 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { #dbg_declare(ptr %0, !21, !DIExpression(), !22) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void, !dbg !22 } @@ -383,10 +383,10 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @fb, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_fb, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_fb, ptr %deref1, i32 0, i32 1 store ptr @fb__foo, ptr %foo, align 8 ret void } @@ -396,7 +396,7 @@ fn dbg_declare_has_valid_metadata_references_for_methods() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %deref, i32 0, i32 0 store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } @@ -663,42 +663,42 @@ END_FUNCTION store i16 0, ptr %i, align 2 call void @__init_struct_(ptr %st), !dbg !53 call void @__user_init_struct_(ptr %st), !dbg !53 - %s1 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 2, !dbg !54 + %s1 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 2, !dbg !54 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 %s1, i32 80, i1 false), !dbg !54 - %inner = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !55 - %s2 = getelementptr inbounds %inner, ptr %inner, i32 0, i32 0, !dbg !55 + %inner = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 0, !dbg !55 + %s2 = getelementptr inbounds nuw %inner, ptr %inner, i32 0, i32 0, !dbg !55 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 %s2, i32 80, i1 false), !dbg !55 - %b3 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 3, !dbg !56 + %b3 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 3, !dbg !56 %load_b = load i8, ptr %b3, align 1, !dbg !56 store i8 %load_b, ptr %b, align 1, !dbg !56 - %inner4 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !57 - %b5 = getelementptr inbounds %inner, ptr %inner4, i32 0, i32 1, !dbg !57 + %inner4 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 0, !dbg !57 + %b5 = getelementptr inbounds nuw %inner, ptr %inner4, i32 0, i32 1, !dbg !57 %load_b6 = load i8, ptr %b5, align 1, !dbg !57 store i8 %load_b6, ptr %b, align 1, !dbg !57 - %arr7 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 5, !dbg !58 + %arr7 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 5, !dbg !58 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr, ptr align 1 %arr7, i64 ptrtoint (ptr getelementptr ([3 x [81 x i8]], ptr null, i32 1) to i64), i1 false), !dbg !58 - %inner8 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !59 - %arr9 = getelementptr inbounds %inner, ptr %inner8, i32 0, i32 3, !dbg !59 + %inner8 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 0, !dbg !59 + %arr9 = getelementptr inbounds nuw %inner, ptr %inner8, i32 0, i32 3, !dbg !59 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr, ptr align 1 %arr9, i64 ptrtoint (ptr getelementptr ([3 x [81 x i8]], ptr null, i32 1) to i64), i1 false), !dbg !59 - %i10 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 6, !dbg !60 + %i10 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 6, !dbg !60 %load_i = load i16, ptr %i10, align 2, !dbg !60 store i16 %load_i, ptr %i, align 2, !dbg !60 - %inner11 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !61 - %i12 = getelementptr inbounds %inner, ptr %inner11, i32 0, i32 4, !dbg !61 + %inner11 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 0, !dbg !61 + %i12 = getelementptr inbounds nuw %inner, ptr %inner11, i32 0, i32 4, !dbg !61 %load_i13 = load i16, ptr %i12, align 2, !dbg !61 store i16 %load_i13, ptr %i, align 2, !dbg !61 %tmpVar = getelementptr inbounds [3 x [81 x i8]], ptr %arr, i32 0, i32 0, !dbg !62 - %arr14 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 5, !dbg !62 + %arr14 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 5, !dbg !62 %tmpVar15 = getelementptr inbounds [3 x [81 x i8]], ptr %arr14, i32 0, i32 0, !dbg !62 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 %tmpVar15, i32 80, i1 false), !dbg !62 %tmpVar16 = getelementptr inbounds [3 x [81 x i8]], ptr %arr, i32 0, i32 1, !dbg !63 - %inner17 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !63 - %arr18 = getelementptr inbounds %inner, ptr %inner17, i32 0, i32 3, !dbg !63 + %inner17 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 0, !dbg !63 + %arr18 = getelementptr inbounds nuw %inner, ptr %inner17, i32 0, i32 3, !dbg !63 %tmpVar19 = getelementptr inbounds [3 x [81 x i8]], ptr %arr18, i32 0, i32 1, !dbg !63 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar16, ptr align 1 %tmpVar19, i32 80, i1 false), !dbg !63 %tmpVar20 = getelementptr inbounds [3 x [81 x i8]], ptr %arr, i32 0, i32 2, !dbg !64 - %inner21 = getelementptr inbounds %struct_, ptr %st, i32 0, i32 0, !dbg !64 - %arr22 = getelementptr inbounds %inner, ptr %inner21, i32 0, i32 3, !dbg !64 + %inner21 = getelementptr inbounds nuw %struct_, ptr %st, i32 0, i32 0, !dbg !64 + %arr22 = getelementptr inbounds nuw %inner, ptr %inner21, i32 0, i32 3, !dbg !64 %tmpVar23 = getelementptr inbounds [3 x [81 x i8]], ptr %arr22, i32 0, i32 2, !dbg !64 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar20, ptr align 1 %tmpVar23, i32 80, i1 false), !dbg !64 ret void, !dbg !65 @@ -718,19 +718,19 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %inner = getelementptr inbounds %struct_, ptr %deref, i32 0, i32 0 + %inner = getelementptr inbounds nuw %struct_, ptr %deref, i32 0, i32 0 call void @__init_inner(ptr %inner) %deref1 = load ptr, ptr %self, align 8 - %s = getelementptr inbounds %struct_, ptr %deref1, i32 0, i32 2 + %s = getelementptr inbounds nuw %struct_, ptr %deref1, i32 0, i32 2 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false) %deref2 = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %struct_, ptr %deref2, i32 0, i32 3 + %b = getelementptr inbounds nuw %struct_, ptr %deref2, i32 0, i32 3 store i8 1, ptr %b, align 1 %deref3 = load ptr, ptr %self, align 8 - %r = getelementptr inbounds %struct_, ptr %deref3, i32 0, i32 4 + %r = getelementptr inbounds nuw %struct_, ptr %deref3, i32 0, i32 4 store float 0x400921CAC0000000, ptr %r, align 4 %deref4 = load ptr, ptr %self, align 8 - %i = getelementptr inbounds %struct_, ptr %deref4, i32 0, i32 6 + %i = getelementptr inbounds nuw %struct_, ptr %deref4, i32 0, i32 6 store i16 42, ptr %i, align 2 ret void } @@ -740,16 +740,16 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %s = getelementptr inbounds %inner, ptr %deref, i32 0, i32 0 + %s = getelementptr inbounds nuw %inner, ptr %deref, i32 0, i32 0 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false) %deref1 = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %inner, ptr %deref1, i32 0, i32 1 + %b = getelementptr inbounds nuw %inner, ptr %deref1, i32 0, i32 1 store i8 1, ptr %b, align 1 %deref2 = load ptr, ptr %self, align 8 - %r = getelementptr inbounds %inner, ptr %deref2, i32 0, i32 2 + %r = getelementptr inbounds nuw %inner, ptr %deref2, i32 0, i32 2 store float 0x400921CAC0000000, ptr %r, align 4 %deref3 = load ptr, ptr %self, align 8 - %i = getelementptr inbounds %inner, ptr %deref3, i32 0, i32 4 + %i = getelementptr inbounds nuw %inner, ptr %deref3, i32 0, i32 4 store i16 42, ptr %i, align 2 ret void } @@ -766,7 +766,7 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %inner = getelementptr inbounds %struct_, ptr %deref, i32 0, i32 0 + %inner = getelementptr inbounds nuw %struct_, ptr %deref, i32 0, i32 0 call void @__user_init_inner(ptr %inner) ret void } @@ -899,9 +899,9 @@ fn constants_are_tagged_as_such() { define void @prog(ptr %0) !dbg !32 { entry: #dbg_declare(ptr %0, !36, !DIExpression(), !37) - %a = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 2 ret void, !dbg !37 } @@ -1141,11 +1141,11 @@ fn test_debug_info_auto_deref_parameters() { define void @test_with_ref_params(ptr %0) !dbg !41 { entry: #dbg_declare(ptr %0, !45, !DIExpression(), !46) - %input_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 0 - %array_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 1 - %inout_value = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 2 - %inout_struct = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 3 - %local_ref = getelementptr inbounds %test_with_ref_params, ptr %0, i32 0, i32 4 + %input_ref = getelementptr inbounds nuw %test_with_ref_params, ptr %0, i32 0, i32 0 + %array_ref = getelementptr inbounds nuw %test_with_ref_params, ptr %0, i32 0, i32 1 + %inout_value = getelementptr inbounds nuw %test_with_ref_params, ptr %0, i32 0, i32 2 + %inout_struct = getelementptr inbounds nuw %test_with_ref_params, ptr %0, i32 0, i32 3 + %local_ref = getelementptr inbounds nuw %test_with_ref_params, ptr %0, i32 0, i32 4 ret void, !dbg !46 } @@ -1364,10 +1364,10 @@ fn test_debug_info_mixed_pointer_types() { define void @mixed_ptr(ptr %0) !dbg !38 { entry: #dbg_declare(ptr %0, !42, !DIExpression(), !43) - %ref_param = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 0 - %inout_param = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 1 - %local_ptr = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 2 - %local_ref = getelementptr inbounds %mixed_ptr, ptr %0, i32 0, i32 3 + %ref_param = getelementptr inbounds nuw %mixed_ptr, ptr %0, i32 0, i32 0 + %inout_param = getelementptr inbounds nuw %mixed_ptr, ptr %0, i32 0, i32 1 + %local_ptr = getelementptr inbounds nuw %mixed_ptr, ptr %0, i32 0, i32 2 + %local_ref = getelementptr inbounds nuw %mixed_ptr, ptr %0, i32 0, i32 3 ret void, !dbg !43 } @@ -1490,9 +1490,9 @@ fn test_debug_info_auto_deref_reference_to_pointers() { define void @test_with_reference_params(ptr %0) !dbg !54 { entry: #dbg_declare(ptr %0, !58, !DIExpression(), !59) - %ref_param = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 0 - %array_ref_param = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 1 - %local_reference = getelementptr inbounds %test_with_reference_params, ptr %0, i32 0, i32 2 + %ref_param = getelementptr inbounds nuw %test_with_reference_params, ptr %0, i32 0, i32 0 + %array_ref_param = getelementptr inbounds nuw %test_with_reference_params, ptr %0, i32 0, i32 1 + %local_reference = getelementptr inbounds nuw %test_with_reference_params, ptr %0, i32 0, i32 2 ret void, !dbg !59 } @@ -1774,8 +1774,8 @@ fn range_datatype_fqn_reference_bounds_debug() { define void @prog(ptr %0) !dbg !14 { entry: #dbg_declare(ptr %0, !18, !DIExpression(), !19) - %TEN = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %r = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %TEN = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %r = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 ret void, !dbg !19 } @@ -1860,10 +1860,10 @@ fn range_datatype_debug_alias_reused() { define void @prog(ptr %0) !dbg !16 { entry: #dbg_declare(ptr %0, !20, !DIExpression(), !21) - %ZERO = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %u = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 - %v = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 - %w = getelementptr inbounds %prog, ptr %0, i32 0, i32 3 + %ZERO = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %u = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 + %v = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 2 + %w = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 3 ret void, !dbg !21 } diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap index d1bad8eef35..1fe30f541e5 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__non_function_pous_have_struct_as_param.snap @@ -16,7 +16,7 @@ target triple = "[filtered]" define void @myProg(ptr %0) !dbg !18 { entry: #dbg_declare(ptr %0, !22, !DIExpression(), !23) - %x = getelementptr inbounds %myProg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %myProg, ptr %0, i32 0, i32 0 %load_x = load i32, ptr %x, align 4, !dbg !23 %tmpVar = add i32 %load_x, 2, !dbg !23 store i32 %tmpVar, ptr %x, align 4, !dbg !23 @@ -28,7 +28,7 @@ entry: #dbg_declare(ptr %0, !28, !DIExpression(), !29) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 %load_x = load i32, ptr %x, align 4, !dbg !29 %tmpVar = add i32 %load_x, 2, !dbg !29 store i32 %tmpVar, ptr %x, align 4, !dbg !29 diff --git a/src/codegen/tests/directaccess_test.rs b/src/codegen/tests/directaccess_test.rs index 58faa8184d5..a48d3fbf23f 100644 --- a/src/codegen/tests/directaccess_test.rs +++ b/src/codegen/tests/directaccess_test.rs @@ -155,8 +155,8 @@ fn direct_acess_in_output_assignment_implicit_explicit_and_mixed() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %X = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 - %Y = getelementptr inbounds %FOO, ptr %0, i32 0, i32 1 + %X = getelementptr inbounds nuw %FOO, ptr %0, i32 0, i32 0 + %Y = getelementptr inbounds nuw %FOO, ptr %0, i32 0, i32 1 ret void } @@ -168,46 +168,46 @@ fn direct_acess_in_output_assignment_implicit_explicit_and_mixed() { store i8 0, ptr %error_bits, align 1 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) store i32 0, ptr %main, align 4 - %0 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %0 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 0 %load_error_bits = load i8, ptr %error_bits, align 1 %shift = lshr i8 %load_error_bits, 0 %1 = and i8 %shift, 1 store i8 %1, ptr %0, align 1 call void @FOO(ptr %f) - %2 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 1 + %2 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 1 %3 = load i8, ptr %error_bits, align 1 %4 = load i8, ptr %2, align 1 %erase = and i8 %3, -2 %value = shl i8 %4, 0 %or = or i8 %erase, %value store i8 %or, ptr %error_bits, align 1 - %5 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %5 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 0 %load_error_bits1 = load i8, ptr %error_bits, align 1 %shift2 = lshr i8 %load_error_bits1, 0 %6 = and i8 %shift2, 1 store i8 %6, ptr %5, align 1 call void @FOO(ptr %f) - %7 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 1 + %7 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 1 %8 = load i8, ptr %error_bits, align 1 %9 = load i8, ptr %7, align 1 %erase3 = and i8 %8, -2 %value4 = shl i8 %9, 0 %or5 = or i8 %erase3, %value4 store i8 %or5, ptr %error_bits, align 1 - %10 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %10 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 0 %load_error_bits6 = load i8, ptr %error_bits, align 1 %shift7 = lshr i8 %load_error_bits6, 0 %11 = and i8 %shift7, 1 store i8 %11, ptr %10, align 1 call void @FOO(ptr %f) - %12 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 1 + %12 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 1 %13 = load i8, ptr %error_bits, align 1 %14 = load i8, ptr %12, align 1 %erase8 = and i8 %13, -2 %value9 = shl i8 %14, 0 %or10 = or i8 %erase8, %value9 store i8 %or10, ptr %error_bits, align 1 - %15 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %15 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 0 %load_error_bits11 = load i8, ptr %error_bits, align 1 %shift12 = lshr i8 %load_error_bits11, 0 %16 = and i8 %shift12, 1 @@ -259,7 +259,7 @@ fn direct_acess_in_output_assignment_with_simple_expression() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %Q = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 + %Q = getelementptr inbounds nuw %FOO, ptr %0, i32 0, i32 0 ret void } @@ -272,7 +272,7 @@ fn direct_acess_in_output_assignment_with_simple_expression() { call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) store i32 0, ptr %main, align 4 call void @FOO(ptr %f) - %0 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %0 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 0 %1 = load i8, ptr %error_bits, align 1 %2 = load i8, ptr %0, align 1 %erase = and i8 %1, -17 @@ -325,7 +325,7 @@ fn direct_acess_in_output_assignment_with_simple_expression_implicit() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %Q = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 + %Q = getelementptr inbounds nuw %FOO, ptr %0, i32 0, i32 0 ret void } @@ -338,7 +338,7 @@ fn direct_acess_in_output_assignment_with_simple_expression_implicit() { call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) store i32 0, ptr %main, align 4 call void @FOO(ptr %f) - %0 = getelementptr inbounds %FOO, ptr %f, i32 0, i32 0 + %0 = getelementptr inbounds nuw %FOO, ptr %f, i32 0, i32 0 %1 = load i8, ptr %error_bits, align 1 %2 = load i8, ptr %0, align 1 %erase = and i8 %1, -17 @@ -404,7 +404,7 @@ fn direct_acess_in_output_assignment_with_complexe_expression() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %Q = getelementptr inbounds %QUUX, ptr %0, i32 0, i32 0 + %Q = getelementptr inbounds nuw %QUUX, ptr %0, i32 0, i32 0 ret void } @@ -417,9 +417,9 @@ fn direct_acess_in_output_assignment_with_complexe_expression() { call void @llvm.memcpy.p0.p0.i64(ptr align 1 %f, ptr align 1 @__QUUX__init, i64 ptrtoint (ptr getelementptr (%QUUX, ptr null, i32 1) to i64), i1 false) store i32 0, ptr %main, align 4 call void @QUUX(ptr %f) - %bar = getelementptr inbounds %foo_struct, ptr %foo, i32 0, i32 0 - %baz = getelementptr inbounds %bar_struct, ptr %bar, i32 0, i32 0 - %0 = getelementptr inbounds %QUUX, ptr %f, i32 0, i32 0 + %bar = getelementptr inbounds nuw %foo_struct, ptr %foo, i32 0, i32 0 + %baz = getelementptr inbounds nuw %bar_struct, ptr %bar, i32 0, i32 0 + %0 = getelementptr inbounds nuw %QUUX, ptr %f, i32 0, i32 0 %1 = load i64, ptr %baz, align 8 %2 = load i8, ptr %0, align 1 %erase = and i64 %1, -281474976710657 @@ -428,9 +428,9 @@ fn direct_acess_in_output_assignment_with_complexe_expression() { %or = or i64 %erase, %value store i64 %or, ptr %baz, align 8 call void @QUUX(ptr %f) - %bar1 = getelementptr inbounds %foo_struct, ptr %foo, i32 0, i32 0 - %baz2 = getelementptr inbounds %bar_struct, ptr %bar1, i32 0, i32 0 - %4 = getelementptr inbounds %QUUX, ptr %f, i32 0, i32 0 + %bar1 = getelementptr inbounds nuw %foo_struct, ptr %foo, i32 0, i32 0 + %baz2 = getelementptr inbounds nuw %bar_struct, ptr %bar1, i32 0, i32 0 + %4 = getelementptr inbounds nuw %QUUX, ptr %f, i32 0, i32 0 %5 = load i64, ptr %baz2, align 8 %6 = load i8, ptr %4, align 1 %erase3 = and i64 %5, -1125899906842625 diff --git a/src/codegen/tests/expression_tests.rs b/src/codegen/tests/expression_tests.rs index ec335ea6c68..8465392053d 100644 --- a/src/codegen/tests/expression_tests.rs +++ b/src/codegen/tests/expression_tests.rs @@ -304,8 +304,8 @@ fn builtin_function_call_adr() { define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 store ptr %b, ptr %a, align 8 store ptr %b, ptr %a, align 8 ret void @@ -342,8 +342,8 @@ fn builtin_function_call_ref() { define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 store ptr %b, ptr %a, align 8 store ptr %b, ptr %a, align 8 ret void @@ -403,9 +403,9 @@ fn builtin_function_call_sel() { define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_b = load i32, ptr %b, align 4 %load_c = load i32, ptr %c, align 4 %1 = select i1 true, i32 %load_c, i32 %load_b @@ -457,8 +457,8 @@ fn builtin_function_call_move() { define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %load_b = load i32, ptr %b, align 4 store i32 %load_b, ptr %a, align 4 %load_b1 = load i32, ptr %b, align 4 @@ -493,8 +493,8 @@ fn builtin_function_call_sizeof() { define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 store i32 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i32), ptr %a, align 4 store i32 ptrtoint (ptr getelementptr (i64, ptr null, i32 1) to i32), ptr %a, align 4 ret void @@ -538,13 +538,13 @@ fn builtin_function_call_lower_bound() { define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %auto_deref = load [2 x i32], ptr %a, align 4 %outer_arr_gep = getelementptr inbounds [2 x i32], ptr %a, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %1 = load %__foo_vla, ptr %vla_struct, align 8 @@ -562,12 +562,12 @@ fn builtin_function_call_lower_bound() { store ptr %0, ptr %vla, align 8 store i32 0, ptr %foo, align 4 %deref = load ptr, ptr %vla, align 8 - %dim = getelementptr inbounds %__foo_vla, ptr %deref, i32 0, i32 1 + %dim = getelementptr inbounds nuw %__foo_vla, ptr %deref, i32 0, i32 1 %1 = getelementptr inbounds [2 x i32], ptr %dim, i32 0, i32 0 %2 = load i32, ptr %1, align 4 store i32 %2, ptr %foo, align 4 %deref1 = load ptr, ptr %vla, align 8 - %dim2 = getelementptr inbounds %__foo_vla, ptr %deref1, i32 0, i32 1 + %dim2 = getelementptr inbounds nuw %__foo_vla, ptr %deref1, i32 0, i32 1 %3 = getelementptr inbounds [2 x i32], ptr %dim2, i32 0, i32 0 %4 = load i32, ptr %3, align 4 store i32 %4, ptr %foo, align 4 @@ -613,13 +613,13 @@ fn builtin_function_call_upper_bound() { define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %auto_deref = load [2 x i32], ptr %a, align 4 %outer_arr_gep = getelementptr inbounds [2 x i32], ptr %a, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %1 = load %__foo_vla, ptr %vla_struct, align 8 @@ -637,12 +637,12 @@ fn builtin_function_call_upper_bound() { store ptr %0, ptr %vla, align 8 store i32 0, ptr %foo, align 4 %deref = load ptr, ptr %vla, align 8 - %dim = getelementptr inbounds %__foo_vla, ptr %deref, i32 0, i32 1 + %dim = getelementptr inbounds nuw %__foo_vla, ptr %deref, i32 0, i32 1 %1 = getelementptr inbounds [2 x i32], ptr %dim, i32 0, i32 1 %2 = load i32, ptr %1, align 4 store i32 %2, ptr %foo, align 4 %deref1 = load ptr, ptr %vla, align 8 - %dim2 = getelementptr inbounds %__foo_vla, ptr %deref1, i32 0, i32 1 + %dim2 = getelementptr inbounds nuw %__foo_vla, ptr %deref1, i32 0, i32 1 %3 = getelementptr inbounds [2 x i32], ptr %dim2, i32 0, i32 1 %4 = load i32, ptr %3, align 4 store i32 %4, ptr %foo, align 4 @@ -1063,7 +1063,7 @@ fn global_namespace_operator() { define void @main(ptr %0) { entry: - %foo = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %foo = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %load_foo = load i32, ptr @foo, align 4 store i32 %load_foo, ptr %foo, align 4 %load_foo1 = load i32, ptr @foo, align 4 @@ -1119,7 +1119,7 @@ fn unary_plus_expression_test() { define void @exp(ptr %0) { entry: - %x = getelementptr inbounds %exp, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %exp, ptr %0, i32 0, i32 0 %load_x = load i32, ptr %x, align 4 %load_x1 = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x1, 4 diff --git a/src/codegen/tests/fnptr.rs b/src/codegen/tests/fnptr.rs index a76aeda0d8b..5ca86b35d4a 100644 --- a/src/codegen/tests/fnptr.rs +++ b/src/codegen/tests/fnptr.rs @@ -379,10 +379,10 @@ fn function_block_body() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %local = getelementptr inbounds %A, ptr %0, i32 0, i32 0 - %in = getelementptr inbounds %A, ptr %0, i32 0, i32 1 - %out = getelementptr inbounds %A, ptr %0, i32 0, i32 2 - %inout = getelementptr inbounds %A, ptr %0, i32 0, i32 3 + %local = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 + %in = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 1 + %out = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 2 + %inout = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 3 ret void } @@ -399,13 +399,13 @@ fn function_block_body() { store i32 0, ptr %localOut, align 4 store i64 0, ptr %localInout, align 8 %0 = load ptr, ptr %bodyPtr, align 8 - %1 = getelementptr inbounds %A, ptr %instanceA, i32 0, i32 1 + %1 = getelementptr inbounds nuw %A, ptr %instanceA, i32 0, i32 1 %load_localIn = load i16, ptr %localIn, align 2 store i16 %load_localIn, ptr %1, align 2 - %2 = getelementptr inbounds %A, ptr %instanceA, i32 0, i32 3 + %2 = getelementptr inbounds nuw %A, ptr %instanceA, i32 0, i32 3 store ptr %localInout, ptr %2, align 8 call void %0(ptr %instanceA) - %3 = getelementptr inbounds %A, ptr %instanceA, i32 0, i32 2 + %3 = getelementptr inbounds nuw %A, ptr %instanceA, i32 0, i32 2 %4 = load i32, ptr %3, align 4 store i32 %4, ptr %localOut, align 4 ret void diff --git a/src/codegen/tests/initialization_test/complex_initializers.rs b/src/codegen/tests/initialization_test/complex_initializers.rs index dba22197975..1002333b3eb 100644 --- a/src/codegen/tests/initialization_test/complex_initializers.rs +++ b/src/codegen/tests/initialization_test/complex_initializers.rs @@ -135,7 +135,7 @@ fn init_functions_generated_for_programs() { define void @PLC_PRG(ptr %0) { entry: - %to_init = getelementptr inbounds %PLC_PRG, ptr %0, i32 0, i32 0 + %to_init = getelementptr inbounds nuw %PLC_PRG, ptr %0, i32 0, i32 0 ret void } @@ -144,7 +144,7 @@ fn init_functions_generated_for_programs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %to_init = getelementptr inbounds %PLC_PRG, ptr %deref, i32 0, i32 0 + %to_init = getelementptr inbounds nuw %PLC_PRG, ptr %deref, i32 0, i32 0 store ptr @s, ptr %to_init, align 8 ret void } @@ -288,8 +288,8 @@ fn init_functions_generated_for_function_blocks() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %to_init = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %to_init = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } @@ -298,7 +298,7 @@ fn init_functions_generated_for_function_blocks() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -308,10 +308,10 @@ fn init_functions_generated_for_function_blocks() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %to_init = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + %to_init = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 1 store ptr @s, ptr %to_init, align 8 ret void } @@ -437,9 +437,9 @@ fn nested_initializer_pous() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 call void @bar__print(ptr %b) call void @bar(ptr %b) ret void @@ -449,8 +449,8 @@ fn nested_initializer_pous() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %bar, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 1 call void @baz__print(ptr %b) ret void } @@ -459,22 +459,22 @@ fn nested_initializer_pous() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 1 ret void } define void @mainProg(ptr %0) { entry: - %other_ref_to_global = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 - %f = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 1 + %other_ref_to_global = getelementptr inbounds nuw %mainProg, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds nuw %mainProg, ptr %0, i32 0, i32 1 ret void } define void @sideProg(ptr %0) { entry: - %other_ref_to_global = getelementptr inbounds %sideProg, ptr %0, i32 0, i32 0 - %f = getelementptr inbounds %sideProg, ptr %0, i32 0, i32 1 + %other_ref_to_global = getelementptr inbounds nuw %sideProg, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds nuw %sideProg, ptr %0, i32 0, i32 1 call void @foo(ptr %f) call void @foo__print(ptr %f) ret void @@ -484,8 +484,8 @@ fn nested_initializer_pous() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %bar, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 1 ret void } @@ -493,9 +493,9 @@ fn nested_initializer_pous() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 ret void } @@ -503,8 +503,8 @@ fn nested_initializer_pous() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 - %str_ref = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 0 + %str_ref = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 1 ret void } @@ -513,7 +513,7 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -523,7 +523,7 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 ret void } @@ -533,7 +533,7 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @baz, ptr %__body, align 8 ret void } @@ -543,13 +543,13 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %foo, ptr %deref, i32 0, i32 2 + %b = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 2 call void @__init_bar(ptr %b) %deref1 = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref2 = load ptr, ptr %self, align 8 - %str_ref = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + %str_ref = getelementptr inbounds nuw %foo, ptr %deref2, i32 0, i32 1 store ptr @str, ptr %str_ref, align 8 ret void } @@ -559,10 +559,10 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + %b = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 1 call void @__init_baz(ptr %b) %deref1 = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %bar, ptr %deref1, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -572,10 +572,10 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %baz, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %baz, ptr %deref, i32 0, i32 0 store ptr @__vtable_baz_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %str_ref = getelementptr inbounds %baz, ptr %deref1, i32 0, i32 1 + %str_ref = getelementptr inbounds nuw %baz, ptr %deref1, i32 0, i32 1 store ptr @str, ptr %str_ref, align 8 ret void } @@ -585,10 +585,10 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + %f = getelementptr inbounds nuw %mainProg, ptr %deref, i32 0, i32 1 call void @__init_foo(ptr %f) %deref1 = load ptr, ptr %self, align 8 - %other_ref_to_global = getelementptr inbounds %mainProg, ptr %deref1, i32 0, i32 0 + %other_ref_to_global = getelementptr inbounds nuw %mainProg, ptr %deref1, i32 0, i32 0 store ptr @str, ptr %other_ref_to_global, align 8 ret void } @@ -598,10 +598,10 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + %f = getelementptr inbounds nuw %mainProg, ptr %deref, i32 0, i32 1 call void @__init_foo(ptr %f) %deref1 = load ptr, ptr %self, align 8 - %other_ref_to_global = getelementptr inbounds %mainProg, ptr %deref1, i32 0, i32 0 + %other_ref_to_global = getelementptr inbounds nuw %mainProg, ptr %deref1, i32 0, i32 0 store ptr @str, ptr %other_ref_to_global, align 8 ret void } @@ -618,7 +618,7 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + %b = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 1 call void @__user_init_baz(ptr %b) ret void } @@ -642,7 +642,7 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + %f = getelementptr inbounds nuw %mainProg, ptr %deref, i32 0, i32 1 call void @__user_init_foo(ptr %f) ret void } @@ -652,7 +652,7 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %foo, ptr %deref, i32 0, i32 2 + %b = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 2 call void @__user_init_bar(ptr %b) ret void } @@ -662,7 +662,7 @@ fn nested_initializer_pous() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %mainProg, ptr %deref, i32 0, i32 1 + %f = getelementptr inbounds nuw %mainProg, ptr %deref, i32 0, i32 1 call void @__user_init_foo(ptr %f) ret void } @@ -726,9 +726,9 @@ fn local_address() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %i = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %pi = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %i = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %pi = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 ret void } @@ -737,7 +737,7 @@ fn local_address() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -747,12 +747,12 @@ fn local_address() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %pi = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %pi = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 2 %deref2 = load ptr, ptr %self, align 8 - %i = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + %i = getelementptr inbounds nuw %foo, ptr %deref2, i32 0, i32 1 store ptr %i, ptr %pi, align 8 ret void } @@ -825,9 +825,9 @@ fn user_init_called_for_variables_on_stack() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %i = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %pi = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %i = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %pi = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 ret void } @@ -835,9 +835,9 @@ fn user_init_called_for_variables_on_stack() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %i = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %pi = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %i = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %pi = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 store ptr %i, ptr %pi, align 8 ret void } @@ -860,10 +860,10 @@ fn user_init_called_for_variables_on_stack() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %FB_INIT = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } @@ -873,7 +873,7 @@ fn user_init_called_for_variables_on_stack() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -1025,7 +1025,7 @@ fn struct_types() { define void @prog(ptr %0) { entry: - %str = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %str = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 ret void } @@ -1034,10 +1034,10 @@ fn struct_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %member = getelementptr inbounds %myStruct, ptr %deref, i32 0, i32 0 + %member = getelementptr inbounds nuw %myStruct, ptr %deref, i32 0, i32 0 store ptr @s, ptr %member, align 8 %deref1 = load ptr, ptr %self, align 8 - %member2 = getelementptr inbounds %myStruct, ptr %deref1, i32 0, i32 1 + %member2 = getelementptr inbounds nuw %myStruct, ptr %deref1, i32 0, i32 1 store ptr @s2, ptr %member2, align 8 ret void } @@ -1047,7 +1047,7 @@ fn struct_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %str = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__init_mystruct(ptr %str) ret void } @@ -1064,7 +1064,7 @@ fn struct_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %str = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__user_init_myStruct(ptr %str) ret void } @@ -1139,7 +1139,7 @@ fn stateful_pous_methods_and_structs_get_init_functions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -1147,19 +1147,19 @@ fn stateful_pous_methods_and_structs_get_init_functions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } define void @cl__m(ptr %0) { entry: - %__vtable = getelementptr inbounds %cl, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %cl, ptr %0, i32 0, i32 0 ret void } define void @cl(ptr %0) { entry: - %__vtable = getelementptr inbounds %cl, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %cl, ptr %0, i32 0, i32 0 ret void } @@ -1172,7 +1172,7 @@ fn stateful_pous_methods_and_structs_get_init_functions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -1181,10 +1181,10 @@ fn stateful_pous_methods_and_structs_get_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %m = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %m = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__m, ptr %m, align 8 ret void } @@ -1194,7 +1194,7 @@ fn stateful_pous_methods_and_structs_get_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %m = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %m = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @cl__m, ptr %m, align 8 ret void } @@ -1211,7 +1211,7 @@ fn stateful_pous_methods_and_structs_get_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -1228,7 +1228,7 @@ fn stateful_pous_methods_and_structs_get_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_cl_instance, ptr %__vtable, align 8 ret void } @@ -1328,8 +1328,8 @@ fn global_instance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } @@ -1344,7 +1344,7 @@ fn global_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -1354,10 +1354,10 @@ fn global_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %s = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + %s = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 1 store ptr @ps, ptr %s, align 8 ret void } @@ -1455,14 +1455,14 @@ fn aliased_types() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } define void @prog(ptr %0) { entry: - %fb = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %fb = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 call void @foo(ptr %fb) ret void } @@ -1472,7 +1472,7 @@ fn aliased_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -1482,10 +1482,10 @@ fn aliased_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %s = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + %s = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 1 store ptr @ps, ptr %s, align 8 ret void } @@ -1495,7 +1495,7 @@ fn aliased_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %fb = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %fb = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %fb) ret void } @@ -1505,7 +1505,7 @@ fn aliased_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %fb = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %fb = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %fb) ret void } @@ -1654,15 +1654,15 @@ fn var_config_aliased_variables_initialized() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 - %foo = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 0 + %foo = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 1 ret void } define void @prog(ptr %0) { entry: - %instance1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %instance2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %instance1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %instance2 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 ret void } @@ -1671,7 +1671,7 @@ fn var_config_aliased_variables_initialized() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB, ptr %deref, i32 0, i32 0 store ptr @FB, ptr %__body, align 8 ret void } @@ -1681,7 +1681,7 @@ fn var_config_aliased_variables_initialized() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_instance, ptr %__vtable, align 8 ret void } @@ -1691,10 +1691,10 @@ fn var_config_aliased_variables_initialized() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %instance1 = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %instance1 = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__init_fb(ptr %instance1) %deref1 = load ptr, ptr %self, align 8 - %instance2 = getelementptr inbounds %prog, ptr %deref1, i32 0, i32 1 + %instance2 = getelementptr inbounds nuw %prog, ptr %deref1, i32 0, i32 1 call void @__init_fb(ptr %instance2) ret void } @@ -1718,10 +1718,10 @@ fn var_config_aliased_variables_initialized() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %instance1 = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %instance1 = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__user_init_FB(ptr %instance1) %deref1 = load ptr, ptr %self, align 8 - %instance2 = getelementptr inbounds %prog, ptr %deref1, i32 0, i32 1 + %instance2 = getelementptr inbounds nuw %prog, ptr %deref1, i32 0, i32 1 call void @__user_init_FB(ptr %instance2) ret void } @@ -1738,8 +1738,8 @@ fn var_config_aliased_variables_initialized() { define void @__init___var_config() { entry: - store ptr @__PI_1_2_1, ptr getelementptr inbounds (%FB, ptr @prog_instance, i32 0, i32 1), align 8 - store ptr @__PI_1_2_2, ptr getelementptr inbounds (%FB, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), i32 0, i32 1), align 8 + store ptr @__PI_1_2_1, ptr getelementptr inbounds nuw (%FB, ptr @prog_instance, i32 0, i32 1), align 8 + store ptr @__PI_1_2_2, ptr getelementptr inbounds nuw (%FB, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), i32 0, i32 1), align 8 ret void } "#); @@ -1791,7 +1791,7 @@ fn var_external_blocks_are_ignored_in_init_functions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -1805,7 +1805,7 @@ fn var_external_blocks_are_ignored_in_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -1815,7 +1815,7 @@ fn var_external_blocks_are_ignored_in_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -1880,11 +1880,11 @@ fn ref_to_local_member() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %ptr = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 - %alias = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 - %reference_to = getelementptr inbounds %foo, ptr %0, i32 0, i32 4 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %ptr = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 + %alias = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 3 + %reference_to = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 4 ret void } @@ -1893,7 +1893,7 @@ fn ref_to_local_member() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -1903,22 +1903,22 @@ fn ref_to_local_member() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %ptr = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %ptr = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 2 %deref2 = load ptr, ptr %self, align 8 - %s = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + %s = getelementptr inbounds nuw %foo, ptr %deref2, i32 0, i32 1 store ptr %s, ptr %ptr, align 8 %deref3 = load ptr, ptr %self, align 8 - %alias = getelementptr inbounds %foo, ptr %deref3, i32 0, i32 3 + %alias = getelementptr inbounds nuw %foo, ptr %deref3, i32 0, i32 3 %deref4 = load ptr, ptr %self, align 8 - %s5 = getelementptr inbounds %foo, ptr %deref4, i32 0, i32 1 + %s5 = getelementptr inbounds nuw %foo, ptr %deref4, i32 0, i32 1 store ptr %s5, ptr %alias, align 8 %deref6 = load ptr, ptr %self, align 8 - %reference_to = getelementptr inbounds %foo, ptr %deref6, i32 0, i32 4 + %reference_to = getelementptr inbounds nuw %foo, ptr %deref6, i32 0, i32 4 %deref7 = load ptr, ptr %self, align 8 - %s8 = getelementptr inbounds %foo, ptr %deref7, i32 0, i32 1 + %s8 = getelementptr inbounds nuw %foo, ptr %deref7, i32 0, i32 1 store ptr %s8, ptr %reference_to, align 8 ret void } @@ -1987,11 +1987,11 @@ fn ref_to_local_member_shadows_global() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %ptr = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 - %alias = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 - %reference_to = getelementptr inbounds %foo, ptr %0, i32 0, i32 4 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %ptr = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 + %alias = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 3 + %reference_to = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 4 ret void } @@ -2000,7 +2000,7 @@ fn ref_to_local_member_shadows_global() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -2010,22 +2010,22 @@ fn ref_to_local_member_shadows_global() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %ptr = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %ptr = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 2 %deref2 = load ptr, ptr %self, align 8 - %s = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + %s = getelementptr inbounds nuw %foo, ptr %deref2, i32 0, i32 1 store ptr %s, ptr %ptr, align 8 %deref3 = load ptr, ptr %self, align 8 - %alias = getelementptr inbounds %foo, ptr %deref3, i32 0, i32 3 + %alias = getelementptr inbounds nuw %foo, ptr %deref3, i32 0, i32 3 %deref4 = load ptr, ptr %self, align 8 - %s5 = getelementptr inbounds %foo, ptr %deref4, i32 0, i32 1 + %s5 = getelementptr inbounds nuw %foo, ptr %deref4, i32 0, i32 1 store ptr %s5, ptr %alias, align 8 %deref6 = load ptr, ptr %self, align 8 - %reference_to = getelementptr inbounds %foo, ptr %deref6, i32 0, i32 4 + %reference_to = getelementptr inbounds nuw %foo, ptr %deref6, i32 0, i32 4 %deref7 = load ptr, ptr %self, align 8 - %s8 = getelementptr inbounds %foo, ptr %deref7, i32 0, i32 1 + %s8 = getelementptr inbounds nuw %foo, ptr %deref7, i32 0, i32 1 store ptr %s8, ptr %reference_to, align 8 ret void } @@ -2091,8 +2091,8 @@ fn temporary_variable_ref_to_local_member() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 %ptr = alloca ptr, align 8 %alias = alloca ptr, align 8 %reference_to = alloca ptr, align 8 @@ -2110,7 +2110,7 @@ fn temporary_variable_ref_to_local_member() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -2120,7 +2120,7 @@ fn temporary_variable_ref_to_local_member() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2241,7 +2241,7 @@ fn initializing_method_variables_with_refs() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -2249,7 +2249,7 @@ fn initializing_method_variables_with_refs() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 %px = alloca ptr, align 8 store i32 10, ptr %x, align 4 @@ -2263,10 +2263,10 @@ fn initializing_method_variables_with_refs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -2276,7 +2276,7 @@ fn initializing_method_variables_with_refs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2343,8 +2343,8 @@ fn initializing_method_variables_with_refs_referencing_parent_pou_variable() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } @@ -2352,8 +2352,8 @@ fn initializing_method_variables_with_refs_referencing_parent_pou_variable() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 %px = alloca ptr, align 8 store ptr %x, ptr %px, align 8 store ptr %x, ptr %px, align 8 @@ -2365,10 +2365,10 @@ fn initializing_method_variables_with_refs_referencing_parent_pou_variable() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -2378,7 +2378,7 @@ fn initializing_method_variables_with_refs_referencing_parent_pou_variable() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2446,7 +2446,7 @@ fn initializing_method_variables_with_refs_referencing_global_variable() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -2454,7 +2454,7 @@ fn initializing_method_variables_with_refs_referencing_global_variable() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %px = alloca ptr, align 8 store ptr @x, ptr %px, align 8 store ptr @x, ptr %px, align 8 @@ -2466,10 +2466,10 @@ fn initializing_method_variables_with_refs_referencing_global_variable() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -2479,7 +2479,7 @@ fn initializing_method_variables_with_refs_referencing_global_variable() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2548,7 +2548,7 @@ fn initializing_method_variables_with_refs_shadowing() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -2556,7 +2556,7 @@ fn initializing_method_variables_with_refs_shadowing() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 %px = alloca ptr, align 8 store i32 0, ptr %x, align 4 @@ -2570,10 +2570,10 @@ fn initializing_method_variables_with_refs_shadowing() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -2583,7 +2583,7 @@ fn initializing_method_variables_with_refs_shadowing() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2647,7 +2647,7 @@ fn initializing_method_variables_with_alias() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -2655,7 +2655,7 @@ fn initializing_method_variables_with_alias() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 %px = alloca ptr, align 8 store i32 0, ptr %x, align 4 @@ -2669,10 +2669,10 @@ fn initializing_method_variables_with_alias() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -2682,7 +2682,7 @@ fn initializing_method_variables_with_alias() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2746,7 +2746,7 @@ fn initializing_method_variables_with_reference_to() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -2754,7 +2754,7 @@ fn initializing_method_variables_with_reference_to() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 %px = alloca ptr, align 8 store i32 0, ptr %x, align 4 @@ -2768,10 +2768,10 @@ fn initializing_method_variables_with_reference_to() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -2781,7 +2781,7 @@ fn initializing_method_variables_with_reference_to() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2857,9 +2857,9 @@ fn methods_call_init_functions_for_their_members() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 ret void } @@ -2867,7 +2867,7 @@ fn methods_call_init_functions_for_their_members() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 ret void } @@ -2875,7 +2875,7 @@ fn methods_call_init_functions_for_their_members() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 %fb = alloca %foo, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__foo__init, i64 ptrtoint (ptr getelementptr (%foo, ptr null, i32 1) to i64), i1 false) call void @__init_foo(ptr %fb) @@ -2891,7 +2891,7 @@ fn methods_call_init_functions_for_their_members() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -2901,10 +2901,10 @@ fn methods_call_init_functions_for_their_members() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_bar, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_bar, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_bar, ptr %deref1, i32 0, i32 1 + %baz = getelementptr inbounds nuw %__vtable_bar, ptr %deref1, i32 0, i32 1 store ptr @bar__baz, ptr %baz, align 8 ret void } @@ -2914,12 +2914,12 @@ fn methods_call_init_functions_for_their_members() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %y = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 2 + %y = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 2 %deref2 = load ptr, ptr %self, align 8 - %x = getelementptr inbounds %foo, ptr %deref2, i32 0, i32 1 + %x = getelementptr inbounds nuw %foo, ptr %deref2, i32 0, i32 1 store ptr %x, ptr %y, align 8 ret void } @@ -2929,7 +2929,7 @@ fn methods_call_init_functions_for_their_members() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -3023,9 +3023,9 @@ fn user_fb_init_is_added_and_called_if_it_exists() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 ret void } @@ -3033,9 +3033,9 @@ fn user_fb_init_is_added_and_called_if_it_exists() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 store i16 1, ptr %x, align 2 store i16 2, ptr %y, align 2 ret void @@ -3043,7 +3043,7 @@ fn user_fb_init_is_added_and_called_if_it_exists() { define void @prog(ptr %0) { entry: - %f = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 call void @foo(ptr %f) ret void } @@ -3053,10 +3053,10 @@ fn user_fb_init_is_added_and_called_if_it_exists() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %FB_INIT = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } @@ -3066,7 +3066,7 @@ fn user_fb_init_is_added_and_called_if_it_exists() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -3076,7 +3076,7 @@ fn user_fb_init_is_added_and_called_if_it_exists() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %f = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %f) ret void } @@ -3086,7 +3086,7 @@ fn user_fb_init_is_added_and_called_if_it_exists() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %f = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %f) ret void } @@ -3179,9 +3179,9 @@ fn user_fb_init_in_global_struct() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 ret void } @@ -3189,9 +3189,9 @@ fn user_fb_init_in_global_struct() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 store i16 1, ptr %x, align 2 store i16 2, ptr %y, align 2 ret void @@ -3199,8 +3199,8 @@ fn user_fb_init_in_global_struct() { define void @prog(ptr %0) { entry: - %str = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %f = getelementptr inbounds %bar, ptr %str, i32 0, i32 0 + %str = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds nuw %bar, ptr %str, i32 0, i32 0 call void @foo(ptr %f) ret void } @@ -3210,10 +3210,10 @@ fn user_fb_init_in_global_struct() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %FB_INIT = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } @@ -3223,7 +3223,7 @@ fn user_fb_init_in_global_struct() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %f = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %f) ret void } @@ -3233,7 +3233,7 @@ fn user_fb_init_in_global_struct() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -3243,7 +3243,7 @@ fn user_fb_init_in_global_struct() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %str = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__init_bar(ptr %str) ret void } @@ -3262,7 +3262,7 @@ fn user_fb_init_in_global_struct() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %f = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %f) ret void } @@ -3279,7 +3279,7 @@ fn user_fb_init_in_global_struct() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %str = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %str = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__user_init_bar(ptr %str) ret void } @@ -3346,7 +3346,7 @@ fn user_init_called_when_declared_as_external() { define void @prog(ptr %0) { entry: - %f = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %f = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 call void @foo(ptr %f) ret void } @@ -3356,10 +3356,10 @@ fn user_init_called_when_declared_as_external() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %FB_INIT = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %FB_INIT = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__FB_INIT, ptr %FB_INIT, align 8 ret void } @@ -3376,7 +3376,7 @@ fn user_init_called_when_declared_as_external() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %f = getelementptr inbounds %prog, ptr %deref, i32 0, i32 0 + %f = getelementptr inbounds nuw %prog, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %f) ret void } diff --git a/src/codegen/tests/initialization_test/pou_initializers.rs b/src/codegen/tests/initialization_test/pou_initializers.rs index 8e5caf52b20..7785eae3492 100644 --- a/src/codegen/tests/initialization_test/pou_initializers.rs +++ b/src/codegen/tests/initialization_test/pou_initializers.rs @@ -435,8 +435,8 @@ fn unary_plus_in_initializer() { define void @exp(ptr %0) { entry: - %x = getelementptr inbounds %exp, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %exp, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %exp, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %exp, ptr %0, i32 0, i32 1 ret void } "#); diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap index bc007d1d400..ea2e5ad05e8 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__initial_values_in_global_variables_out_of_order.snap @@ -18,12 +18,12 @@ define void @MyFB(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyFB, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %MyFB, ptr %0, i32 0, i32 0 ret void } define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap index 8de963ffbd2..0d23475d098 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap @@ -15,7 +15,7 @@ target triple = "[filtered]" define void @fb(ptr %0) { entry: - %a = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void } @@ -33,7 +33,7 @@ entry: define void @main(ptr %0) { entry: - %fb0 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %fb0 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %call = call i32 @func(ptr %fb0) ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap index 48373738b8b..c652a9a5571 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap @@ -34,7 +34,7 @@ entry: define void @main(ptr %0) { entry: - %fb0 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %fb0 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %call = call i32 @func(ptr %fb0) ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap index bb73dfeeed8..d6d42ac2581 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap @@ -24,8 +24,8 @@ entry: define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %__target0 = alloca [4 x i32], align 4 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %__target0, ptr align 1 @__myArray__init, i64 ptrtoint (ptr getelementptr ([4 x i32], ptr null, i32 1) to i64), i1 false) call void @target(ptr %__target0) diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap index 5139ac5dc0c..6fcd2f2cecb 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_constant_values_in_pou_variables.snap @@ -16,7 +16,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %my_len = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %my_size = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %my_len = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %my_size = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap index 8e4b6e8b0cc..809dc160df2 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_function_block_pou.snap @@ -17,17 +17,17 @@ define void @FB(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 - %xx = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %FB, ptr %0, i32 0, i32 2 - %yy = getelementptr inbounds %FB, ptr %0, i32 0, i32 3 - %z = getelementptr inbounds %FB, ptr %0, i32 0, i32 4 - %zz = getelementptr inbounds %FB, ptr %0, i32 0, i32 5 + %x = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 0 + %xx = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 2 + %yy = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 3 + %z = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 4 + %zz = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 5 ret void } define void @main(ptr %0) { entry: - %fb = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %fb = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap index 1dff99f3bdd..847baf408e1 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initial_values_in_program_pou.snap @@ -13,11 +13,11 @@ target triple = "[filtered]" define void @Main(ptr %0) { entry: - %x = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 - %xx = getelementptr inbounds %Main, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %Main, ptr %0, i32 0, i32 2 - %yy = getelementptr inbounds %Main, ptr %0, i32 0, i32 3 - %z = getelementptr inbounds %Main, ptr %0, i32 0, i32 4 - %zz = getelementptr inbounds %Main, ptr %0, i32 0, i32 5 + %x = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 0 + %xx = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 2 + %yy = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 3 + %z = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 4 + %zz = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 5 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap index 548a716eb78..6b02f9b42af 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__no_memcpy_for_struct_initialization_in_program.snap @@ -15,6 +15,6 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %a = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap index ad173b1a666..861239fc262 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__array_of_struct_initialization.snap @@ -20,7 +20,7 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %arr = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %alias_arr = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %alias_arr = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap index 0a66f807c46..334f6cffebc 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__initial_values_in_fb_variable.snap @@ -19,15 +19,15 @@ define void @TON(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %a = getelementptr inbounds %TON, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %TON, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %TON, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %TON, ptr %0, i32 0, i32 1 ret void } define void @main(ptr %0) { entry: - %TEN = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %struct1 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %struct2 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %TEN = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %struct1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %struct2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 ret void } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap index 396027f087f..806082f779e 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__type_initializers__skipped_field_members_for_array_of_structs_are_zero_initialized.snap @@ -18,6 +18,6 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %var_init1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var_init1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/oop_tests.rs b/src/codegen/tests/oop_tests.rs index 6b8643f0438..07c710c370d 100644 --- a/src/codegen/tests/oop_tests.rs +++ b/src/codegen/tests/oop_tests.rs @@ -42,10 +42,10 @@ fn members_from_base_class_are_available_in_subclasses() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 - %c = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 3 ret void } @@ -53,7 +53,7 @@ fn members_from_base_class_are_available_in_subclasses() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 ret void } @@ -62,7 +62,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -72,7 +72,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 ret void } @@ -82,7 +82,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -92,11 +92,11 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %__foo) %deref1 = load ptr, ptr %self, align 8 - %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + %__foo2 = getelementptr inbounds nuw %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo2, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -113,7 +113,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %__foo) ret void } @@ -194,9 +194,9 @@ fn write_to_parent_variable_qualified_access() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %fb, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 2 ret void } @@ -204,7 +204,7 @@ fn write_to_parent_variable_qualified_access() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__fb = getelementptr inbounds %fb2, ptr %0, i32 0, i32 0 + %__fb = getelementptr inbounds nuw %fb2, ptr %0, i32 0, i32 0 ret void } @@ -212,10 +212,10 @@ fn write_to_parent_variable_qualified_access() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %myFb = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %__fb = getelementptr inbounds %fb2, ptr %myFb, i32 0, i32 0 - %x = getelementptr inbounds %fb, ptr %__fb, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %myFb = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %__fb = getelementptr inbounds nuw %fb2, ptr %myFb, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %__fb, i32 0, i32 1 store i16 1, ptr %x, align 2 ret void } @@ -225,7 +225,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @fb, ptr %__body, align 8 ret void } @@ -235,7 +235,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @fb2, ptr %__body, align 8 ret void } @@ -245,7 +245,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -255,11 +255,11 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + %__fb = getelementptr inbounds nuw %fb2, ptr %deref, i32 0, i32 0 call void @__init_fb(ptr %__fb) %deref1 = load ptr, ptr %self, align 8 - %__fb2 = getelementptr inbounds %fb2, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %fb, ptr %__fb2, i32 0, i32 0 + %__fb2 = getelementptr inbounds nuw %fb2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %__fb2, i32 0, i32 0 store ptr @__vtable_fb2_instance, ptr %__vtable, align 8 ret void } @@ -269,7 +269,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %deref, i32 0, i32 0 store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } @@ -279,10 +279,10 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + %myFb = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 1 call void @__init_fb2(ptr %myFb) %deref1 = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -299,7 +299,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + %__fb = getelementptr inbounds nuw %fb2, ptr %deref, i32 0, i32 0 call void @__user_init_fb(ptr %__fb) ret void } @@ -330,7 +330,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + %myFb = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 1 call void @__user_init_fb2(ptr %myFb) ret void } @@ -400,8 +400,8 @@ fn write_to_parent_variable_in_instance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } @@ -409,8 +409,8 @@ fn write_to_parent_variable_in_instance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false) ret void } @@ -419,8 +419,8 @@ fn write_to_parent_variable_in_instance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %__foo, i32 0, i32 1 + %__foo = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %__foo, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_1, i32 6, i1 false) ret void } @@ -433,7 +433,7 @@ fn write_to_parent_variable_in_instance() { call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__bar__init, i64 ptrtoint (ptr getelementptr (%bar, ptr null, i32 1) to i64), i1 false) call void @__init_bar(ptr %fb) call void @__user_init_bar(ptr %fb) - %__foo = getelementptr inbounds %bar, ptr %fb, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %fb, i32 0, i32 0 call void @foo__baz(ptr %__foo) call void @bar(ptr %fb) ret void @@ -453,10 +453,10 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %baz = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__baz, ptr %baz, align 8 ret void } @@ -466,10 +466,10 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %baz = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__baz, ptr %baz, align 8 ret void } @@ -479,11 +479,11 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %__foo) %deref1 = load ptr, ptr %self, align 8 - %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + %__foo2 = getelementptr inbounds nuw %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo2, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -493,7 +493,7 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -510,7 +510,7 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %__foo) ret void } @@ -607,9 +607,9 @@ fn array_in_parent_generated() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 2 ret void } @@ -617,9 +617,9 @@ fn array_in_parent_generated() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -627,8 +627,8 @@ fn array_in_parent_generated() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 ret void } @@ -637,27 +637,27 @@ fn array_in_parent_generated() { %arr = alloca [11 x %child], align 8 call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([11 x %child], ptr null, i32 1) to i64), i1 false) %tmpVar = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0 - %__parent = getelementptr inbounds %child, ptr %tmpVar, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 - %a = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 2 + %__parent = getelementptr inbounds nuw %child, ptr %tmpVar, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 0 + %a = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 2 store i16 10, ptr %a, align 2 %tmpVar1 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0 - %__parent2 = getelementptr inbounds %child, ptr %tmpVar1, i32 0, i32 0 - %__grandparent3 = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, ptr %__grandparent3, i32 0, i32 1 + %__parent2 = getelementptr inbounds nuw %child, ptr %tmpVar1, i32 0, i32 0 + %__grandparent3 = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 + %y = getelementptr inbounds nuw %grandparent, ptr %__grandparent3, i32 0, i32 1 %tmpVar4 = getelementptr inbounds [6 x i16], ptr %y, i32 0, i32 0 store i16 20, ptr %tmpVar4, align 2 %tmpVar5 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1 - %__parent6 = getelementptr inbounds %child, ptr %tmpVar5, i32 0, i32 0 - %b = getelementptr inbounds %parent, ptr %__parent6, i32 0, i32 2 + %__parent6 = getelementptr inbounds nuw %child, ptr %tmpVar5, i32 0, i32 0 + %b = getelementptr inbounds nuw %parent, ptr %__parent6, i32 0, i32 2 store i16 30, ptr %b, align 2 %tmpVar7 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1 - %__parent8 = getelementptr inbounds %child, ptr %tmpVar7, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %__parent8, i32 0, i32 1 + %__parent8 = getelementptr inbounds nuw %child, ptr %tmpVar7, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %__parent8, i32 0, i32 1 %tmpVar9 = getelementptr inbounds [11 x i16], ptr %x, i32 0, i32 1 store i16 40, ptr %tmpVar9, align 2 %tmpVar10 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 2 - %z = getelementptr inbounds %child, ptr %tmpVar10, i32 0, i32 1 + %z = getelementptr inbounds nuw %child, ptr %tmpVar10, i32 0, i32 1 %tmpVar11 = getelementptr inbounds [11 x i16], ptr %z, i32 0, i32 2 store i16 50, ptr %tmpVar11, align 2 ret void @@ -671,7 +671,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @grandparent, ptr %__body, align 8 ret void } @@ -681,7 +681,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -691,7 +691,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -701,12 +701,12 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -716,11 +716,11 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__init_grandparent(ptr %__grandparent) %deref1 = load ptr, ptr %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + %__grandparent2 = getelementptr inbounds nuw %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent2, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -730,7 +730,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %deref, i32 0, i32 0 store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } @@ -768,7 +768,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -778,7 +778,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__user_init_grandparent(ptr %__grandparent) ret void } @@ -853,9 +853,9 @@ fn complex_array_access_generated() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 2 ret void } @@ -863,9 +863,9 @@ fn complex_array_access_generated() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -873,14 +873,14 @@ fn complex_array_access_generated() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 - %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 1 - %b = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 0 + %y = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 1 + %b = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %load_b = load i16, ptr %b, align 2 %1 = sext i16 %load_b to i32 - %b1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %b1 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %load_b2 = load i16, ptr %b1, align 2 %2 = sext i16 %load_b2 to i32 %tmpVar = mul i32 %2, 2 @@ -890,8 +890,8 @@ fn complex_array_access_generated() { %load_tmpVar = load i16, ptr %tmpVar5, align 2 %3 = sext i16 %load_tmpVar to i32 %tmpVar6 = add i32 %1, %3 - %__grandparent7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 - %a = getelementptr inbounds %grandparent, ptr %__grandparent7, i32 0, i32 2 + %__grandparent7 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 0 + %a = getelementptr inbounds nuw %grandparent, ptr %__grandparent7, i32 0, i32 2 %load_a = load i16, ptr %a, align 2 %4 = sext i16 %load_a to i32 %tmpVar8 = sub i32 %tmpVar6, %4 @@ -907,7 +907,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @grandparent, ptr %__body, align 8 ret void } @@ -917,7 +917,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -927,7 +927,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -937,11 +937,11 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__init_grandparent(ptr %__grandparent) %deref1 = load ptr, ptr %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + %__grandparent2 = getelementptr inbounds nuw %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent2, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -951,7 +951,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %deref, i32 0, i32 0 store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } @@ -961,12 +961,12 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1004,7 +1004,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1014,7 +1014,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__user_init_grandparent(ptr %__grandparent) ret void } @@ -1115,7 +1115,7 @@ fn this_in_method_call_chain() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 ret void } @@ -1123,7 +1123,7 @@ fn this_in_method_call_chain() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %this, align 8 call void @FB_Test__Increment(ptr %deref) ret void @@ -1133,7 +1133,7 @@ fn this_in_method_call_chain() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 ret void } @@ -1142,13 +1142,13 @@ fn this_in_method_call_chain() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %Step = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + %Step = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 store ptr @FB_Test__Step, ptr %Step, align 8 %deref2 = load ptr, ptr %self, align 8 - %Increment = getelementptr inbounds %__vtable_FB_Test, ptr %deref2, i32 0, i32 2 + %Increment = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref2, i32 0, i32 2 store ptr @FB_Test__Increment, ptr %Increment, align 8 ret void } @@ -1158,7 +1158,7 @@ fn this_in_method_call_chain() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } @@ -1221,14 +1221,14 @@ fn this_in_method_and_body_in_function_block() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %deref = load ptr, ptr %this, align 8 - %val1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %val1 = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 1 %load_val = load i16, ptr %val1, align 2 store i16 %load_val, ptr %val, align 2 %deref2 = load ptr, ptr %this, align 8 - %val3 = getelementptr inbounds %FB_Test, ptr %deref2, i32 0, i32 1 + %val3 = getelementptr inbounds nuw %FB_Test, ptr %deref2, i32 0, i32 1 %load_val4 = load i16, ptr %val, align 2 store i16 %load_val4, ptr %val3, align 2 ret void @@ -1238,12 +1238,12 @@ fn this_in_method_and_body_in_function_block() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %FB_Test.GetVal = alloca i16, align 2 store i16 0, ptr %FB_Test.GetVal, align 2 %deref = load ptr, ptr %this, align 8 - %val1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %val1 = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 1 %load_val = load i16, ptr %val1, align 2 store i16 %load_val, ptr %FB_Test.GetVal, align 2 %FB_Test__GetVal_ret = load i16, ptr %FB_Test.GetVal, align 2 @@ -1255,10 +1255,10 @@ fn this_in_method_and_body_in_function_block() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %GetVal = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + %GetVal = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 store ptr @FB_Test__GetVal, ptr %GetVal, align 8 ret void } @@ -1268,7 +1268,7 @@ fn this_in_method_and_body_in_function_block() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } @@ -1347,8 +1347,8 @@ fn pass_this_to_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 ret void } @@ -1356,8 +1356,8 @@ fn pass_this_to_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %test = alloca %FB_Test2, align 8 %x1 = alloca i16, align 2 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %test, ptr align 1 @__FB_Test2__init, i64 ptrtoint (ptr getelementptr (%FB_Test2, ptr null, i32 1) to i64), i1 false) @@ -1373,7 +1373,7 @@ fn pass_this_to_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test2, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test2, ptr %0, i32 0, i32 0 ret void } @@ -1381,13 +1381,13 @@ fn pass_this_to_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test2, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test2, ptr %0, i32 0, i32 0 %FB_Test2.bar = alloca i16, align 2 %test = alloca ptr, align 8 store ptr %1, ptr %test, align 8 store i16 0, ptr %FB_Test2.bar, align 2 %deref = load ptr, ptr %test, align 8 - %x = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %x = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 store i16 %load_x, ptr %FB_Test2.bar, align 2 %FB_Test2__bar_ret = load i16, ptr %FB_Test2.bar, align 2 @@ -1402,10 +1402,10 @@ fn pass_this_to_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 store ptr @FB_Test__foo, ptr %foo, align 8 ret void } @@ -1415,10 +1415,10 @@ fn pass_this_to_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test2, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 store ptr @FB_Test2__bar, ptr %bar, align 8 ret void } @@ -1428,7 +1428,7 @@ fn pass_this_to_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } @@ -1438,7 +1438,7 @@ fn pass_this_to_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB_Test2, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test2, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test2_instance, ptr %__vtable, align 8 ret void } @@ -1522,8 +1522,8 @@ fn this_with_shadowed_variable() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 ret void } @@ -1531,8 +1531,8 @@ fn this_with_shadowed_variable() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %val1 = alloca i16, align 2 %local_val = alloca i16, align 2 %shadow_val = alloca i16, align 2 @@ -1540,7 +1540,7 @@ fn this_with_shadowed_variable() { store i16 0, ptr %local_val, align 2 store i16 0, ptr %shadow_val, align 2 %deref = load ptr, ptr %this, align 8 - %val2 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %val2 = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 1 %load_val = load i16, ptr %val2, align 2 store i16 %load_val, ptr %local_val, align 2 %load_val3 = load i16, ptr %val1, align 2 @@ -1553,10 +1553,10 @@ fn this_with_shadowed_variable() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %shadow_val = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + %shadow_val = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 store ptr @FB_Test__shadow_val, ptr %shadow_val, align 8 ret void } @@ -1566,7 +1566,7 @@ fn this_with_shadowed_variable() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } @@ -1630,8 +1630,8 @@ fn this_calling_function_and_passing_this() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %1 = load ptr, ptr %this, align 8 %call = call i16 @foo(ptr %1) ret void @@ -1644,7 +1644,7 @@ fn this_calling_function_and_passing_this() { store ptr %0, ptr %pfb, align 8 store i16 0, ptr %foo, align 2 %deref = load ptr, ptr %pfb, align 8 - %x = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %x = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 store i16 %load_x, ptr %foo, align 2 %foo_ret = load i16, ptr %foo, align 2 @@ -1656,7 +1656,7 @@ fn this_calling_function_and_passing_this() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test, ptr %__body, align 8 ret void } @@ -1666,7 +1666,7 @@ fn this_calling_function_and_passing_this() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } @@ -1736,8 +1736,8 @@ fn this_in_property_and_calling_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 ret void } @@ -1745,12 +1745,12 @@ fn this_in_property_and_calling_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %FB_Test.DoubleX = alloca i16, align 2 store i16 0, ptr %FB_Test.DoubleX, align 2 %deref = load ptr, ptr %this, align 8 - %x1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %x1 = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 1 %load_x = load i16, ptr %x1, align 2 %1 = sext i16 %load_x to i32 %tmpVar = mul i32 2, %1 @@ -1764,8 +1764,8 @@ fn this_in_property_and_calling_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %FB_Test.__get_Value = alloca i16, align 2 %Value = alloca i16, align 2 store i16 0, ptr %Value, align 2 @@ -1783,12 +1783,12 @@ fn this_in_property_and_calling_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %Value = alloca i16, align 2 store i16 %1, ptr %Value, align 2 %deref = load ptr, ptr %this, align 8 - %x1 = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 1 + %x1 = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 1 %load_Value = load i16, ptr %Value, align 2 store i16 %load_Value, ptr %x1, align 2 ret void @@ -1799,16 +1799,16 @@ fn this_in_property_and_calling_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %DoubleX = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + %DoubleX = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 store ptr @FB_Test__DoubleX, ptr %DoubleX, align 8 %deref2 = load ptr, ptr %self, align 8 - %__get_Value = getelementptr inbounds %__vtable_FB_Test, ptr %deref2, i32 0, i32 2 + %__get_Value = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref2, i32 0, i32 2 store ptr @FB_Test____get_Value, ptr %__get_Value, align 8 %deref3 = load ptr, ptr %self, align 8 - %__set_Value = getelementptr inbounds %__vtable_FB_Test, ptr %deref3, i32 0, i32 3 + %__set_Value = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref3, i32 0, i32 3 store ptr @FB_Test____set_Value, ptr %__set_Value, align 8 ret void } @@ -1818,7 +1818,7 @@ fn this_in_property_and_calling_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } @@ -1881,8 +1881,8 @@ fn this_with_self_pointer() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %refToSelf = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %refToSelf = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 ret void } @@ -1890,8 +1890,8 @@ fn this_with_self_pointer() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 0 - %refToSelf = getelementptr inbounds %FB_Test, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 0 + %refToSelf = getelementptr inbounds nuw %FB_Test, ptr %0, i32 0, i32 1 %deref = load ptr, ptr %this, align 8 store ptr %deref, ptr %refToSelf, align 8 %deref1 = load ptr, ptr %this, align 8 @@ -1906,10 +1906,10 @@ fn this_with_self_pointer() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @FB_Test, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %InitRef = getelementptr inbounds %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 + %InitRef = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref1, i32 0, i32 1 store ptr @FB_Test__InitRef, ptr %InitRef, align 8 ret void } @@ -1919,7 +1919,7 @@ fn this_with_self_pointer() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %__vtable_FB_Test, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %__vtable_FB_Test, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_Test_instance, ptr %__vtable, align 8 ret void } @@ -1980,10 +1980,10 @@ fn this_in_variable_initialization() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 - %self = getelementptr inbounds %FB, ptr %0, i32 0, i32 2 - %y = getelementptr inbounds %FB, ptr %0, i32 0, i32 3 + %__vtable = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 1 + %self = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 2 + %y = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 3 ret void } @@ -1992,7 +1992,7 @@ fn this_in_variable_initialization() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_FB, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_FB, ptr %deref, i32 0, i32 0 store ptr @FB, ptr %__body, align 8 ret void } @@ -2002,7 +2002,7 @@ fn this_in_variable_initialization() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %FB, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %FB, ptr %deref, i32 0, i32 0 store ptr @__vtable_FB_instance, ptr %__vtable, align 8 ret void } @@ -2060,7 +2060,7 @@ fn this_in_action_in_functionblock() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void } @@ -2068,7 +2068,7 @@ fn this_in_action_in_functionblock() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %this, align 8 call void @fb(ptr %deref) ret void @@ -2079,7 +2079,7 @@ fn this_in_action_in_functionblock() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @fb, ptr %__body, align 8 ret void } @@ -2089,7 +2089,7 @@ fn this_in_action_in_functionblock() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } @@ -2146,7 +2146,7 @@ fn this_calling_functionblock_body_from_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void } @@ -2154,7 +2154,7 @@ fn this_calling_functionblock_body_from_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 %fb.foo = alloca i16, align 2 store i16 0, ptr %fb.foo, align 2 %deref = load ptr, ptr %this, align 8 @@ -2168,10 +2168,10 @@ fn this_calling_functionblock_body_from_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @fb, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_fb, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_fb, ptr %deref1, i32 0, i32 1 store ptr @fb__foo, ptr %foo, align 8 ret void } @@ -2181,7 +2181,7 @@ fn this_calling_functionblock_body_from_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %deref, i32 0, i32 0 store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } @@ -2255,7 +2255,7 @@ fn fb_extension_with_output() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -2263,7 +2263,7 @@ fn fb_extension_with_output() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %foo.met1 = alloca i16, align 2 %mandatoryInput = alloca i16, align 2 store i16 %1, ptr %mandatoryInput, align 2 @@ -2280,12 +2280,12 @@ fn fb_extension_with_output() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__foo = getelementptr inbounds %foo2, ptr %0, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %foo2, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %this, align 8 - %__foo1 = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo1, i32 0, i32 0 + %__foo1 = getelementptr inbounds nuw %foo2, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo1, i32 0, i32 0 %deref2 = load ptr, ptr %__vtable, align 8 - %met1 = getelementptr inbounds %__vtable_foo2, ptr %deref2, i32 0, i32 1 + %met1 = getelementptr inbounds nuw %__vtable_foo2, ptr %deref2, i32 0, i32 1 %1 = load ptr, ptr %met1, align 8 %deref3 = load ptr, ptr %this, align 8 %2 = alloca i16, align 2 @@ -2298,10 +2298,10 @@ fn fb_extension_with_output() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %met1 = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__met1, ptr %met1, align 8 ret void } @@ -2311,10 +2311,10 @@ fn fb_extension_with_output() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo2, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %met1 = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__met1, ptr %met1, align 8 ret void } @@ -2324,7 +2324,7 @@ fn fb_extension_with_output() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2334,11 +2334,11 @@ fn fb_extension_with_output() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %foo2, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %__foo) %deref1 = load ptr, ptr %self, align 8 - %__foo2 = getelementptr inbounds %foo2, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + %__foo2 = getelementptr inbounds nuw %foo2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo2, i32 0, i32 0 store ptr @__vtable_foo2_instance, ptr %__vtable, align 8 ret void } @@ -2348,7 +2348,7 @@ fn fb_extension_with_output() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %foo2, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %__foo) ret void } @@ -2444,7 +2444,7 @@ fn function_with_output_used_in_main_by_extension() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -2452,7 +2452,7 @@ fn function_with_output_used_in_main_by_extension() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %foo.met1 = alloca i16, align 2 %mandatoryInput = alloca i16, align 2 store i16 %1, ptr %mandatoryInput, align 2 @@ -2477,8 +2477,8 @@ fn function_with_output_used_in_main_by_extension() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__foo = getelementptr inbounds %foo2, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo2, ptr %0, i32 0, i32 1 + %__foo = getelementptr inbounds nuw %foo2, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo2, ptr %0, i32 0, i32 1 ret void } @@ -2497,7 +2497,7 @@ fn function_with_output_used_in_main_by_extension() { call void @__user_init_foo(ptr %foo_inst) call void @__user_init_foo2(ptr %foo2_inst) %call = call i16 @foo__met1(ptr %foo_inst, i16 1, i16 5, ptr %out) - %__foo = getelementptr inbounds %foo2, ptr %foo2_inst, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %foo2, ptr %foo2_inst, i32 0, i32 0 %call1 = call i16 @foo__met1(ptr %__foo, i16 2, i16 5, ptr %out) %main_ret = load i32, ptr %main, align 4 ret i32 %main_ret @@ -2511,10 +2511,10 @@ fn function_with_output_used_in_main_by_extension() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %met1 = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__met1, ptr %met1, align 8 ret void } @@ -2524,10 +2524,10 @@ fn function_with_output_used_in_main_by_extension() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo2, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %met1 = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %met1 = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__met1, ptr %met1, align 8 ret void } @@ -2537,11 +2537,11 @@ fn function_with_output_used_in_main_by_extension() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %foo2, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %__foo) %deref1 = load ptr, ptr %self, align 8 - %__foo2 = getelementptr inbounds %foo2, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + %__foo2 = getelementptr inbounds nuw %foo2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo2, i32 0, i32 0 store ptr @__vtable_foo2_instance, ptr %__vtable, align 8 ret void } @@ -2551,7 +2551,7 @@ fn function_with_output_used_in_main_by_extension() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -2561,7 +2561,7 @@ fn function_with_output_used_in_main_by_extension() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %foo2, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %foo2, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %__foo) ret void } diff --git a/src/codegen/tests/oop_tests/debug_tests.rs b/src/codegen/tests/oop_tests/debug_tests.rs index d9bc7cc90c7..6a66353e71a 100644 --- a/src/codegen/tests/oop_tests/debug_tests.rs +++ b/src/codegen/tests/oop_tests/debug_tests.rs @@ -41,10 +41,10 @@ fn members_from_base_class_are_available_in_subclasses() { #dbg_declare(ptr %0, !36, !DIExpression(), !37) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 - %c = getelementptr inbounds %foo, ptr %0, i32 0, i32 3 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 3 ret void, !dbg !37 } @@ -53,7 +53,7 @@ fn members_from_base_class_are_available_in_subclasses() { #dbg_declare(ptr %0, !41, !DIExpression(), !42) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 ret void, !dbg !42 } @@ -62,7 +62,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -72,7 +72,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 ret void } @@ -82,7 +82,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -92,11 +92,11 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %__foo) %deref1 = load ptr, ptr %self, align 8 - %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + %__foo2 = getelementptr inbounds nuw %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo2, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -113,7 +113,7 @@ fn members_from_base_class_are_available_in_subclasses() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %__foo) ret void } @@ -242,9 +242,9 @@ fn write_to_parent_variable_qualified_access() { #dbg_declare(ptr %0, !36, !DIExpression(), !37) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %fb, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 2 ret void, !dbg !37 } @@ -253,7 +253,7 @@ fn write_to_parent_variable_qualified_access() { #dbg_declare(ptr %0, !41, !DIExpression(), !42) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__fb = getelementptr inbounds %fb2, ptr %0, i32 0, i32 0 + %__fb = getelementptr inbounds nuw %fb2, ptr %0, i32 0, i32 0 ret void, !dbg !42 } @@ -262,10 +262,10 @@ fn write_to_parent_variable_qualified_access() { #dbg_declare(ptr %0, !46, !DIExpression(), !47) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %myFb = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %__fb = getelementptr inbounds %fb2, ptr %myFb, i32 0, i32 0, !dbg !47 - %x = getelementptr inbounds %fb, ptr %__fb, i32 0, i32 1, !dbg !47 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %myFb = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %__fb = getelementptr inbounds nuw %fb2, ptr %myFb, i32 0, i32 0, !dbg !47 + %x = getelementptr inbounds nuw %fb, ptr %__fb, i32 0, i32 1, !dbg !47 store i16 1, ptr %x, align 2, !dbg !47 ret void, !dbg !48 } @@ -275,7 +275,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @fb, ptr %__body, align 8 ret void } @@ -285,7 +285,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @fb2, ptr %__body, align 8 ret void } @@ -295,7 +295,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_fb, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_fb, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -305,11 +305,11 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + %__fb = getelementptr inbounds nuw %fb2, ptr %deref, i32 0, i32 0 call void @__init_fb(ptr %__fb) %deref1 = load ptr, ptr %self, align 8 - %__fb2 = getelementptr inbounds %fb2, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %fb, ptr %__fb2, i32 0, i32 0 + %__fb2 = getelementptr inbounds nuw %fb2, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %__fb2, i32 0, i32 0 store ptr @__vtable_fb2_instance, ptr %__vtable, align 8 ret void } @@ -319,7 +319,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %fb, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %fb, ptr %deref, i32 0, i32 0 store ptr @__vtable_fb_instance, ptr %__vtable, align 8 ret void } @@ -329,10 +329,10 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + %myFb = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 1 call void @__init_fb2(ptr %myFb) %deref1 = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -349,7 +349,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__fb = getelementptr inbounds %fb2, ptr %deref, i32 0, i32 0 + %__fb = getelementptr inbounds nuw %fb2, ptr %deref, i32 0, i32 0 call void @__user_init_fb(ptr %__fb) ret void } @@ -380,7 +380,7 @@ fn write_to_parent_variable_qualified_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %myFb = getelementptr inbounds %foo, ptr %deref, i32 0, i32 1 + %myFb = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 1 call void @__user_init_fb2(ptr %myFb) ret void } @@ -504,8 +504,8 @@ fn write_to_parent_variable_in_instance() { #dbg_declare(ptr %0, !30, !DIExpression(), !31) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void, !dbg !31 } @@ -514,8 +514,8 @@ fn write_to_parent_variable_in_instance() { #dbg_declare(ptr %0, !33, !DIExpression(), !34) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_0, i32 6, i1 false), !dbg !34 ret void, !dbg !35 } @@ -525,8 +525,8 @@ fn write_to_parent_variable_in_instance() { #dbg_declare(ptr %0, !39, !DIExpression(), !40) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %__foo, i32 0, i32 1, !dbg !40 + %__foo = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %__foo, i32 0, i32 1, !dbg !40 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %s, ptr align 1 @utf08_literal_1, i32 6, i1 false), !dbg !40 ret void, !dbg !41 } @@ -541,7 +541,7 @@ fn write_to_parent_variable_in_instance() { call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__bar__init, i64 ptrtoint (ptr getelementptr (%bar, ptr null, i32 1) to i64), i1 false) call void @__init_bar(ptr %fb), !dbg !49 call void @__user_init_bar(ptr %fb), !dbg !49 - %__foo = getelementptr inbounds %bar, ptr %fb, i32 0, i32 0, !dbg !49 + %__foo = getelementptr inbounds nuw %bar, ptr %fb, i32 0, i32 0, !dbg !49 call void @foo__baz(ptr %__foo), !dbg !50 call void @bar(ptr %fb), !dbg !51 ret void, !dbg !52 @@ -561,10 +561,10 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %baz = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__baz, ptr %baz, align 8 ret void } @@ -574,10 +574,10 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %baz = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__baz, ptr %baz, align 8 ret void } @@ -587,11 +587,11 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %__foo) %deref1 = load ptr, ptr %self, align 8 - %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + %__foo2 = getelementptr inbounds nuw %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo2, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -601,7 +601,7 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -618,7 +618,7 @@ fn write_to_parent_variable_in_instance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %__foo) ret void } @@ -773,9 +773,9 @@ fn array_in_parent_generated() { #dbg_declare(ptr %0, !42, !DIExpression(), !43) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 2 ret void, !dbg !43 } @@ -784,9 +784,9 @@ fn array_in_parent_generated() { #dbg_declare(ptr %0, !47, !DIExpression(), !48) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void, !dbg !48 } @@ -795,8 +795,8 @@ fn array_in_parent_generated() { #dbg_declare(ptr %0, !52, !DIExpression(), !53) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 ret void, !dbg !53 } @@ -806,27 +806,27 @@ fn array_in_parent_generated() { #dbg_declare(ptr %arr, !57, !DIExpression(), !59) call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([11 x %child], ptr null, i32 1) to i64), i1 false) %tmpVar = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0, !dbg !60 - %__parent = getelementptr inbounds %child, ptr %tmpVar, i32 0, i32 0, !dbg !60 - %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0, !dbg !60 - %a = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 2, !dbg !60 + %__parent = getelementptr inbounds nuw %child, ptr %tmpVar, i32 0, i32 0, !dbg !60 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 0, !dbg !60 + %a = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 2, !dbg !60 store i16 10, ptr %a, align 2, !dbg !60 %tmpVar1 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 0, !dbg !61 - %__parent2 = getelementptr inbounds %child, ptr %tmpVar1, i32 0, i32 0, !dbg !61 - %__grandparent3 = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0, !dbg !61 - %y = getelementptr inbounds %grandparent, ptr %__grandparent3, i32 0, i32 1, !dbg !61 + %__parent2 = getelementptr inbounds nuw %child, ptr %tmpVar1, i32 0, i32 0, !dbg !61 + %__grandparent3 = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0, !dbg !61 + %y = getelementptr inbounds nuw %grandparent, ptr %__grandparent3, i32 0, i32 1, !dbg !61 %tmpVar4 = getelementptr inbounds [6 x i16], ptr %y, i32 0, i32 0, !dbg !61 store i16 20, ptr %tmpVar4, align 2, !dbg !61 %tmpVar5 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1, !dbg !62 - %__parent6 = getelementptr inbounds %child, ptr %tmpVar5, i32 0, i32 0, !dbg !62 - %b = getelementptr inbounds %parent, ptr %__parent6, i32 0, i32 2, !dbg !62 + %__parent6 = getelementptr inbounds nuw %child, ptr %tmpVar5, i32 0, i32 0, !dbg !62 + %b = getelementptr inbounds nuw %parent, ptr %__parent6, i32 0, i32 2, !dbg !62 store i16 30, ptr %b, align 2, !dbg !62 %tmpVar7 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 1, !dbg !63 - %__parent8 = getelementptr inbounds %child, ptr %tmpVar7, i32 0, i32 0, !dbg !63 - %x = getelementptr inbounds %parent, ptr %__parent8, i32 0, i32 1, !dbg !63 + %__parent8 = getelementptr inbounds nuw %child, ptr %tmpVar7, i32 0, i32 0, !dbg !63 + %x = getelementptr inbounds nuw %parent, ptr %__parent8, i32 0, i32 1, !dbg !63 %tmpVar9 = getelementptr inbounds [11 x i16], ptr %x, i32 0, i32 1, !dbg !63 store i16 40, ptr %tmpVar9, align 2, !dbg !63 %tmpVar10 = getelementptr inbounds [11 x %child], ptr %arr, i32 0, i32 2, !dbg !64 - %z = getelementptr inbounds %child, ptr %tmpVar10, i32 0, i32 1, !dbg !64 + %z = getelementptr inbounds nuw %child, ptr %tmpVar10, i32 0, i32 1, !dbg !64 %tmpVar11 = getelementptr inbounds [11 x i16], ptr %z, i32 0, i32 2, !dbg !64 store i16 50, ptr %tmpVar11, align 2, !dbg !64 ret void, !dbg !65 @@ -840,7 +840,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @grandparent, ptr %__body, align 8 ret void } @@ -850,7 +850,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -860,7 +860,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -870,12 +870,12 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -885,11 +885,11 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__init_grandparent(ptr %__grandparent) %deref1 = load ptr, ptr %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + %__grandparent2 = getelementptr inbounds nuw %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent2, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -899,7 +899,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %deref, i32 0, i32 0 store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } @@ -937,7 +937,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -947,7 +947,7 @@ fn array_in_parent_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__user_init_grandparent(ptr %__grandparent) ret void } @@ -1093,9 +1093,9 @@ fn complex_array_access_generated() { #dbg_declare(ptr %0, !42, !DIExpression(), !43) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 - %a = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 2 ret void, !dbg !43 } @@ -1104,9 +1104,9 @@ fn complex_array_access_generated() { #dbg_declare(ptr %0, !47, !DIExpression(), !48) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void, !dbg !48 } @@ -1115,14 +1115,14 @@ fn complex_array_access_generated() { #dbg_declare(ptr %0, !52, !DIExpression(), !53) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 - %__grandparent = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0, !dbg !53 - %y = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 1, !dbg !53 - %b = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2, !dbg !53 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 0, !dbg !53 + %y = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 1, !dbg !53 + %b = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2, !dbg !53 %load_b = load i16, ptr %b, align 2, !dbg !53 %1 = sext i16 %load_b to i32, !dbg !53 - %b1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2, !dbg !53 + %b1 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2, !dbg !53 %load_b2 = load i16, ptr %b1, align 2, !dbg !53 %2 = sext i16 %load_b2 to i32, !dbg !53 %tmpVar = mul i32 %2, 2, !dbg !53 @@ -1132,8 +1132,8 @@ fn complex_array_access_generated() { %load_tmpVar = load i16, ptr %tmpVar5, align 2, !dbg !53 %3 = sext i16 %load_tmpVar to i32, !dbg !53 %tmpVar6 = add i32 %1, %3, !dbg !53 - %__grandparent7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0, !dbg !53 - %a = getelementptr inbounds %grandparent, ptr %__grandparent7, i32 0, i32 2, !dbg !53 + %__grandparent7 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 0, !dbg !53 + %a = getelementptr inbounds nuw %grandparent, ptr %__grandparent7, i32 0, i32 2, !dbg !53 %load_a = load i16, ptr %a, align 2, !dbg !53 %4 = sext i16 %load_a to i32, !dbg !53 %tmpVar8 = sub i32 %tmpVar6, %4, !dbg !53 @@ -1149,7 +1149,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @grandparent, ptr %__body, align 8 ret void } @@ -1159,7 +1159,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -1169,7 +1169,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -1179,11 +1179,11 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__init_grandparent(ptr %__grandparent) %deref1 = load ptr, ptr %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + %__grandparent2 = getelementptr inbounds nuw %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent2, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -1193,7 +1193,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %deref, i32 0, i32 0 store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } @@ -1203,12 +1203,12 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1246,7 +1246,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1256,7 +1256,7 @@ fn complex_array_access_generated() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__user_init_grandparent(ptr %__grandparent) ret void } @@ -1370,7 +1370,7 @@ fn function_block_method_debug_info() { #dbg_declare(ptr %0, !24, !DIExpression(), !25) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void, !dbg !25 } @@ -1379,7 +1379,7 @@ fn function_block_method_debug_info() { #dbg_declare(ptr %0, !27, !DIExpression(), !28) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void, !dbg !28 } @@ -1388,7 +1388,7 @@ fn function_block_method_debug_info() { #dbg_declare(ptr %0, !32, !DIExpression(), !33) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__foo = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 ret void, !dbg !33 } @@ -1397,10 +1397,10 @@ fn function_block_method_debug_info() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %baz = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__baz, ptr %baz, align 8 ret void } @@ -1410,10 +1410,10 @@ fn function_block_method_debug_info() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %baz = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__baz, ptr %baz, align 8 ret void } @@ -1423,7 +1423,7 @@ fn function_block_method_debug_info() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -1433,11 +1433,11 @@ fn function_block_method_debug_info() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__init_foo(ptr %__foo) %deref1 = load ptr, ptr %self, align 8 - %__foo2 = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %foo, ptr %__foo2, i32 0, i32 0 + %__foo2 = getelementptr inbounds nuw %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %__foo2, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -1454,7 +1454,7 @@ fn function_block_method_debug_info() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__foo = getelementptr inbounds %bar, ptr %deref, i32 0, i32 0 + %__foo = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 0 call void @__user_init_foo(ptr %__foo) ret void } @@ -1613,8 +1613,8 @@ END_FUNCTION #dbg_declare(ptr %0, !34, !DIExpression(), !35) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void, !dbg !35 } @@ -1623,8 +1623,8 @@ END_FUNCTION #dbg_declare(ptr %0, !39, !DIExpression(), !40) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 ret void, !dbg !40 } @@ -1633,8 +1633,8 @@ END_FUNCTION #dbg_declare(ptr %0, !44, !DIExpression(), !45) %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__child = getelementptr inbounds %grandchild, ptr %0, i32 0, i32 0 - %c = getelementptr inbounds %grandchild, ptr %0, i32 0, i32 1 + %__child = getelementptr inbounds nuw %grandchild, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds nuw %grandchild, ptr %0, i32 0, i32 1 ret void, !dbg !45 } @@ -1667,87 +1667,87 @@ END_FUNCTION call void @__user_init_parent(ptr %parent1), !dbg !68 call void @__user_init_child(ptr %child1), !dbg !68 call void @__user_init_grandchild(ptr %grandchild1), !dbg !68 - %a = getelementptr inbounds %parent, ptr %parent1, i32 0, i32 1, !dbg !69 + %a = getelementptr inbounds nuw %parent, ptr %parent1, i32 0, i32 1, !dbg !69 store i32 1, ptr %a, align 4, !dbg !69 - %__parent = getelementptr inbounds %child, ptr %child1, i32 0, i32 0, !dbg !70 - %a1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1, !dbg !70 + %__parent = getelementptr inbounds nuw %child, ptr %child1, i32 0, i32 0, !dbg !70 + %a1 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1, !dbg !70 store i32 2, ptr %a1, align 4, !dbg !70 - %b = getelementptr inbounds %child, ptr %child1, i32 0, i32 1, !dbg !71 + %b = getelementptr inbounds nuw %child, ptr %child1, i32 0, i32 1, !dbg !71 store i32 3, ptr %b, align 4, !dbg !71 - %__child = getelementptr inbounds %grandchild, ptr %grandchild1, i32 0, i32 0, !dbg !72 - %__parent2 = getelementptr inbounds %child, ptr %__child, i32 0, i32 0, !dbg !72 - %a3 = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 1, !dbg !72 + %__child = getelementptr inbounds nuw %grandchild, ptr %grandchild1, i32 0, i32 0, !dbg !72 + %__parent2 = getelementptr inbounds nuw %child, ptr %__child, i32 0, i32 0, !dbg !72 + %a3 = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 1, !dbg !72 store i32 4, ptr %a3, align 4, !dbg !72 - %__child4 = getelementptr inbounds %grandchild, ptr %grandchild1, i32 0, i32 0, !dbg !73 - %b5 = getelementptr inbounds %child, ptr %__child4, i32 0, i32 1, !dbg !73 + %__child4 = getelementptr inbounds nuw %grandchild, ptr %grandchild1, i32 0, i32 0, !dbg !73 + %b5 = getelementptr inbounds nuw %child, ptr %__child4, i32 0, i32 1, !dbg !73 store i32 5, ptr %b5, align 4, !dbg !73 - %c = getelementptr inbounds %grandchild, ptr %grandchild1, i32 0, i32 1, !dbg !74 + %c = getelementptr inbounds nuw %grandchild, ptr %grandchild1, i32 0, i32 1, !dbg !74 store i32 6, ptr %c, align 4, !dbg !74 %tmpVar = getelementptr inbounds [3 x %parent], ptr %array_of_parent, i32 0, i32 0, !dbg !75 - %a6 = getelementptr inbounds %parent, ptr %tmpVar, i32 0, i32 1, !dbg !75 + %a6 = getelementptr inbounds nuw %parent, ptr %tmpVar, i32 0, i32 1, !dbg !75 store i32 7, ptr %a6, align 4, !dbg !75 %tmpVar7 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 0, !dbg !76 - %__parent8 = getelementptr inbounds %child, ptr %tmpVar7, i32 0, i32 0, !dbg !76 - %a9 = getelementptr inbounds %parent, ptr %__parent8, i32 0, i32 1, !dbg !76 + %__parent8 = getelementptr inbounds nuw %child, ptr %tmpVar7, i32 0, i32 0, !dbg !76 + %a9 = getelementptr inbounds nuw %parent, ptr %__parent8, i32 0, i32 1, !dbg !76 store i32 8, ptr %a9, align 4, !dbg !76 %tmpVar10 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 0, !dbg !77 - %b11 = getelementptr inbounds %child, ptr %tmpVar10, i32 0, i32 1, !dbg !77 + %b11 = getelementptr inbounds nuw %child, ptr %tmpVar10, i32 0, i32 1, !dbg !77 store i32 9, ptr %b11, align 4, !dbg !77 %tmpVar12 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 0, !dbg !78 - %__child13 = getelementptr inbounds %grandchild, ptr %tmpVar12, i32 0, i32 0, !dbg !78 - %__parent14 = getelementptr inbounds %child, ptr %__child13, i32 0, i32 0, !dbg !78 - %a15 = getelementptr inbounds %parent, ptr %__parent14, i32 0, i32 1, !dbg !78 + %__child13 = getelementptr inbounds nuw %grandchild, ptr %tmpVar12, i32 0, i32 0, !dbg !78 + %__parent14 = getelementptr inbounds nuw %child, ptr %__child13, i32 0, i32 0, !dbg !78 + %a15 = getelementptr inbounds nuw %parent, ptr %__parent14, i32 0, i32 1, !dbg !78 store i32 10, ptr %a15, align 4, !dbg !78 %tmpVar16 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 0, !dbg !79 - %__child17 = getelementptr inbounds %grandchild, ptr %tmpVar16, i32 0, i32 0, !dbg !79 - %b18 = getelementptr inbounds %child, ptr %__child17, i32 0, i32 1, !dbg !79 + %__child17 = getelementptr inbounds nuw %grandchild, ptr %tmpVar16, i32 0, i32 0, !dbg !79 + %b18 = getelementptr inbounds nuw %child, ptr %__child17, i32 0, i32 1, !dbg !79 store i32 11, ptr %b18, align 4, !dbg !79 %tmpVar19 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 0, !dbg !80 - %c20 = getelementptr inbounds %grandchild, ptr %tmpVar19, i32 0, i32 1, !dbg !80 + %c20 = getelementptr inbounds nuw %grandchild, ptr %tmpVar19, i32 0, i32 1, !dbg !80 store i32 12, ptr %c20, align 4, !dbg !80 %tmpVar21 = getelementptr inbounds [3 x %parent], ptr %array_of_parent, i32 0, i32 1, !dbg !81 - %a22 = getelementptr inbounds %parent, ptr %tmpVar21, i32 0, i32 1, !dbg !81 + %a22 = getelementptr inbounds nuw %parent, ptr %tmpVar21, i32 0, i32 1, !dbg !81 store i32 13, ptr %a22, align 4, !dbg !81 %tmpVar23 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 1, !dbg !82 - %__parent24 = getelementptr inbounds %child, ptr %tmpVar23, i32 0, i32 0, !dbg !82 - %a25 = getelementptr inbounds %parent, ptr %__parent24, i32 0, i32 1, !dbg !82 + %__parent24 = getelementptr inbounds nuw %child, ptr %tmpVar23, i32 0, i32 0, !dbg !82 + %a25 = getelementptr inbounds nuw %parent, ptr %__parent24, i32 0, i32 1, !dbg !82 store i32 14, ptr %a25, align 4, !dbg !82 %tmpVar26 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 1, !dbg !83 - %b27 = getelementptr inbounds %child, ptr %tmpVar26, i32 0, i32 1, !dbg !83 + %b27 = getelementptr inbounds nuw %child, ptr %tmpVar26, i32 0, i32 1, !dbg !83 store i32 15, ptr %b27, align 4, !dbg !83 %tmpVar28 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 1, !dbg !84 - %__child29 = getelementptr inbounds %grandchild, ptr %tmpVar28, i32 0, i32 0, !dbg !84 - %__parent30 = getelementptr inbounds %child, ptr %__child29, i32 0, i32 0, !dbg !84 - %a31 = getelementptr inbounds %parent, ptr %__parent30, i32 0, i32 1, !dbg !84 + %__child29 = getelementptr inbounds nuw %grandchild, ptr %tmpVar28, i32 0, i32 0, !dbg !84 + %__parent30 = getelementptr inbounds nuw %child, ptr %__child29, i32 0, i32 0, !dbg !84 + %a31 = getelementptr inbounds nuw %parent, ptr %__parent30, i32 0, i32 1, !dbg !84 store i32 16, ptr %a31, align 4, !dbg !84 %tmpVar32 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 1, !dbg !85 - %__child33 = getelementptr inbounds %grandchild, ptr %tmpVar32, i32 0, i32 0, !dbg !85 - %b34 = getelementptr inbounds %child, ptr %__child33, i32 0, i32 1, !dbg !85 + %__child33 = getelementptr inbounds nuw %grandchild, ptr %tmpVar32, i32 0, i32 0, !dbg !85 + %b34 = getelementptr inbounds nuw %child, ptr %__child33, i32 0, i32 1, !dbg !85 store i32 17, ptr %b34, align 4, !dbg !85 %tmpVar35 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 1, !dbg !86 - %c36 = getelementptr inbounds %grandchild, ptr %tmpVar35, i32 0, i32 1, !dbg !86 + %c36 = getelementptr inbounds nuw %grandchild, ptr %tmpVar35, i32 0, i32 1, !dbg !86 store i32 18, ptr %c36, align 4, !dbg !86 %tmpVar37 = getelementptr inbounds [3 x %parent], ptr %array_of_parent, i32 0, i32 2, !dbg !87 - %a38 = getelementptr inbounds %parent, ptr %tmpVar37, i32 0, i32 1, !dbg !87 + %a38 = getelementptr inbounds nuw %parent, ptr %tmpVar37, i32 0, i32 1, !dbg !87 store i32 19, ptr %a38, align 4, !dbg !87 %tmpVar39 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 2, !dbg !88 - %__parent40 = getelementptr inbounds %child, ptr %tmpVar39, i32 0, i32 0, !dbg !88 - %a41 = getelementptr inbounds %parent, ptr %__parent40, i32 0, i32 1, !dbg !88 + %__parent40 = getelementptr inbounds nuw %child, ptr %tmpVar39, i32 0, i32 0, !dbg !88 + %a41 = getelementptr inbounds nuw %parent, ptr %__parent40, i32 0, i32 1, !dbg !88 store i32 20, ptr %a41, align 4, !dbg !88 %tmpVar42 = getelementptr inbounds [3 x %child], ptr %array_of_child, i32 0, i32 2, !dbg !89 - %b43 = getelementptr inbounds %child, ptr %tmpVar42, i32 0, i32 1, !dbg !89 + %b43 = getelementptr inbounds nuw %child, ptr %tmpVar42, i32 0, i32 1, !dbg !89 store i32 21, ptr %b43, align 4, !dbg !89 %tmpVar44 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 2, !dbg !90 - %__child45 = getelementptr inbounds %grandchild, ptr %tmpVar44, i32 0, i32 0, !dbg !90 - %__parent46 = getelementptr inbounds %child, ptr %__child45, i32 0, i32 0, !dbg !90 - %a47 = getelementptr inbounds %parent, ptr %__parent46, i32 0, i32 1, !dbg !90 + %__child45 = getelementptr inbounds nuw %grandchild, ptr %tmpVar44, i32 0, i32 0, !dbg !90 + %__parent46 = getelementptr inbounds nuw %child, ptr %__child45, i32 0, i32 0, !dbg !90 + %a47 = getelementptr inbounds nuw %parent, ptr %__parent46, i32 0, i32 1, !dbg !90 store i32 22, ptr %a47, align 4, !dbg !90 %tmpVar48 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 2, !dbg !91 - %__child49 = getelementptr inbounds %grandchild, ptr %tmpVar48, i32 0, i32 0, !dbg !91 - %b50 = getelementptr inbounds %child, ptr %__child49, i32 0, i32 1, !dbg !91 + %__child49 = getelementptr inbounds nuw %grandchild, ptr %tmpVar48, i32 0, i32 0, !dbg !91 + %b50 = getelementptr inbounds nuw %child, ptr %__child49, i32 0, i32 1, !dbg !91 store i32 23, ptr %b50, align 4, !dbg !91 %tmpVar51 = getelementptr inbounds [3 x %grandchild], ptr %array_of_grandchild, i32 0, i32 2, !dbg !92 - %c52 = getelementptr inbounds %grandchild, ptr %tmpVar51, i32 0, i32 1, !dbg !92 + %c52 = getelementptr inbounds nuw %grandchild, ptr %tmpVar51, i32 0, i32 1, !dbg !92 store i32 24, ptr %c52, align 4, !dbg !92 %main_ret = load i32, ptr %main, align 4, !dbg !93 ret i32 %main_ret, !dbg !93 @@ -1764,7 +1764,7 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -1774,7 +1774,7 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -1784,7 +1784,7 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @grandchild, ptr %__body, align 8 ret void } @@ -1794,12 +1794,12 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__child = getelementptr inbounds %grandchild, ptr %deref, i32 0, i32 0 + %__child = getelementptr inbounds nuw %grandchild, ptr %deref, i32 0, i32 0 call void @__init_child(ptr %__child) %deref1 = load ptr, ptr %self, align 8 - %__child2 = getelementptr inbounds %grandchild, ptr %deref1, i32 0, i32 0 - %__parent = getelementptr inbounds %child, ptr %__child2, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 0 + %__child2 = getelementptr inbounds nuw %grandchild, ptr %deref1, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %__child2, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 0 store ptr @__vtable_grandchild_instance, ptr %__vtable, align 8 ret void } @@ -1809,11 +1809,11 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1823,7 +1823,7 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -1861,7 +1861,7 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1871,7 +1871,7 @@ END_FUNCTION %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__child = getelementptr inbounds %grandchild, ptr %deref, i32 0, i32 0 + %__child = getelementptr inbounds nuw %grandchild, ptr %deref, i32 0, i32 0 call void @__user_init_child(ptr %__child) ret void } diff --git a/src/codegen/tests/oop_tests/super_tests.rs b/src/codegen/tests/oop_tests/super_tests.rs index e82d534971b..dbaa1274301 100644 --- a/src/codegen/tests/oop_tests/super_tests.rs +++ b/src/codegen/tests/oop_tests/super_tests.rs @@ -40,8 +40,8 @@ fn super_keyword_basic_access() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void } @@ -49,8 +49,8 @@ fn super_keyword_basic_access() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 store i16 20, ptr %x, align 2 ret void } @@ -60,7 +60,7 @@ fn super_keyword_basic_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -70,7 +70,7 @@ fn super_keyword_basic_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -80,7 +80,7 @@ fn super_keyword_basic_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -90,11 +90,11 @@ fn super_keyword_basic_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -118,7 +118,7 @@ fn super_keyword_basic_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -183,8 +183,8 @@ fn super_without_deref() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void } @@ -192,8 +192,8 @@ fn super_without_deref() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %p = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %p = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 store ptr %__parent, ptr %p, align 8 ret void } @@ -203,7 +203,7 @@ fn super_without_deref() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -213,7 +213,7 @@ fn super_without_deref() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -223,7 +223,7 @@ fn super_without_deref() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -233,11 +233,11 @@ fn super_without_deref() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -261,7 +261,7 @@ fn super_without_deref() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -333,8 +333,8 @@ fn super_in_method_calls() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void } @@ -342,8 +342,8 @@ fn super_in_method_calls() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 %parent.process = alloca i16, align 2 store i16 0, ptr %parent.process, align 2 %load_value = load i16, ptr %value, align 2 @@ -359,7 +359,7 @@ fn super_in_method_calls() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -367,10 +367,10 @@ fn super_in_method_calls() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 %child.process = alloca i16, align 2 store i16 0, ptr %child.process, align 2 - %value = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %value = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_value = load i16, ptr %value, align 2 %1 = sext i16 %load_value to i32 %tmpVar = add i32 %1, 5 @@ -384,7 +384,7 @@ fn super_in_method_calls() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 %child.test = alloca i16, align 2 store i16 0, ptr %child.test, align 2 %call = call i16 @parent__process(ptr %__parent) @@ -398,10 +398,10 @@ fn super_in_method_calls() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %process = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + %process = getelementptr inbounds nuw %__vtable_parent, ptr %deref1, i32 0, i32 1 store ptr @parent__process, ptr %process, align 8 ret void } @@ -411,13 +411,13 @@ fn super_in_method_calls() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_child, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %process = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + %process = getelementptr inbounds nuw %__vtable_child, ptr %deref1, i32 0, i32 1 store ptr @child__process, ptr %process, align 8 %deref2 = load ptr, ptr %self, align 8 - %test = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + %test = getelementptr inbounds nuw %__vtable_child, ptr %deref2, i32 0, i32 2 store ptr @child__test, ptr %test, align 8 ret void } @@ -427,7 +427,7 @@ fn super_in_method_calls() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -437,11 +437,11 @@ fn super_in_method_calls() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -465,7 +465,7 @@ fn super_in_method_calls() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -531,9 +531,9 @@ fn super_in_complex_expressions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -541,12 +541,12 @@ fn super_in_complex_expressions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %child, ptr %0, i32 0, i32 1 - %x = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 - %y = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %y = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %load_y = load i16, ptr %y, align 2 %2 = sext i16 %load_y to i32 %tmpVar = mul i32 %2, 2 @@ -561,7 +561,7 @@ fn super_in_complex_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -571,7 +571,7 @@ fn super_in_complex_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -581,7 +581,7 @@ fn super_in_complex_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -591,11 +591,11 @@ fn super_in_complex_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -619,7 +619,7 @@ fn super_in_complex_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -685,8 +685,8 @@ fn super_with_array_access() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %arr = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %arr = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void } @@ -694,9 +694,9 @@ fn super_with_array_access() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %index = getelementptr inbounds %child, ptr %0, i32 0, i32 1 - %arr = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %index = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_index = load i16, ptr %index, align 2 %1 = sext i16 %load_index to i32 %tmpVar = mul i32 1, %1 @@ -711,7 +711,7 @@ fn super_with_array_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -721,7 +721,7 @@ fn super_with_array_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -731,7 +731,7 @@ fn super_with_array_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -741,11 +741,11 @@ fn super_with_array_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -769,7 +769,7 @@ fn super_with_array_access() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -856,8 +856,8 @@ fn super_in_multi_level_inheritance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 - %g_val = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 + %g_val = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 1 ret void } @@ -865,8 +865,8 @@ fn super_in_multi_level_inheritance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 - %g_val = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 + %g_val = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 1 %grandparent.gp_method = alloca i16, align 2 store i16 0, ptr %grandparent.gp_method, align 2 %load_g_val = load i16, ptr %g_val, align 2 @@ -879,8 +879,8 @@ fn super_in_multi_level_inheritance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %p_val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %p_val = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void } @@ -888,8 +888,8 @@ fn super_in_multi_level_inheritance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %p_val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %p_val = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 %parent.p_method = alloca i16, align 2 store i16 0, ptr %parent.p_method, align 2 %load_p_val = load i16, ptr %p_val, align 2 @@ -907,8 +907,8 @@ fn super_in_multi_level_inheritance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %c_val = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %c_val = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 ret void } @@ -916,8 +916,8 @@ fn super_in_multi_level_inheritance() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %c_val = getelementptr inbounds %child, ptr %0, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %c_val = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 1 %child.test = alloca i16, align 2 store i16 0, ptr %child.test, align 2 %call = call i16 @parent__p_method(ptr %__parent) @@ -931,10 +931,10 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @grandparent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %gp_method = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + %gp_method = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref1, i32 0, i32 1 store ptr @grandparent__gp_method, ptr %gp_method, align 8 ret void } @@ -944,13 +944,13 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %gp_method = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + %gp_method = getelementptr inbounds nuw %__vtable_parent, ptr %deref1, i32 0, i32 1 store ptr @grandparent__gp_method, ptr %gp_method, align 8 %deref2 = load ptr, ptr %self, align 8 - %p_method = getelementptr inbounds %__vtable_parent, ptr %deref2, i32 0, i32 2 + %p_method = getelementptr inbounds nuw %__vtable_parent, ptr %deref2, i32 0, i32 2 store ptr @parent__p_method, ptr %p_method, align 8 ret void } @@ -960,16 +960,16 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_child, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %gp_method = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + %gp_method = getelementptr inbounds nuw %__vtable_child, ptr %deref1, i32 0, i32 1 store ptr @grandparent__gp_method, ptr %gp_method, align 8 %deref2 = load ptr, ptr %self, align 8 - %p_method = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + %p_method = getelementptr inbounds nuw %__vtable_child, ptr %deref2, i32 0, i32 2 store ptr @parent__p_method, ptr %p_method, align 8 %deref3 = load ptr, ptr %self, align 8 - %test = getelementptr inbounds %__vtable_child, ptr %deref3, i32 0, i32 3 + %test = getelementptr inbounds nuw %__vtable_child, ptr %deref3, i32 0, i32 3 store ptr @child__test, ptr %test, align 8 ret void } @@ -979,11 +979,11 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__init_grandparent(ptr %__grandparent) %deref1 = load ptr, ptr %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + %__grandparent2 = getelementptr inbounds nuw %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent2, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -993,7 +993,7 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %deref, i32 0, i32 0 store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } @@ -1003,12 +1003,12 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1046,7 +1046,7 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1056,7 +1056,7 @@ fn super_in_multi_level_inheritance() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__user_init_grandparent(ptr %__grandparent) ret void } @@ -1116,9 +1116,9 @@ fn super_with_pointer_operations() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %ptr = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %ptr = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -1126,12 +1126,12 @@ fn super_with_pointer_operations() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %ptr = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 - %val = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %ptr = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 + %val = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 store ptr %val, ptr %ptr, align 8 - %val1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 - %ptr2 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %val1 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 + %ptr2 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %deref = load ptr, ptr %ptr2, align 8 %load_tmpVar = load i16, ptr %deref, align 2 %1 = sext i16 %load_tmpVar to i32 @@ -1146,7 +1146,7 @@ fn super_with_pointer_operations() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -1156,7 +1156,7 @@ fn super_with_pointer_operations() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -1166,7 +1166,7 @@ fn super_with_pointer_operations() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -1176,11 +1176,11 @@ fn super_with_pointer_operations() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1204,7 +1204,7 @@ fn super_with_pointer_operations() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1279,9 +1279,9 @@ fn super_in_conditionals() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %threshold = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %threshold = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %value = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -1289,7 +1289,7 @@ fn super_in_conditionals() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -1297,11 +1297,11 @@ fn super_in_conditionals() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %load_value = load i16, ptr %value, align 2 %1 = sext i16 %load_value to i32 - %threshold = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %threshold = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_threshold = load i16, ptr %threshold, align 2 %2 = sext i16 %load_threshold to i32 %tmpVar = icmp sgt i32 %1, %2 @@ -1310,17 +1310,17 @@ fn super_in_conditionals() { br i1 %4, label %condition_body, label %else condition_body: ; preds = %entry - %value1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %value1 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 store i16 0, ptr %value1, align 2 br label %continue else: ; preds = %entry - %value2 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %value2 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 store i16 100, ptr %value2, align 2 br label %continue continue: ; preds = %else, %condition_body - %value4 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %value4 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %load_value5 = load i16, ptr %value4, align 2 switch i16 %load_value5, label %else6 [ i16 10, label %case @@ -1328,12 +1328,12 @@ fn super_in_conditionals() { ] case: ; preds = %continue - %threshold7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %threshold7 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 store i16 40, ptr %threshold7, align 2 br label %continue3 case8: ; preds = %continue - %threshold9 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %threshold9 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 store i16 60, ptr %threshold9, align 2 br label %continue3 @@ -1349,7 +1349,7 @@ fn super_in_conditionals() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -1359,10 +1359,10 @@ fn super_in_conditionals() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_child, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %test = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + %test = getelementptr inbounds nuw %__vtable_child, ptr %deref1, i32 0, i32 1 store ptr @child__test, ptr %test, align 8 ret void } @@ -1372,7 +1372,7 @@ fn super_in_conditionals() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -1382,11 +1382,11 @@ fn super_in_conditionals() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1410,7 +1410,7 @@ fn super_in_conditionals() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1475,9 +1475,9 @@ fn super_with_const_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %MAX_VALUE = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %current = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %MAX_VALUE = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %current = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -1485,8 +1485,8 @@ fn super_with_const_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %current = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %current = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 store i16 50, ptr %current, align 2 ret void } @@ -1496,7 +1496,7 @@ fn super_with_const_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -1506,7 +1506,7 @@ fn super_with_const_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 ret void } @@ -1516,7 +1516,7 @@ fn super_with_const_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -1526,11 +1526,11 @@ fn super_with_const_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1554,7 +1554,7 @@ fn super_with_const_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1633,8 +1633,8 @@ fn super_as_function_parameter() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void } @@ -1642,7 +1642,7 @@ fn super_as_function_parameter() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -1650,7 +1650,7 @@ fn super_as_function_parameter() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 %call = call i16 @process_ref(ptr %__parent) %call1 = call i16 @process_val(ptr %__parent) ret void @@ -1663,7 +1663,7 @@ fn super_as_function_parameter() { store ptr %0, ptr %ref, align 8 store i16 0, ptr %process_ref, align 2 %deref = load ptr, ptr %ref, align 8 - %val = getelementptr inbounds %parent, ptr %deref, i32 0, i32 1 + %val = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 1 store i16 20, ptr %val, align 2 %process_ref_ret = load i16, ptr %process_ref, align 2 ret i16 %process_ref_ret @@ -1675,7 +1675,7 @@ fn super_as_function_parameter() { %val = alloca %parent, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %val, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%parent, ptr null, i32 1) to i64), i1 false) store i16 0, ptr %process_val, align 2 - %val1 = getelementptr inbounds %parent, ptr %val, i32 0, i32 1 + %val1 = getelementptr inbounds nuw %parent, ptr %val, i32 0, i32 1 store i16 30, ptr %val1, align 2 %process_val_ret = load i16, ptr %process_val, align 2 ret i16 %process_val_ret @@ -1689,7 +1689,7 @@ fn super_as_function_parameter() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -1699,10 +1699,10 @@ fn super_as_function_parameter() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_child, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %test = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + %test = getelementptr inbounds nuw %__vtable_child, ptr %deref1, i32 0, i32 1 store ptr @child__test, ptr %test, align 8 ret void } @@ -1712,7 +1712,7 @@ fn super_as_function_parameter() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -1722,11 +1722,11 @@ fn super_as_function_parameter() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1750,7 +1750,7 @@ fn super_as_function_parameter() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -1822,10 +1822,10 @@ fn super_with_deeply_nested_expressions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 - %c = getelementptr inbounds %parent, ptr %0, i32 0, i32 3 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 3 ret void } @@ -1833,10 +1833,10 @@ fn super_with_deeply_nested_expressions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 - %c = getelementptr inbounds %parent, ptr %0, i32 0, i32 3 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 + %c = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 3 %parent.calc = alloca i16, align 2 store i16 0, ptr %parent.calc, align 2 %load_a = load i16, ptr %a, align 2 @@ -1857,7 +1857,7 @@ fn super_with_deeply_nested_expressions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -1865,24 +1865,24 @@ fn super_with_deeply_nested_expressions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 %child.test = alloca i16, align 2 store i16 0, ptr %child.test, align 2 - %a = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %a = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_a = load i16, ptr %a, align 2 %1 = sext i16 %load_a to i32 - %b = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %b = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %load_b = load i16, ptr %b, align 2 %2 = sext i16 %load_b to i32 %tmpVar = add i32 %1, %2 - %c = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 3 + %c = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 3 %load_c = load i16, ptr %c, align 2 %3 = sext i16 %load_c to i32 %tmpVar1 = mul i32 %tmpVar, %3 %call = call i16 @parent__calc(ptr %__parent) %4 = sext i16 %call to i32 %tmpVar2 = add i32 %tmpVar1, %4 - %a3 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %a3 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_a4 = load i16, ptr %a3, align 2 %5 = sext i16 %load_a4 to i32 %tmpVar5 = add i32 %5, 1 @@ -1898,10 +1898,10 @@ fn super_with_deeply_nested_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %calc = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + %calc = getelementptr inbounds nuw %__vtable_parent, ptr %deref1, i32 0, i32 1 store ptr @parent__calc, ptr %calc, align 8 ret void } @@ -1911,13 +1911,13 @@ fn super_with_deeply_nested_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_child, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %calc = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + %calc = getelementptr inbounds nuw %__vtable_child, ptr %deref1, i32 0, i32 1 store ptr @parent__calc, ptr %calc, align 8 %deref2 = load ptr, ptr %self, align 8 - %test = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + %test = getelementptr inbounds nuw %__vtable_child, ptr %deref2, i32 0, i32 2 store ptr @child__test, ptr %test, align 8 ret void } @@ -1927,7 +1927,7 @@ fn super_with_deeply_nested_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -1937,11 +1937,11 @@ fn super_with_deeply_nested_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -1965,7 +1965,7 @@ fn super_with_deeply_nested_expressions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -2054,9 +2054,9 @@ fn super_in_loop_constructs() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %counter = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %arr = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %counter = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -2064,9 +2064,9 @@ fn super_in_loop_constructs() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %counter = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %arr = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %counter = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 %load_counter = load i16, ptr %counter, align 2 %1 = sext i16 %load_counter to i32 %tmpVar = add i32 %1, 1 @@ -2079,7 +2079,7 @@ fn super_in_loop_constructs() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -2087,7 +2087,7 @@ fn super_in_loop_constructs() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 %i = alloca i16, align 2 %sum = alloca i16, align 2 store i16 0, ptr %i, align 2 @@ -2110,7 +2110,7 @@ fn super_in_loop_constructs() { loop: ; preds = %predicate_sge, %predicate_sle %load_sum = load i16, ptr %sum, align 2 %5 = sext i16 %load_sum to i32 - %arr = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %arr = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %load_i = load i16, ptr %i, align 2 %6 = sext i16 %load_i to i32 %tmpVar = mul i32 1, %6 @@ -2139,7 +2139,7 @@ fn super_in_loop_constructs() { br i1 true, label %while_body, label %continue5 while_body: ; preds = %condition_check - %counter = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %counter = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_counter = load i16, ptr %counter, align 2 %12 = sext i16 %load_counter to i32 %tmpVar7 = icmp slt i32 %12, 10 @@ -2165,14 +2165,14 @@ fn super_in_loop_constructs() { br i1 true, label %while_body10, label %continue11 while_body10: ; preds = %condition_check9 - %counter12 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 - %counter13 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %counter12 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 + %counter13 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_counter14 = load i16, ptr %counter13, align 2 %15 = sext i16 %load_counter14 to i32 %tmpVar15 = sub i32 %15, 1 %16 = trunc i32 %tmpVar15 to i16 store i16 %16, ptr %counter12, align 2 - %counter17 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %counter17 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_counter18 = load i16, ptr %counter17, align 2 %17 = sext i16 %load_counter18 to i32 %tmpVar19 = icmp sle i32 %17, 0 @@ -2198,10 +2198,10 @@ fn super_in_loop_constructs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %increment = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + %increment = getelementptr inbounds nuw %__vtable_parent, ptr %deref1, i32 0, i32 1 store ptr @parent__increment, ptr %increment, align 8 ret void } @@ -2211,13 +2211,13 @@ fn super_in_loop_constructs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_child, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %increment = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + %increment = getelementptr inbounds nuw %__vtable_child, ptr %deref1, i32 0, i32 1 store ptr @parent__increment, ptr %increment, align 8 %deref2 = load ptr, ptr %self, align 8 - %process = getelementptr inbounds %__vtable_child, ptr %deref2, i32 0, i32 2 + %process = getelementptr inbounds nuw %__vtable_child, ptr %deref2, i32 0, i32 2 store ptr @child__process, ptr %process, align 8 ret void } @@ -2227,7 +2227,7 @@ fn super_in_loop_constructs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -2237,11 +2237,11 @@ fn super_in_loop_constructs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -2265,7 +2265,7 @@ fn super_in_loop_constructs() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -2341,7 +2341,7 @@ fn super_with_method_overrides_in_three_levels() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 ret void } @@ -2349,7 +2349,7 @@ fn super_with_method_overrides_in_three_levels() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %0, i32 0, i32 0 %grandparent.calculate = alloca i16, align 2 store i16 0, ptr %grandparent.calculate, align 2 store i16 100, ptr %grandparent.calculate, align 2 @@ -2361,7 +2361,7 @@ fn super_with_method_overrides_in_three_levels() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 ret void } @@ -2369,7 +2369,7 @@ fn super_with_method_overrides_in_three_levels() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 %parent.calculate = alloca i16, align 2 store i16 0, ptr %parent.calculate, align 2 %call = call i16 @grandparent__calculate(ptr %__grandparent) @@ -2385,7 +2385,7 @@ fn super_with_method_overrides_in_three_levels() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -2393,7 +2393,7 @@ fn super_with_method_overrides_in_three_levels() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 %child.calculate = alloca i16, align 2 store i16 0, ptr %child.calculate, align 2 %call = call i16 @parent__calculate(ptr %__parent) @@ -2410,10 +2410,10 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @grandparent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %calculate = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + %calculate = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref1, i32 0, i32 1 store ptr @grandparent__calculate, ptr %calculate, align 8 ret void } @@ -2423,10 +2423,10 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %calculate = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + %calculate = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref1, i32 0, i32 1 store ptr @parent__calculate, ptr %calculate, align 8 ret void } @@ -2436,10 +2436,10 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_grandparent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %calculate = getelementptr inbounds %__vtable_grandparent, ptr %deref1, i32 0, i32 1 + %calculate = getelementptr inbounds nuw %__vtable_grandparent, ptr %deref1, i32 0, i32 1 store ptr @child__calculate, ptr %calculate, align 8 ret void } @@ -2449,11 +2449,11 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__init_grandparent(ptr %__grandparent) %deref1 = load ptr, ptr %self, align 8 - %__grandparent2 = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent2, i32 0, i32 0 + %__grandparent2 = getelementptr inbounds nuw %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent2, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -2463,7 +2463,7 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %grandparent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %deref, i32 0, i32 0 store ptr @__vtable_grandparent_instance, ptr %__vtable, align 8 ret void } @@ -2473,12 +2473,12 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__grandparent = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 - %__vtable = getelementptr inbounds %grandparent, ptr %__grandparent, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %grandparent, ptr %__grandparent, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -2516,7 +2516,7 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -2526,7 +2526,7 @@ fn super_with_method_overrides_in_three_levels() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__grandparent = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__grandparent = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 call void @__user_init_grandparent(ptr %__grandparent) ret void } @@ -2650,9 +2650,9 @@ fn super_with_structured_types() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %data = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 - %arr_data = getelementptr inbounds %parent, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %data = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 + %arr_data = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 2 ret void } @@ -2660,7 +2660,7 @@ fn super_with_structured_types() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -2668,39 +2668,39 @@ fn super_with_structured_types() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 %local_data = alloca %Complex_Type, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %local_data, ptr align 1 @__Complex_Type__init, i64 ptrtoint (ptr getelementptr (%Complex_Type, ptr null, i32 1) to i64), i1 false) call void @__init_complex_type(ptr %local_data) call void @__user_init_Complex_Type(ptr %local_data) - %x = getelementptr inbounds %Complex_Type, ptr %local_data, i32 0, i32 0 - %data = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 - %x1 = getelementptr inbounds %Complex_Type, ptr %data, i32 0, i32 0 + %x = getelementptr inbounds nuw %Complex_Type, ptr %local_data, i32 0, i32 0 + %data = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 + %x1 = getelementptr inbounds nuw %Complex_Type, ptr %data, i32 0, i32 0 %load_x = load i16, ptr %x1, align 2 store i16 %load_x, ptr %x, align 2 - %y = getelementptr inbounds %Complex_Type, ptr %local_data, i32 0, i32 1 - %data2 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 - %y3 = getelementptr inbounds %Complex_Type, ptr %data2, i32 0, i32 1 + %y = getelementptr inbounds nuw %Complex_Type, ptr %local_data, i32 0, i32 1 + %data2 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 + %y3 = getelementptr inbounds nuw %Complex_Type, ptr %data2, i32 0, i32 1 %load_y = load i16, ptr %y3, align 2 store i16 %load_y, ptr %y, align 2 - %z = getelementptr inbounds %Complex_Type, ptr %local_data, i32 0, i32 2 - %data4 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 - %z5 = getelementptr inbounds %Complex_Type, ptr %data4, i32 0, i32 2 + %z = getelementptr inbounds nuw %Complex_Type, ptr %local_data, i32 0, i32 2 + %data4 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 + %z5 = getelementptr inbounds nuw %Complex_Type, ptr %data4, i32 0, i32 2 %load_z = load float, ptr %z5, align 4 store float %load_z, ptr %z, align 4 - %arr_data = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %arr_data = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %tmpVar = getelementptr inbounds [2 x %Complex_Type], ptr %arr_data, i32 0, i32 0 - %x6 = getelementptr inbounds %Complex_Type, ptr %tmpVar, i32 0, i32 0 - %arr_data7 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %x6 = getelementptr inbounds nuw %Complex_Type, ptr %tmpVar, i32 0, i32 0 + %arr_data7 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %tmpVar8 = getelementptr inbounds [2 x %Complex_Type], ptr %arr_data7, i32 0, i32 1 - %x9 = getelementptr inbounds %Complex_Type, ptr %tmpVar8, i32 0, i32 0 + %x9 = getelementptr inbounds nuw %Complex_Type, ptr %tmpVar8, i32 0, i32 0 %load_x10 = load i16, ptr %x9, align 2 store i16 %load_x10, ptr %x6, align 2 - %arr_data11 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 2 + %arr_data11 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 2 %tmpVar12 = getelementptr inbounds [2 x %Complex_Type], ptr %arr_data11, i32 0, i32 0 - %z13 = getelementptr inbounds %Complex_Type, ptr %tmpVar12, i32 0, i32 2 - %data14 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 - %z15 = getelementptr inbounds %Complex_Type, ptr %data14, i32 0, i32 2 + %z13 = getelementptr inbounds nuw %Complex_Type, ptr %tmpVar12, i32 0, i32 2 + %data14 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 + %z15 = getelementptr inbounds nuw %Complex_Type, ptr %data14, i32 0, i32 2 %load_z16 = load float, ptr %z15, align 4 store float %load_z16, ptr %z13, align 4 ret void @@ -2714,7 +2714,7 @@ fn super_with_structured_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 ret void } @@ -2724,10 +2724,10 @@ fn super_with_structured_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_child, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_child, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %test = getelementptr inbounds %__vtable_child, ptr %deref1, i32 0, i32 1 + %test = getelementptr inbounds nuw %__vtable_child, ptr %deref1, i32 0, i32 1 store ptr @child__test, ptr %test, align 8 ret void } @@ -2744,10 +2744,10 @@ fn super_with_structured_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %data = getelementptr inbounds %parent, ptr %deref, i32 0, i32 1 + %data = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 1 call void @__init_complex_type(ptr %data) %deref1 = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref1, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -2757,11 +2757,11 @@ fn super_with_structured_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -2792,7 +2792,7 @@ fn super_with_structured_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } @@ -2802,7 +2802,7 @@ fn super_with_structured_types() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %data = getelementptr inbounds %parent, ptr %deref, i32 0, i32 1 + %data = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 1 call void @__user_init_Complex_Type(ptr %data) ret void } @@ -2867,8 +2867,8 @@ fn super_in_action_blocks() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 ret void } @@ -2876,8 +2876,8 @@ fn super_in_action_blocks() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %parent, ptr %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds nuw %parent, ptr %0, i32 0, i32 1 %load_value = load i16, ptr %value, align 2 %1 = sext i16 %load_value to i32 %tmpVar = add i32 %1, 1 @@ -2890,7 +2890,7 @@ fn super_in_action_blocks() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 ret void } @@ -2898,9 +2898,9 @@ fn super_in_action_blocks() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__parent = getelementptr inbounds %child, ptr %0, i32 0, i32 0 - %value = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 - %value1 = getelementptr inbounds %parent, ptr %__parent, i32 0, i32 1 + %__parent = getelementptr inbounds nuw %child, ptr %0, i32 0, i32 0 + %value = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 + %value1 = getelementptr inbounds nuw %parent, ptr %__parent, i32 0, i32 1 %load_value = load i16, ptr %value1, align 2 %1 = sext i16 %load_value to i32 %tmpVar = add i32 %1, 5 @@ -2915,10 +2915,10 @@ fn super_in_action_blocks() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @parent, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %increment = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + %increment = getelementptr inbounds nuw %__vtable_parent, ptr %deref1, i32 0, i32 1 store ptr @parent__increment, ptr %increment, align 8 ret void } @@ -2928,10 +2928,10 @@ fn super_in_action_blocks() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_parent, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_parent, ptr %deref, i32 0, i32 0 store ptr @child, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %increment = getelementptr inbounds %__vtable_parent, ptr %deref1, i32 0, i32 1 + %increment = getelementptr inbounds nuw %__vtable_parent, ptr %deref1, i32 0, i32 1 store ptr @parent__increment, ptr %increment, align 8 ret void } @@ -2941,7 +2941,7 @@ fn super_in_action_blocks() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %parent, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %deref, i32 0, i32 0 store ptr @__vtable_parent_instance, ptr %__vtable, align 8 ret void } @@ -2951,11 +2951,11 @@ fn super_in_action_blocks() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__init_parent(ptr %__parent) %deref1 = load ptr, ptr %self, align 8 - %__parent2 = getelementptr inbounds %child, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %parent, ptr %__parent2, i32 0, i32 0 + %__parent2 = getelementptr inbounds nuw %child, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %parent, ptr %__parent2, i32 0, i32 0 store ptr @__vtable_child_instance, ptr %__vtable, align 8 ret void } @@ -2979,7 +2979,7 @@ fn super_in_action_blocks() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__parent = getelementptr inbounds %child, ptr %deref, i32 0, i32 0 + %__parent = getelementptr inbounds nuw %child, ptr %deref, i32 0, i32 0 call void @__user_init_parent(ptr %__parent) ret void } diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index d82b0940f0a..9f0c06d324a 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -1038,9 +1038,9 @@ fn by_value_fb_arg_aggregates_are_memcopied() { call void @llvm.memset.p0.i64(ptr align 1 %arr, i8 0, i64 ptrtoint (ptr getelementptr ([1024 x i32], ptr null, i32 1) to i64), i1 false) call void @llvm.memcpy.p0.p0.i64(ptr align 1 %fb, ptr align 1 @__FOO__init, i64 ptrtoint (ptr getelementptr (%FOO, ptr null, i32 1) to i64), i1 false) store i32 0, ptr %main, align 4 - %0 = getelementptr inbounds %FOO, ptr %fb, i32 0, i32 0 + %0 = getelementptr inbounds nuw %FOO, ptr %fb, i32 0, i32 0 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %0, ptr align 1 %str, i32 65536, i1 false) - %1 = getelementptr inbounds %FOO, ptr %fb, i32 0, i32 1 + %1 = getelementptr inbounds nuw %FOO, ptr %fb, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %1, ptr align 1 %arr, i64 ptrtoint (ptr getelementptr ([1024 x i32], ptr null, i32 1) to i64), i1 false) call void @FOO(ptr %fb) %main_ret = load i32, ptr %main, align 4 @@ -1051,8 +1051,8 @@ fn by_value_fb_arg_aggregates_are_memcopied() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %val = getelementptr inbounds %FOO, ptr %0, i32 0, i32 0 - %field = getelementptr inbounds %FOO, ptr %0, i32 0, i32 1 + %val = getelementptr inbounds nuw %FOO, ptr %0, i32 0, i32 0 + %field = getelementptr inbounds nuw %FOO, ptr %0, i32 0, i32 1 ret void } @@ -1121,32 +1121,32 @@ fn var_output_aggregate_types_are_memcopied() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %output = getelementptr inbounds %FB, ptr %0, i32 0, i32 0 - %output2 = getelementptr inbounds %FB, ptr %0, i32 0, i32 1 - %output3 = getelementptr inbounds %FB, ptr %0, i32 0, i32 2 - %output4 = getelementptr inbounds %FB, ptr %0, i32 0, i32 3 - %output5 = getelementptr inbounds %FB, ptr %0, i32 0, i32 4 + %output = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 0 + %output2 = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 1 + %output3 = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 2 + %output4 = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 3 + %output5 = getelementptr inbounds nuw %FB, ptr %0, i32 0, i32 4 ret void } define void @PRG(ptr %0) { entry: - %out = getelementptr inbounds %PRG, ptr %0, i32 0, i32 0 - %out2 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 1 - %out3 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 2 - %out4 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 3 - %out5 = getelementptr inbounds %PRG, ptr %0, i32 0, i32 4 - %station = getelementptr inbounds %PRG, ptr %0, i32 0, i32 5 + %out = getelementptr inbounds nuw %PRG, ptr %0, i32 0, i32 0 + %out2 = getelementptr inbounds nuw %PRG, ptr %0, i32 0, i32 1 + %out3 = getelementptr inbounds nuw %PRG, ptr %0, i32 0, i32 2 + %out4 = getelementptr inbounds nuw %PRG, ptr %0, i32 0, i32 3 + %out5 = getelementptr inbounds nuw %PRG, ptr %0, i32 0, i32 4 + %station = getelementptr inbounds nuw %PRG, ptr %0, i32 0, i32 5 call void @FB(ptr %station) - %1 = getelementptr inbounds %FB, ptr %station, i32 0, i32 0 + %1 = getelementptr inbounds nuw %FB, ptr %station, i32 0, i32 0 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %out, ptr align 1 %1, i64 ptrtoint (ptr getelementptr (%OUT_TYPE, ptr null, i32 1) to i64), i1 false) - %2 = getelementptr inbounds %FB, ptr %station, i32 0, i32 1 + %2 = getelementptr inbounds nuw %FB, ptr %station, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %out2, ptr align 1 %2, i64 ptrtoint (ptr getelementptr ([11 x i32], ptr null, i32 1) to i64), i1 false) - %3 = getelementptr inbounds %FB, ptr %station, i32 0, i32 2 + %3 = getelementptr inbounds nuw %FB, ptr %station, i32 0, i32 2 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %out3, ptr align 1 %3, i64 ptrtoint (ptr getelementptr ([11 x %OUT_TYPE], ptr null, i32 1) to i64), i1 false) - %4 = getelementptr inbounds %FB, ptr %station, i32 0, i32 3 + %4 = getelementptr inbounds nuw %FB, ptr %station, i32 0, i32 3 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %out4, ptr align 1 %4, i32 80, i1 false) - %5 = getelementptr inbounds %FB, ptr %station, i32 0, i32 4 + %5 = getelementptr inbounds nuw %FB, ptr %station, i32 0, i32 4 call void @llvm.memcpy.p0.p0.i32(ptr align 2 %out5, ptr align 2 %5, i32 160, i1 false) ret void } @@ -1392,7 +1392,7 @@ fn program_with_array_of_string_parameter_stride_calculation() { define void @StringProcessor(ptr %0) { entry: - %messages = getelementptr inbounds %StringProcessor, ptr %0, i32 0, i32 0 + %messages = getelementptr inbounds nuw %StringProcessor, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %messages, align 8 %tmpVar = getelementptr inbounds [3 x [51 x i8]], ptr %deref, i32 0, i32 0 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %tmpVar, ptr align 1 @utf08_literal_0, i32 6, i1 false) @@ -1407,7 +1407,7 @@ fn program_with_array_of_string_parameter_stride_calculation() { define void @main(ptr %0) { entry: - %text_array = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %text_array = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 store ptr %text_array, ptr @StringProcessor_instance, align 8 call void @StringProcessor(ptr @StringProcessor_instance) ret void @@ -1460,7 +1460,7 @@ fn function_block_with_array_of_array_parameter_stride_calculation() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %matrix = getelementptr inbounds %MatrixProcessor, ptr %0, i32 0, i32 0 + %matrix = getelementptr inbounds nuw %MatrixProcessor, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %matrix, align 8 %tmpVar = getelementptr inbounds [2 x [4 x float]], ptr %deref, i32 0, i32 0 %tmpVar1 = getelementptr inbounds [4 x float], ptr %tmpVar, i32 0, i32 0 @@ -1482,9 +1482,9 @@ fn function_block_with_array_of_array_parameter_stride_calculation() { define void @main(ptr %0) { entry: - %processor = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %data = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %1 = getelementptr inbounds %MatrixProcessor, ptr %processor, i32 0, i32 0 + %processor = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %data = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %1 = getelementptr inbounds nuw %MatrixProcessor, ptr %processor, i32 0, i32 0 store ptr %data, ptr %1, align 8 call void @MatrixProcessor(ptr %processor) ret void @@ -1550,8 +1550,8 @@ fn method_with_var_in_out_array_of_strings() { define void @main(ptr %0) { entry: - %handler = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %my_strings = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %handler = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %my_strings = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 call void @StringHandler__process_strings(ptr %handler, ptr %my_strings) ret void } @@ -1635,8 +1635,8 @@ fn method_with_var_in_out_nested_integer_arrays() { define void @main(ptr %0) { entry: - %processor = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %matrix = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %processor = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %matrix = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 call void @DataProcessor__process_matrix(ptr %processor, ptr %matrix) ret void } @@ -1719,9 +1719,9 @@ fn method_with_mixed_array_types() { define void @main(ptr %0) { entry: - %handler = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %text_data = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %num_data = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %handler = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %text_data = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %num_data = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 call void @ComplexHandler__handle_data(ptr %handler, ptr %text_data, ptr %num_data) ret void } @@ -1847,8 +1847,8 @@ fn function_with_array_of_array_return() { define void @main(ptr %0) { entry: - %numbers = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %strings = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %numbers = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %strings = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %__bar1 = alloca [2 x [2 x i16]], align 2 call void @llvm.memset.p0.i64(ptr align 1 %__bar1, i8 0, i64 ptrtoint (ptr getelementptr ([2 x [2 x i16]], ptr null, i32 1) to i64), i1 false) call void @bar(ptr %__bar1) diff --git a/src/codegen/tests/polymorphism.rs b/src/codegen/tests/polymorphism.rs index e247c76d274..d8eacc3106b 100644 --- a/src/codegen/tests/polymorphism.rs +++ b/src/codegen/tests/polymorphism.rs @@ -68,9 +68,9 @@ fn simple_overridden_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 - %one = getelementptr inbounds %A, ptr %0, i32 0, i32 1 - %two = getelementptr inbounds %A, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 + %one = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 1 + %two = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 2 ret void } @@ -78,9 +78,9 @@ fn simple_overridden_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 - %one = getelementptr inbounds %A, ptr %0, i32 0, i32 1 - %two = getelementptr inbounds %A, ptr %0, i32 0, i32 2 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 + %one = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 1 + %two = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 2 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 store i32 %1, ptr %in, align 4 @@ -93,9 +93,9 @@ fn simple_overridden_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 - %three = getelementptr inbounds %B, ptr %0, i32 0, i32 1 - %four = getelementptr inbounds %B, ptr %0, i32 0, i32 2 + %__A = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 0 + %three = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 1 + %four = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 2 ret void } @@ -103,9 +103,9 @@ fn simple_overridden_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 - %three = getelementptr inbounds %B, ptr %0, i32 0, i32 1 - %four = getelementptr inbounds %B, ptr %0, i32 0, i32 2 + %__A = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 0 + %three = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 1 + %four = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 2 %B.foo = alloca i16, align 2 %in = alloca i32, align 4 store i32 %1, ptr %in, align 4 @@ -128,17 +128,17 @@ fn simple_overridden_method() { call void @__user_init_B(ptr %instanceB) store ptr %instanceA, ptr %refInstanceA, align 8 %deref = load ptr, ptr %refInstanceA, align 8 - %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %deref, i32 0, i32 0 %deref1 = load ptr, ptr %__vtable, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 %0 = load ptr, ptr %foo, align 8 %deref2 = load ptr, ptr %refInstanceA, align 8 %fnptr_call = call i16 %0(ptr %deref2, i32 5) store ptr %instanceB, ptr %refInstanceA, align 8 %deref3 = load ptr, ptr %refInstanceA, align 8 - %__vtable4 = getelementptr inbounds %A, ptr %deref3, i32 0, i32 0 + %__vtable4 = getelementptr inbounds nuw %A, ptr %deref3, i32 0, i32 0 %deref5 = load ptr, ptr %__vtable4, align 8 - %foo6 = getelementptr inbounds %__vtable_A, ptr %deref5, i32 0, i32 1 + %foo6 = getelementptr inbounds nuw %__vtable_A, ptr %deref5, i32 0, i32 1 %1 = load ptr, ptr %foo6, align 8 %deref7 = load ptr, ptr %refInstanceA, align 8 %fnptr_call8 = call i16 %1(ptr %deref7, i32 10) @@ -153,10 +153,10 @@ fn simple_overridden_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @A, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @A__foo, ptr %foo, align 8 ret void } @@ -166,10 +166,10 @@ fn simple_overridden_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @B, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @B__foo, ptr %foo, align 8 ret void } @@ -179,11 +179,11 @@ fn simple_overridden_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__init_a(ptr %__A) %deref1 = load ptr, ptr %self, align 8 - %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + %__A2 = getelementptr inbounds nuw %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %__A2, i32 0, i32 0 store ptr @__vtable_B_instance, ptr %__vtable, align 8 ret void } @@ -193,7 +193,7 @@ fn simple_overridden_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %deref, i32 0, i32 0 store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } @@ -210,7 +210,7 @@ fn simple_overridden_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__user_init_A(ptr %__A) ret void } @@ -280,7 +280,7 @@ fn method_call_within_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 ret void } @@ -288,7 +288,7 @@ fn method_call_within_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 store i32 %1, ptr %in, align 4 @@ -301,11 +301,11 @@ fn method_call_within_method() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %this, align 8 - %__vtable1 = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %__vtable1 = getelementptr inbounds nuw %A, ptr %deref, i32 0, i32 0 %deref2 = load ptr, ptr %__vtable1, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref2, i32 0, i32 1 %1 = load ptr, ptr %foo, align 8 %deref3 = load ptr, ptr %this, align 8 %fnptr_call = call i16 %1(ptr %deref3, i32 5) @@ -317,13 +317,13 @@ fn method_call_within_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @A, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @A__foo, ptr %foo, align 8 %deref2 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + %bar = getelementptr inbounds nuw %__vtable_A, ptr %deref2, i32 0, i32 2 store ptr @A__bar, ptr %bar, align 8 ret void } @@ -333,7 +333,7 @@ fn method_call_within_method() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %deref, i32 0, i32 0 store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } @@ -428,7 +428,7 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 ret void } @@ -436,7 +436,7 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 store i32 %1, ptr %in, align 4 @@ -449,7 +449,7 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 ret void } @@ -457,7 +457,7 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 0 ret void } @@ -465,9 +465,9 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %this, align 8 - %__A1 = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A1 = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 %call = call i16 @A__foo(ptr %__A1, i32 5) ret void } @@ -476,7 +476,7 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %C, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %C, ptr %0, i32 0, i32 0 ret void } @@ -484,7 +484,7 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %C, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %C, ptr %0, i32 0, i32 0 %C.foo = alloca i16, align 2 %in = alloca i32, align 4 store i32 %1, ptr %in, align 4 @@ -499,7 +499,7 @@ fn this_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %C, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %C, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %this, align 8 %call = call i16 @C__foo(ptr %deref, i32 5) ret void @@ -510,13 +510,13 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @A, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @A__foo, ptr %foo, align 8 %deref2 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + %bar = getelementptr inbounds nuw %__vtable_A, ptr %deref2, i32 0, i32 2 store ptr @A__bar, ptr %bar, align 8 ret void } @@ -526,13 +526,13 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @B, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @A__foo, ptr %foo, align 8 %deref2 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + %bar = getelementptr inbounds nuw %__vtable_A, ptr %deref2, i32 0, i32 2 store ptr @B__bar, ptr %bar, align 8 ret void } @@ -542,13 +542,13 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @C, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @C__foo, ptr %foo, align 8 %deref2 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + %bar = getelementptr inbounds nuw %__vtable_A, ptr %deref2, i32 0, i32 2 store ptr @C__bar, ptr %bar, align 8 ret void } @@ -558,7 +558,7 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %deref, i32 0, i32 0 store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } @@ -568,11 +568,11 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__init_a(ptr %__A) %deref1 = load ptr, ptr %self, align 8 - %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + %__A2 = getelementptr inbounds nuw %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %__A2, i32 0, i32 0 store ptr @__vtable_B_instance, ptr %__vtable, align 8 ret void } @@ -582,11 +582,11 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__init_a(ptr %__A) %deref1 = load ptr, ptr %self, align 8 - %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + %__A2 = getelementptr inbounds nuw %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %__A2, i32 0, i32 0 store ptr @__vtable_C_instance, ptr %__vtable, align 8 ret void } @@ -596,7 +596,7 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__user_init_A(ptr %__A) ret void } @@ -620,7 +620,7 @@ fn this_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__user_init_A(ptr %__A) ret void } @@ -709,7 +709,7 @@ fn super_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 ret void } @@ -717,7 +717,7 @@ fn super_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 %A.foo = alloca i16, align 2 %in = alloca i32, align 4 store i32 %1, ptr %in, align 4 @@ -730,7 +730,7 @@ fn super_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %A, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %0, i32 0, i32 0 ret void } @@ -738,7 +738,7 @@ fn super_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 0 ret void } @@ -746,7 +746,7 @@ fn super_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 0 %B.foo = alloca i16, align 2 %in = alloca i32, align 4 store i32 %1, ptr %in, align 4 @@ -761,7 +761,7 @@ fn super_is_untouched() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__A = getelementptr inbounds %B, ptr %0, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %0, i32 0, i32 0 %call = call i16 @A__foo(ptr %__A, i32 5) call void @A__bar(ptr %__A) ret void @@ -772,13 +772,13 @@ fn super_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @A, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @A__foo, ptr %foo, align 8 %deref2 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + %bar = getelementptr inbounds nuw %__vtable_A, ptr %deref2, i32 0, i32 2 store ptr @A__bar, ptr %bar, align 8 ret void } @@ -788,13 +788,13 @@ fn super_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_A, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_A, ptr %deref, i32 0, i32 0 store ptr @B, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %foo = getelementptr inbounds %__vtable_A, ptr %deref1, i32 0, i32 1 + %foo = getelementptr inbounds nuw %__vtable_A, ptr %deref1, i32 0, i32 1 store ptr @B__foo, ptr %foo, align 8 %deref2 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_A, ptr %deref2, i32 0, i32 2 + %bar = getelementptr inbounds nuw %__vtable_A, ptr %deref2, i32 0, i32 2 store ptr @B__bar, ptr %bar, align 8 ret void } @@ -804,7 +804,7 @@ fn super_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %A, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %deref, i32 0, i32 0 store ptr @__vtable_A_instance, ptr %__vtable, align 8 ret void } @@ -814,11 +814,11 @@ fn super_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__init_a(ptr %__A) %deref1 = load ptr, ptr %self, align 8 - %__A2 = getelementptr inbounds %B, ptr %deref1, i32 0, i32 0 - %__vtable = getelementptr inbounds %A, ptr %__A2, i32 0, i32 0 + %__A2 = getelementptr inbounds nuw %B, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %A, ptr %__A2, i32 0, i32 0 store ptr @__vtable_B_instance, ptr %__vtable, align 8 ret void } @@ -835,7 +835,7 @@ fn super_is_untouched() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__A = getelementptr inbounds %B, ptr %deref, i32 0, i32 0 + %__A = getelementptr inbounds nuw %B, ptr %deref, i32 0, i32 0 call void @__user_init_A(ptr %__A) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap index 9629a893488..8ec499bd037 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_array_in_struct.snap @@ -15,8 +15,8 @@ target triple = "[filtered]" define void @Main(ptr %0) { entry: - %m = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 - %field1 = getelementptr inbounds %MyStruct, ptr %m, i32 0, i32 0 + %m = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 0 + %field1 = getelementptr inbounds nuw %MyStruct, ptr %m, i32 0, i32 0 %tmpVar = getelementptr inbounds [5 x i16], ptr %field1, i32 0, i32 3 store i16 7, ptr %tmpVar, align 2 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap index 4edc24533e3..ce8dd2d9a10 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__accessing_nested_structs.snap @@ -17,12 +17,12 @@ target triple = "[filtered]" define void @Main(ptr %0) { entry: - %m = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 - %out1 = getelementptr inbounds %OuterStruct, ptr %m, i32 0, i32 0 - %inner1 = getelementptr inbounds %InnerStruct, ptr %out1, i32 0, i32 0 + %m = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 0 + %out1 = getelementptr inbounds nuw %OuterStruct, ptr %m, i32 0, i32 0 + %inner1 = getelementptr inbounds nuw %InnerStruct, ptr %out1, i32 0, i32 0 store i16 3, ptr %inner1, align 2 - %out2 = getelementptr inbounds %OuterStruct, ptr %m, i32 0, i32 1 - %inner2 = getelementptr inbounds %InnerStruct, ptr %out2, i32 0, i32 1 + %out2 = getelementptr inbounds nuw %OuterStruct, ptr %m, i32 0, i32 1 + %inner2 = getelementptr inbounds nuw %InnerStruct, ptr %out2, i32 0, i32 1 store i16 7, ptr %inner2, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap index 8129aeba925..72e2fd0d190 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__action_called_in_program.snap @@ -13,14 +13,14 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 call void @prg__foo(ptr %0) ret void } define void @prg__foo(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap index 3b27a486cd6..d0547d891e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_cast_int_type_generated.snap @@ -13,6 +13,6 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap index a6e671334e0..52f99051494 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_negative_type_generated.snap @@ -13,6 +13,6 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap index 3b27a486cd6..d0547d891e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_non_zero_type_generated.snap @@ -13,6 +13,6 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap index 3b27a486cd6..d0547d891e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_generated.snap @@ -13,6 +13,6 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap index d41174d7ba3..21a2e8d9173 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_used.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [4 x i32], ptr %x, i32 0, i32 1 store i32 3, ptr %tmpVar, align 4 %tmpVar1 = getelementptr inbounds [4 x i32], ptr %x, i32 0, i32 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap index 329cd3f7e53..9d6cf980251 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_negative_start_used.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [6 x i32], ptr %x, i32 0, i32 1 store i32 3, ptr %tmpVar, align 4 %tmpVar1 = getelementptr inbounds [6 x i32], ptr %x, i32 0, i32 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap index 1878e41ca5c..8bfe018a538 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_int_type_with_non_zero_start_used.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [3 x i32], ptr %x, i32 0, i32 0 store i32 3, ptr %tmpVar, align 4 %tmpVar1 = getelementptr inbounds [3 x i32], ptr %x, i32 0, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap index 5daf39db9d8..34d6573b4b3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_and_variable_declaration_is_initialized.snap @@ -18,6 +18,6 @@ target triple = "[filtered]" define void @mainProg(ptr %0) { entry: - %var_str1 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 + %var_str1 = getelementptr inbounds nuw %mainProg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap index dbdb8398881..fe6a2f84fe8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__array_of_struct_as_member_of_another_struct_is_initialized.snap @@ -18,6 +18,6 @@ target triple = "[filtered]" define void @mainProg(ptr %0) { entry: - %var_str1 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 + %var_str1 = getelementptr inbounds nuw %mainProg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap index 51cd3204664..f05e0585251 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_multiple_labels_statement.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 switch i32 %load_x, label %else [ i32 1, label %case diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap index f6737fc5532..a5437d95c9a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__case_with_ranges_statement.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 switch i32 %load_x, label %else [ ] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap index dae2d0395ec..a2776f9b20a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_bool_code_gen_test.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i8 1, ptr %z, align 1 store i8 0, ptr %z, align 1 store i8 1, ptr %z, align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap index 38e07f55717..9a084a2bc59 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_code_gen_test.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 %tmpVar = add i32 %1, 7 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap index 4c49e144e0f..d4bee31ddd2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_code_gen_test.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 %tmpVar = add i32 %1, 13 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap index c498459a751..abf2217ef63 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_hex_ints_code_gen_test.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 -1, ptr %x, align 4 store i32 65535, ptr %x, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap index cb31c1145a0..aa47a045ba2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_lreal_code_gen_test.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load float, ptr %x, align 4 %1 = fpext float %load_x to double %tmpVar = fadd double %1, 7.700000e+00 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap index 9ad8c0a8232..cde8ec8af1e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__casted_literals_real_code_gen_test.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 %1 = sitofp i16 %load_x to float %tmpVar = fdiv float %1, 7.000000e+00 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap index b236ecd6d7c..1721fbfeffe 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_member_access_from_method.snap @@ -13,15 +13,15 @@ target triple = "[filtered]" define void @MyClass(ptr %0) { entry: - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 ret void } define void @MyClass__testMethod(ptr %0, i16 %1) { entry: - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap index c29ee142191..ce2812edcad 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__class_method_in_pou.snap @@ -15,15 +15,15 @@ target triple = "[filtered]" define void @MyClass(ptr %0) { entry: - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 ret void } define void @MyClass__testMethod(ptr %0, i16 %1) { entry: - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 @@ -42,9 +42,9 @@ entry: define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x1 = getelementptr inbounds %MyClass, ptr %cl, i32 0, i32 0 + %cl = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x1 = getelementptr inbounds nuw %MyClass, ptr %cl, i32 0, i32 0 %load_x = load i16, ptr %x1, align 2 store i16 %load_x, ptr %x, align 2 %load_x2 = load i16, ptr %x, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap index 9fd9f6353ec..de6ff86f827 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__complex_pointers.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %X = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %arrX = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %arrrX = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %rarrX = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %X = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %arrX = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %arrrX = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %rarrX = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 %tmpVar = getelementptr inbounds [10 x i16], ptr %arrX, i32 0, i32 0 %load_X = load i16, ptr %X, align 2 store i16 %load_X, ptr %tmpVar, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap index d1085a25545..3a0d797b6fd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expression_in_function_blocks_are_propagated.snap @@ -15,8 +15,8 @@ define void @fbWithConstant(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %fbWithConstant, ptr %0, i32 0, i32 0 - %const = getelementptr inbounds %fbWithConstant, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %fbWithConstant, ptr %0, i32 0, i32 0 + %const = getelementptr inbounds nuw %fbWithConstant, ptr %0, i32 0, i32 1 store i16 2, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap index ac2090393ba..9f6c62bc0cb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__constant_expressions_in_ranged_type_declaration_are_propagated.snap @@ -30,7 +30,7 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 5, i16 0, i16 8) store i16 %call, ptr %x, align 2 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap index deee127e180..05137f95352 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__contants_in_case_statements_resolved.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %DAYS_IN_MONTH = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %SIXTY = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %DAYS_IN_MONTH = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %SIXTY = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %load_DAYS_IN_MONTH = load i32, ptr %DAYS_IN_MONTH, align 4 switch i32 %load_DAYS_IN_MONTH, label %else [ ] diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap index 8861eebc1fb..5fa62f74918 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__date_comparisons.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %d = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %d = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 %load_a = load i64, ptr %a, align 8 %tmpVar = icmp sgt i64 %load_a, 1619827200000000000 %load_b = load i64, ptr %b, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap index 4b0a78b0bd7..38986e8c45a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__different_case_references.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %zz = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %zz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap index f3386184676..8595d140303 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__empty_statements_dont_generate_anything.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 %load_y = load i32, ptr %y, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap index 2b4e4aa1da8..345e3a9791c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enum_members_can_be_used_in_asignments.snap @@ -16,7 +16,7 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %color = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %color = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 store i32 0, ptr %color, align 4 store i32 1, ptr %color, align 4 store i32 2, ptr %color, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap index 4a280575fc6..556c5221054 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__enums_custom_type_are_generated.snap @@ -17,6 +17,6 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %tf1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %tf1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap index 1a24db60449..2a744300308 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_called_as_function.snap @@ -15,8 +15,8 @@ define void @MyClass(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 %call = call i16 @MyClass__testMethod(ptr %0, i16 1) %call1 = call i16 @MyClass__testMethod(ptr %0, i16 3) ret void @@ -26,8 +26,8 @@ define i16 @MyClass__testMethod(ptr %0, i16 %1) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 %MyClass.testMethod = alloca i16, align 2 %myMethodArg = alloca i16, align 2 store i16 %1, ptr %myMethodArg, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap index 791c230ab74..ecc242e67f8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_in_pou.snap @@ -17,8 +17,8 @@ define void @MyClass(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 ret void } @@ -26,8 +26,8 @@ define void @MyClass__testMethod(ptr %0, i16 %1) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 store i16 %1, ptr %myMethodArg, align 2 %myMethodLocalVar = alloca i16, align 2 @@ -46,9 +46,9 @@ entry: define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x1 = getelementptr inbounds %MyClass, ptr %cl, i32 0, i32 0 + %cl = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x1 = getelementptr inbounds nuw %MyClass, ptr %cl, i32 0, i32 0 %load_x = load i16, ptr %x1, align 2 store i16 %load_x, ptr %x, align 2 %load_x2 = load i16, ptr %x, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap index 05462ad5e75..e8f94457e87 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_in_out.snap @@ -17,8 +17,8 @@ define void @MyClass(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 ret void } @@ -26,8 +26,8 @@ define void @MyClass__testMethod(ptr %0, ptr %1) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca ptr, align 8 store ptr %1, ptr %myMethodArg, align 8 %deref = load ptr, ptr %myMethodArg, align 8 @@ -38,8 +38,8 @@ entry: define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %cl = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @MyClass__testMethod(ptr %cl, ptr %x) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap index f0193d8336a..dab9fa99b51 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__fb_method_with_var_input_defaults.snap @@ -17,8 +17,8 @@ define void @MyClass(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 ret void } @@ -26,8 +26,8 @@ define void @MyClass__testMethod(ptr %0, i16 %1) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %MyClass, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %MyClass, ptr %0, i32 0, i32 1 %myMethodArg = alloca i16, align 2 store i16 %1, ptr %myMethodArg, align 2 %load_myMethodArg = load i16, ptr %myMethodArg, align 2 @@ -37,7 +37,7 @@ entry: define void @prg(ptr %0) { entry: - %cl = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %cl = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 call void @MyClass__testMethod(ptr %cl, i16 3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap index 328eb68c31b..7d22bee8b04 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_continue.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap index 6fdc379f7c4..1ef4186c8f3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_int.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i16 3, ptr %x, align 2 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap index 4dd3d7b90ef..297abbe3da6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_lint.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i64 3, ptr %x, align 8 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap index fd7ce7882a3..2100b66f40d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_sint.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i8 3, ptr %x, align 1 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap index a13430a13b8..c0a5428a3e0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_continue.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap index bf9642578ee..c15977ad91a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_exit.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap index 130582b4cd6..9525a29e788 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_references_steps_test.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %step = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %step = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 %load_y = load i32, ptr %y, align 4 store i32 %load_y, ptr %x, align 4 %load_step = load i32, ptr %step, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap index f9cd155409b..de417fdb7f9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_with_steps_test.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap index f109ea0eb32..67d094a6f74 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__for_statement_without_steps_test.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 3, ptr %x, align 4 br i1 true, label %predicate_sle, label %predicate_sge diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap index c2c787e4b0d..b691128df4e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_instance_call.snap @@ -17,14 +17,14 @@ define void @foo(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } define void @prg(ptr %0) { entry: - %fb_inst = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %fb_inst = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 call void @foo(ptr %fb_inst) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap index 4bf6a0458d1..9591c13f73d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_block_qualified_instance_call.snap @@ -19,7 +19,7 @@ define void @foo(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %bar_inst = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %bar_inst = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -32,8 +32,8 @@ entry: define void @prg(ptr %0) { entry: - %foo_inst = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %bar_inst = getelementptr inbounds %foo, ptr %foo_inst, i32 0, i32 0 + %foo_inst = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %bar_inst = getelementptr inbounds nuw %foo, ptr %foo_inst, i32 0, i32 0 call void @bar(ptr %bar_inst) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap index b3593a280fc..9f0f56be426 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_in_program.snap @@ -22,7 +22,7 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo() store i32 %call, ptr %x, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap index 88dfecdc10c..4ab6d4e6ab0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_called_when_shadowed.snap @@ -22,7 +22,7 @@ entry: define void @prg(ptr %0) { entry: - %froo = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %froo = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo() store i32 %call, ptr %froo, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap index bcb11520156..568ac1f4e2b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_parameters_called_in_program.snap @@ -24,7 +24,7 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo(i32 2) store i32 %call, ptr %x, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap index 25a8c23e288..096a79a7f7e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__function_with_two_parameters_called_in_program.snap @@ -26,7 +26,7 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %call = call i32 @foo(i32 2, i8 1) store i32 %call, ptr %x, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap index 61c40a6ca53..52f6a168c5f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__global_variable_reference_is_generated.snap @@ -14,7 +14,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i16 20, ptr @gX, align 2 %load_gX = load i16, ptr @gX, align 2 store i16 %load_gX, ptr %x, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap index ed5d5fa87d2..5983f7994f8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_elsif_else_generator_test.snap @@ -13,13 +13,13 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %u = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 - %b1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 4 - %b2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 5 - %b3 = getelementptr inbounds %prg, ptr %0, i32 0, i32 6 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %u = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 + %b1 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 4 + %b2 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 5 + %b3 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 6 %load_b1 = load i8, ptr %b1, align 1 %1 = icmp ne i8 %load_b1, 0 br i1 %1, label %condition_body, label %branch diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap index 78445fb9f75..3ec27f598a9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_generator_test.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b1 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_b1 = load i8, ptr %b1, align 1 %1 = icmp ne i8 %load_b1, 0 br i1 %1, label %condition_body, label %continue diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap index dc39da55a81..87dbe297bd1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__if_with_expression_generator_test.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b1 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 %tmpVar = icmp sgt i32 %load_x, 1 %1 = zext i1 %tmpVar to i8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap index 883cb316a9c..0a7123ab0e3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__inlined_array_size_from_local_scoped_constants.snap @@ -16,9 +16,9 @@ target triple = "[filtered]" define void @aaa(ptr %0) { entry: - %a = getelementptr inbounds %aaa, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %aaa, ptr %0, i32 0, i32 1 - %arr = getelementptr inbounds %aaa, ptr %0, i32 0, i32 2 - %arr2 = getelementptr inbounds %aaa, ptr %0, i32 0, i32 3 + %a = getelementptr inbounds nuw %aaa, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %aaa, ptr %0, i32 0, i32 1 + %arr = getelementptr inbounds nuw %aaa, ptr %0, i32 0, i32 2 + %arr2 = getelementptr inbounds nuw %aaa, ptr %0, i32 0, i32 3 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap index 6c7bbbe470a..23de519c4ee 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__min_max_real_and_lreal_values_do_not_result_in_an_under_or_overflow.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %F32_MIN = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %F32_MAX = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %F64_MIN = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %F64_MAX = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %F32_MIN = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %F32_MAX = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %F64_MIN = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %F64_MAX = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap index d5d868c40e8..d33b4ed8ec0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_access.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [8 x i32], ptr %x, i32 0, i32 4 store i32 3, ptr %tmpVar, align 4 %tmpVar1 = getelementptr inbounds [8 x i32], ptr %x, i32 0, i32 7 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap index 5d39a7d2592..ec5088d0761 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__multidim_array_declaration.snap @@ -13,6 +13,6 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap index 89471d1a24f..d30f0d2ce3d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_access.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %tmpVar = getelementptr inbounds [4 x [2 x i32]], ptr %x, i32 0, i32 2 %tmpVar1 = getelementptr inbounds [2 x i32], ptr %tmpVar, i32 0, i32 0 store i32 3, ptr %tmpVar1, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap index 58f9a58650d..6deacc4ee02 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %z = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %cube = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %cube = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 %load_x = load i16, ptr %x, align 2 %1 = sext i16 %load_x to i32 %tmpVar = mul i32 25, %1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap index 391289fc717..bc75e8035f6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_cube_writes_negative_start.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %z = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %cube = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %cube = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 %load_x = load i16, ptr %x, align 2 %1 = sub i16 %load_x, -2 %2 = sext i16 %1 to i32 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap index c1fb70344f4..72df30c4981 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_array_declaration.snap @@ -13,6 +13,6 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap index a5dc66744a0..42a6e01a207 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__nested_function_called_in_program.snap @@ -33,7 +33,7 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %call = call i32 @bar() %call1 = call i32 @foo(i32 %call) store i32 %call1, ptr %x, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap index af52d15565c..f61c3e15738 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__order_var_and_var_temp_block.snap @@ -14,7 +14,7 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: %temp = alloca i16, align 2 - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 store i16 0, ptr %temp, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap index c6c6f316d57..cbd40ddd881 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pass_inout_to_inout.snap @@ -17,26 +17,26 @@ target triple = "[filtered]" define void @foo2(ptr %0) { entry: - %inout = getelementptr inbounds %foo2, ptr %0, i32 0, i32 0 - %in = getelementptr inbounds %foo2, ptr %0, i32 0, i32 1 + %inout = getelementptr inbounds nuw %foo2, ptr %0, i32 0, i32 0 + %in = getelementptr inbounds nuw %foo2, ptr %0, i32 0, i32 1 ret void } define void @foo(ptr %0) { entry: - %inout = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %inout = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %inout, align 8 store ptr %deref, ptr @foo2_instance, align 8 %deref1 = load ptr, ptr %inout, align 8 %load_inout = load i32, ptr %deref1, align 4 - store i32 %load_inout, ptr getelementptr inbounds (%foo2, ptr @foo2_instance, i32 0, i32 1), align 4 + store i32 %load_inout, ptr getelementptr inbounds nuw (%foo2, ptr @foo2_instance, i32 0, i32 1), align 4 call void @foo2(ptr @foo2_instance) ret void } define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %baz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store ptr %baz, ptr @foo_instance, align 8 call void @foo(ptr @foo_instance) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap index 6496e35790e..314cc3ec3cd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__pointers_generated.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %X = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %pX = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %rX = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %X = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %pX = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %rX = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 store ptr null, ptr %pX, align 8 store ptr null, ptr %rX, align 8 store ptr %X, ptr %pX, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap index d691fe0d0c7..12bd5b2dda0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_and_statement.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 br i1 %1, label %2, label %4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap index f2092185fb0..78f680fc396 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_bool_variables_and_references_generates_void_function_and_struct_and_body.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i8, ptr %x, align 1 %load_y = load i8, ptr %y, align 1 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap index 0c19be33366..a76012c128c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_boolean_assignment_generates_void_function_and_struct_and_body.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i8 1, ptr %y, align 1 store i8 0, ptr %y, align 1 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap index 4b4f690205e..31ead9fcf99 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_casted_chars_assignment.snap @@ -15,8 +15,8 @@ target triple = "[filtered]" define void @mainPROG(ptr %0) { entry: - %x = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %mainPROG, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %mainPROG, ptr %0, i32 0, i32 1 store i8 65, ptr %x, align 1 store i16 66, ptr %y, align 2 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap index 9d5740aed27..8da29e98fbe 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_chars.snap @@ -19,8 +19,8 @@ target triple = "[filtered]" define void @mainPROG(ptr %0) { entry: - %x = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %mainPROG, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %mainPROG, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %mainPROG, ptr %0, i32 0, i32 1 store i8 97, ptr %x, align 1 store i8 32, ptr %x, align 1 store i16 65, ptr %y, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap index 2b61a450bb4..b8dd9a05af3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %w = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %w = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 store i64 56190123000000, ptr %w, align 8 store i64 56190123000000, ptr %w, align 8 store i64 100012000000, ptr %x, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap index 8636a68e53b..ba84bffed8c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_date_assignment_whit_short_datatype_names.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %w = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %w = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 store i64 56190123000000, ptr %w, align 8 store i64 56190123000000, ptr %w, align 8 store i64 100012000000, ptr %x, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap index 3a9c7325724..bc1b8765be5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_floats_variable_and_comparison_assignment_generates_correctly.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load float, ptr %x, align 4 %tmpVar = fcmp oeq float %load_x, 1.000000e+00 %1 = zext i1 %tmpVar to i8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap index 97260be549b..ec14f4268bf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_local_temp_var_initialization.snap @@ -15,7 +15,7 @@ target triple = "[filtered]" define void @foo(ptr %0) { entry: - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %y = alloca i16, align 2 %z = alloca i16, align 2 store i16 0, ptr %y, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap index 37a215ca85b..05e17398d60 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_long_date_assignment.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %w = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %w = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 store i64 100012006003, ptr %w, align 8 store i64 100012006003, ptr %w, align 8 store i64 465436800000000000, ptr %x, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap index e1935962b00..9be3c16b314 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_combined_expressions_generates_void_function_and_struct_and_body.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_y = load i8, ptr %y, align 1 %1 = icmp ne i8 %load_y, 0 br i1 %1, label %2, label %3 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap index d3de0f00aae..1a39b4d172f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_negated_expressions_generates_void_function_and_struct_and_body.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 %tmpVar = xor i1 %1, true diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap index 34d030a6240..a7a7938d667 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_or_statement.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 br i1 %1, label %4, label %2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap index e29598e0058..f2f52747f04 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_additions.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 store float 1.237500e+01, ptr %x, align 4 store float 2.500000e-01, ptr %y, align 4 %load_x = load float, ptr %x, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap index 90887be96a3..6eaa68b463e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_assignment.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store float 1.562500e-01, ptr %y, align 4 store float 1.000000e+02, ptr %y, align 4 store float 1.000000e+03, ptr %y, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap index 9a449f3795c..4e11603f674 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_real_cast_assignment.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 %1 = sitofp i16 %load_x to float store float %1, ptr %y, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap index a08bb8d2c53..e6ef03cf3f2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_signed_combined_expressions.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_z = load i32, ptr %z, align 4 %tmpVar = add i32 -1, %load_z %load_z1 = load i32, ptr %z, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap index dc4549c68ae..cea09590df9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap @@ -17,10 +17,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %should_replace_s = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %should_not_replace_s = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %should_replace_ws = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %should_not_replace_ws = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %should_replace_s = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %should_not_replace_s = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %should_replace_ws = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %should_not_replace_ws = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %should_replace_s, ptr align 1 @utf08_literal_1, i32 41, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 1 %should_not_replace_s, ptr align 1 @utf08_literal_0, i32 19, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %should_replace_ws, ptr align 2 @utf16_literal_1, i32 82, i1 false) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap index 88b04a84a0d..b99cc6272f7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap @@ -15,8 +15,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %z, ptr align 2 @utf16_literal_0, i32 36, i1 false) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap index 5a24b567e50..e3234956439 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_assignment.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i64 0, ptr %y, align 8 store i64 43200000000000, ptr %y, align 8 store i64 100000000, ptr %y, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap index 2f229ebb390..054f4f69884 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_time_of_day_assignment.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i64 0, ptr %y, align 8 store i64 3600000000000, ptr %y, align 8 store i64 3600001000000, ptr %y, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap index 3e6a9387023..1a5528a694b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_explicit_parameters_called_in_program.snap @@ -15,14 +15,14 @@ target triple = "[filtered]" define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } define void @prg(ptr %0) { entry: - store i8 1, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + store i8 1, ptr getelementptr inbounds nuw (%foo, ptr @foo_instance, i32 0, i32 1), align 1 store i32 2, ptr @foo_instance, align 4 call void @foo(ptr @foo_instance) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap index 7348f4e1eae..1d7f9fe8772 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_two_parameters_called_in_program.snap @@ -15,15 +15,15 @@ target triple = "[filtered]" define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } define void @prg(ptr %0) { entry: store i32 2, ptr @foo_instance, align 4 - store i8 1, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + store i8 1, ptr getelementptr inbounds nuw (%foo, ptr @foo_instance, i32 0, i32 1), align 1 call void @foo(ptr @foo_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap index 0d7417f4686..d404f8ad56f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_inout_called_in_program.snap @@ -15,7 +15,7 @@ target triple = "[filtered]" define void @foo(ptr %0) { entry: - %inout = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %inout = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %deref = load ptr, ptr %inout, align 8 %deref1 = load ptr, ptr %inout, align 8 %load_inout = load i32, ptr %deref1, align 4 @@ -26,7 +26,7 @@ entry: define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %baz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 7, ptr %baz, align 4 store ptr %baz, ptr @foo_instance, align 8 call void @foo(ptr @foo_instance) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap index 9f58b9a932d..24ac0795dc4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_in_program.snap @@ -15,17 +15,17 @@ target triple = "[filtered]" define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %baz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 2, ptr @foo_instance, align 4 call void @foo(ptr @foo_instance) - %1 = load i8, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + %1 = load i8, ptr getelementptr inbounds nuw (%foo, ptr @foo_instance, i32 0, i32 1), align 1 store i8 %1, ptr %baz, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap index 9f58b9a932d..24ac0795dc4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_var_out_called_mixed_in_program.snap @@ -15,17 +15,17 @@ target triple = "[filtered]" define void @foo(ptr %0) { entry: - %bar = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %buz = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %bar = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %buz = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } define void @prg(ptr %0) { entry: - %baz = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %baz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 2, ptr @foo_instance, align 4 call void @foo(ptr @foo_instance) - %1 = load i8, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 1 + %1 = load i8, ptr getelementptr inbounds nuw (%foo, ptr @foo_instance, i32 0, i32 1), align 1 store i8 %1, ptr %baz, align 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap index 2c1027ef66c..d4c2150afe5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_addition_literal_generates_void_function_and_struct_and_body.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 7 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap index 323ea9237ef..0d47dfae223 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_arithmatic_assignment_generates_void_function_and_struct_and_body.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 1 store i32 %tmpVar, ptr %y, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap index 11b48f6d9cc..fcfe62c2599 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_and_comparison_assignment_generates_void_function_and_struct_and_body.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 %tmpVar = icmp eq i32 %load_x, 1 %1 = zext i1 %tmpVar to i8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap index 592f0ac5087..59c23721730 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variable_assignment_generates_void_function_and_struct_and_body.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 7, ptr %y, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap index 790db336029..8651e460681 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_additions_generates_void_function_and_struct_and_body.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 %load_y = load i32, ptr %y, align 4 %tmpVar = add i32 %load_x, %load_y diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap index f3386184676..8595d140303 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_and_references_generates_void_function_and_struct_and_body.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 %load_y = load i32, ptr %y, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap index 4e35a472e67..b2e6cd30375 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_variables_generates_void_function_and_struct.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap index e9468544cf2..8f0f9ad1f57 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_xor_statement.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_x = load i8, ptr %x, align 1 %1 = icmp ne i8 %load_x, 0 %load_y = load i8, ptr %y, align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap index 02e9cd51139..6ca051913ab 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_action_from_fb_called_in_program.snap @@ -15,7 +15,7 @@ target triple = "[filtered]" define void @bar(ptr %0) { entry: - %fb_inst = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 + %fb_inst = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 call void @fb__foo(ptr %fb_inst) ret void } @@ -24,7 +24,7 @@ define void @fb(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void } @@ -32,7 +32,7 @@ define void @fb__foo(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap index 15be5909d73..4ca6976a4c5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_foreign_action_called_in_program.snap @@ -21,13 +21,13 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } define void @prg__foo(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap index bb6397a71b9..bba2ca86a72 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__qualified_local_action_called_in_program.snap @@ -13,14 +13,14 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 call void @prg__foo(ptr @prg_instance) ret void } define void @prg__foo(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 2, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap index 712befc8988..c7e77d41472 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__real_function_called_in_program.snap @@ -22,7 +22,7 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %call = call float @foo() %1 = fptosi float %call to i32 store i32 %1, ptr %x, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap index 7bd6141bf26..150933348d0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_qualified_name.snap @@ -19,26 +19,26 @@ define void @fb(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void } define void @foo(ptr %0) { entry: - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %baz = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %baz = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 ret void } define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %load_x = load i32, ptr @foo_instance, align 4 store i32 %load_x, ptr %x, align 4 - %load_y = load i32, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 1), align 4 + %load_y = load i32, ptr getelementptr inbounds nuw (%foo, ptr @foo_instance, i32 0, i32 1), align 4 store i32 %load_y, ptr %x, align 4 - %load_x1 = load i32, ptr getelementptr inbounds (%foo, ptr @foo_instance, i32 0, i32 2), align 4 + %load_x1 = load i32, ptr getelementptr inbounds nuw (%foo, ptr @foo_instance, i32 0, i32 2), align 4 store i32 %load_x1, ptr %x, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap index 1f79cbdabc7..ed7f0d03256 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__reference_to_reference_assignments_in_function_arguments.snap @@ -23,18 +23,18 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %input2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %input1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %input2 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 ret void } define void @main(ptr %0) { entry: store ptr @global1, ptr @prog_instance, align 8 - store ptr @global2, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 8 + store ptr @global2, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), align 8 call void @prog(ptr @prog_instance) store ptr @global4, ptr @prog_instance, align 8 - store ptr @global5, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 8 + store ptr @global5, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), align 8 call void @prog(ptr @prog_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap index 13f4d6ff2dd..f3368246994 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__repeat_statement.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap index 00be307a76e..816450cb582 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__returning_early_in_function_block.snap @@ -15,7 +15,7 @@ define void @abcdef(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %n = getelementptr inbounds %abcdef, ptr %0, i32 0, i32 0 + %n = getelementptr inbounds nuw %abcdef, ptr %0, i32 0, i32 0 %load_n = load i8, ptr %n, align 1 %1 = sext i8 %load_n to i32 %tmpVar = icmp slt i32 %1, 10 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap index c3fdfa53609..fa7e2931cc1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_i8_statement.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i8, ptr %x, align 1 switch i8 %load_x, label %else [ i8 1, label %case diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap index af2c70caea5..06d1590ecdc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__simple_case_statement.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i32, ptr %x, align 4 switch i32 %load_x, label %else [ i32 1, label %case diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap index fb0151b3f1c..9b71b333a63 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__structs_members_can_be_referenced.snap @@ -15,8 +15,8 @@ target triple = "[filtered]" define void @MainProg(ptr %0) { entry: - %Cord = getelementptr inbounds %MainProg, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %MyStruct, ptr %Cord, i32 0, i32 0 + %Cord = getelementptr inbounds nuw %MainProg, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %MyStruct, ptr %Cord, i32 0, i32 0 store i32 0, ptr %a, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap index 4ad404f970b..b859922c9ca 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_check_functions.snap @@ -73,16 +73,16 @@ entry: define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %d = getelementptr inbounds %main, ptr %0, i32 0, i32 3 - %e = getelementptr inbounds %main, ptr %0, i32 0, i32 4 - %f = getelementptr inbounds %main, ptr %0, i32 0, i32 5 - %g = getelementptr inbounds %main, ptr %0, i32 0, i32 6 - %h = getelementptr inbounds %main, ptr %0, i32 0, i32 7 - %i = getelementptr inbounds %main, ptr %0, i32 0, i32 8 - %j = getelementptr inbounds %main, ptr %0, i32 0, i32 9 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %d = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 + %e = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 4 + %f = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 5 + %g = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 6 + %h = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 7 + %i = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 8 + %j = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 9 %call = call i32 @CheckRangeUnsigned(i32 1, i32 0, i32 100) %1 = trunc i32 %call to i8 store i8 %1, ptr %a, align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap index 1e084a41fe0..adeeabcfa51 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_missing.snap @@ -29,7 +29,7 @@ entry: define void @Main(ptr %0) { entry: - %x = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 0 store i16 7, ptr %x, align 2 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap index f6c66f16bf6..8b4efe256bb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__sub_range_type_calls_check_function_on_assigment.snap @@ -29,7 +29,7 @@ entry: define void @Main(ptr %0) { entry: - %x = getelementptr inbounds %Main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %Main, ptr %0, i32 0, i32 0 %call = call i16 @CheckRangeSigned(i16 7, i16 0, i16 100) store i16 %call, ptr %x, align 2 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap index 3e8d5b6bcc9..7b61399f925 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__time_variables_have_nano_seconds_resolution.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i64 1000000, ptr %y, align 8 store i64 1000, ptr %y, align 8 store i64 100, ptr %y, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap index 7549c18fe39..a7b294bdd60 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__typed_enums_are_used_properly.snap @@ -22,9 +22,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 store i8 6, ptr %x, align 1 store i16 16, ptr %y, align 2 store i32 26, ptr %z, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap index 1444a3bea2a..a545c43fa31 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_cast_statement_as_const_expression.snap @@ -13,6 +13,6 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap index a65bf5c4f69..157bc9e832b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_const_expression_in_range_type.snap @@ -31,7 +31,7 @@ entry: define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %load_MIN = load i16, ptr @MIN, align 2 %1 = sext i16 %load_MIN to i32 %tmpVar = add i32 %1, 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap index 82bc133ae37..db3008a547a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__using_global_consts_in_expressions.snap @@ -16,7 +16,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 store i32 6, ptr %z, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap index 48a354b3796..d747a3164b0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__variable_with_same_name_as_data_type.snap @@ -23,6 +23,6 @@ entry: define void @prog(ptr %0) { entry: - %TIME = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %TIME = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap index a925cc40b5a..bbc4d3de8ce 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_loop_with_if_exit.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue5 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap index 7279cb33bc5..5ad24f19d7b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_statement.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap index 83ef67930af..1d819ec341f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__while_with_expression_statement.snap @@ -13,7 +13,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 br label %condition_check condition_check: ; preds = %entry, %continue1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap index 123412af205..ae0152f449b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_datetime_types.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %var_time = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var_time_of_day = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var_date = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %var_date_and_time = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %var_time = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var_time_of_day = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var_date = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %var_date_and_time = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 %load_var_time = load i64, ptr %var_time, align 8 %load_var_time_of_day = load i64, ptr %var_time_of_day, align 8 %tmpVar = icmp sgt i64 %load_var_time, %load_var_time_of_day diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap index 1d701af4abf..07701cec589 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instruction_functions_with_different_types.snap @@ -21,19 +21,19 @@ entry: define void @main(ptr %0) { entry: - %ptr_float = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %var_real = getelementptr inbounds %main, ptr %0, i32 0, i32 3 - %var_lreal = getelementptr inbounds %main, ptr %0, i32 0, i32 4 - %var_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 5 - %var_int = getelementptr inbounds %main, ptr %0, i32 0, i32 6 - %var_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 7 - %var_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 8 - %var_usint = getelementptr inbounds %main, ptr %0, i32 0, i32 9 - %var_uint = getelementptr inbounds %main, ptr %0, i32 0, i32 10 - %var_udint = getelementptr inbounds %main, ptr %0, i32 0, i32 11 - %var_ulint = getelementptr inbounds %main, ptr %0, i32 0, i32 12 + %ptr_float = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %var_real = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 + %var_lreal = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 4 + %var_sint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 5 + %var_int = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 6 + %var_dint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 7 + %var_lint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 8 + %var_usint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 9 + %var_uint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 10 + %var_udint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 11 + %var_ulint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 12 store ptr %var_real, ptr %ptr_float, align 8 %load_var_sint = load i8, ptr %var_sint, align 1 %1 = sext i8 %load_var_sint to i32 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap index c96ed8e2b89..89352dc91cb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__compare_instructions_with_different_types.snap @@ -21,17 +21,17 @@ entry: define void @main(ptr %0) { entry: - %ptr_int = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %var_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 3 - %var_int = getelementptr inbounds %main, ptr %0, i32 0, i32 4 - %var_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 5 - %var_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 6 - %var_usint = getelementptr inbounds %main, ptr %0, i32 0, i32 7 - %var_uint = getelementptr inbounds %main, ptr %0, i32 0, i32 8 - %var_udint = getelementptr inbounds %main, ptr %0, i32 0, i32 9 - %var_ulint = getelementptr inbounds %main, ptr %0, i32 0, i32 10 + %ptr_int = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %var_sint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 + %var_int = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 4 + %var_dint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 5 + %var_lint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 6 + %var_usint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 7 + %var_uint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 8 + %var_udint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 9 + %var_ulint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 10 store ptr %var_int, ptr %ptr_int, align 8 %load_var_sint = load i8, ptr %var_sint, align 1 %1 = sext i8 %load_var_sint to i32 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap index 53cb11d6ac4..b71befe20a5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_compare_instructions.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %comp = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %pt = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %comp = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 store ptr %x, ptr %pt, align 8 %load_pt = load ptr, ptr %pt, align 8 %load_pt1 = load ptr, ptr %pt, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap index 3fefaeaa816..40173222b93 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__pointer_function_call_compare_instructions.snap @@ -21,9 +21,9 @@ entry: define void @main(ptr %0) { entry: - %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %comp = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %pt = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %comp = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 store ptr %x, ptr %pt, align 8 %load_pt = load ptr, ptr %pt, align 8 %call = call i64 @foo() diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap index b2a21d167d6..df9d360ca7a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap @@ -14,7 +14,7 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %arr = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %arr = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %arr, ptr align 1 @const_arr, i64 ptrtoint (ptr getelementptr ([4 x i16], ptr null, i32 1) to i64), i1 false) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap index f3e9a74deca..c9e9d7e510f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap @@ -14,7 +14,7 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %str = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %str = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %str, ptr align 1 @const_str, i32 80, i1 false) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap index 32548439569..e3146088dc7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap @@ -16,7 +16,7 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %strct = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %strct = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %strct, ptr align 1 @const_strct, i64 ptrtoint (ptr getelementptr (%Point, ptr null, i32 1) to i64), i1 false) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap index d3739b66be6..ea3e1afcccd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__debug_tests__global_var_nested_struct_added_to_debug_info.snap @@ -20,7 +20,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %myStruct, ptr %deref, i32 0, i32 1 + %b = getelementptr inbounds nuw %myStruct, ptr %deref, i32 0, i32 1 call void @__init_mystruct2(ptr %b) ret void } @@ -37,7 +37,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %b = getelementptr inbounds %myStruct, ptr %deref, i32 0, i32 1 + %b = getelementptr inbounds nuw %myStruct, ptr %deref, i32 0, i32 1 call void @__user_init_myStruct2(ptr %b) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap index caf445534f2..27e249741a6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap @@ -17,12 +17,12 @@ entry: %str = alloca %myStruct, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %str, ptr align 1 @__myStruct__init, i64 ptrtoint (ptr getelementptr (%myStruct, ptr null, i32 1) to i64), i1 false) store i16 0, ptr %main, align 2 - %x = getelementptr inbounds %myStruct, ptr %str, i32 0, i32 0 + %x = getelementptr inbounds nuw %myStruct, ptr %str, i32 0, i32 0 %0 = load i8, ptr %x, align 1 %erase = and i8 %0, -2 %or = or i8 %erase, 0 store i8 %or, ptr %x, align 1 - %x1 = getelementptr inbounds %myStruct, ptr %str, i32 0, i32 0 + %x1 = getelementptr inbounds nuw %myStruct, ptr %str, i32 0, i32 0 %1 = load i8, ptr %x1, align 1 %erase2 = and i8 %1, -3 %or3 = or i8 %erase2, 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap index 5f2f96e0ab0..31259066bce 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__access_string_via_byte_array.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @baz(ptr %0) { entry: - %str = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 - %ptr = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 - %bytes = getelementptr inbounds %baz, ptr %0, i32 0, i32 2 + %str = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 0 + %ptr = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 1 + %bytes = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 2 store ptr %str, ptr %ptr, align 8 store ptr %str, ptr %bytes, align 8 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap index fab401011f7..6df048d6c79 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__allowed_assignable_types.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %v = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %z = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %v = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %z = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 store i16 0, ptr %v, align 2 %tmpVar = getelementptr inbounds [2 x i16], ptr %x, i32 0, i32 0 store i16 1, ptr %tmpVar, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap index 120119ae1ef..452d4345e5f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux.snap @@ -13,11 +13,11 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %d = getelementptr inbounds %main, ptr %0, i32 0, i32 3 - %e = getelementptr inbounds %main, ptr %0, i32 0, i32 4 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %d = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 + %e = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 4 %1 = alloca i32, align 4 switch i32 3, label %continue_block [ i32 0, label %2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap index 79ae8156740..0081423cb60 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap @@ -17,7 +17,7 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %str1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %str1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %1 = alloca [81 x i8], align 1 switch i32 3, label %continue_block [ i32 0, label %2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap index ef5cde1797f..4737413a878 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_sel_as_expression.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_b = load i32, ptr %b, align 4 %load_c = load i32, ptr %c, align 4 %1 = select i1 true, i32 %load_c, i32 %load_b diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap index ad5cafcfaf4..dd5603dc718 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_upper_bound_expr.snap @@ -16,13 +16,13 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %auto_deref = load [16 x i32], ptr %a, align 4 %outer_arr_gep = getelementptr inbounds [16 x i32], ptr %a, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [8 x i32] [i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %1 = load %__foo_vla, ptr %vla_struct, align 8 @@ -40,12 +40,12 @@ entry: store ptr %0, ptr %vla, align 8 store i32 0, ptr %foo, align 4 %deref = load ptr, ptr %vla, align 8 - %dim = getelementptr inbounds %__foo_vla, ptr %deref, i32 0, i32 1 + %dim = getelementptr inbounds nuw %__foo_vla, ptr %deref, i32 0, i32 1 %1 = getelementptr inbounds [2 x i32], ptr %dim, i32 0, i32 7 %2 = load i32, ptr %1, align 4 store i32 %2, ptr %foo, align 4 %deref1 = load ptr, ptr %vla, align 8 - %dim2 = getelementptr inbounds %__foo_vla, ptr %deref1, i32 0, i32 1 + %dim2 = getelementptr inbounds nuw %__foo_vla, ptr %deref1, i32 0, i32 1 %3 = getelementptr inbounds [2 x i32], ptr %dim2, i32 0, i32 7 %4 = load i32, ptr %3, align 4 store i32 %4, ptr %foo, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap index 7f48234ffb5..0e2dcc590cf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap @@ -23,7 +23,7 @@ entry: define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %__func0 = alloca [81 x i8], align 1 call void @llvm.memset.p0.i64(ptr align 1 %__func0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) call void @func(ptr %__func0) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap index cd0c4426f55..5d6e6bd2964 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__cast_between_pointer_types.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @baz(ptr %0) { entry: - %ptr_x = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 + %ptr_x = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 1 store ptr %y, ptr %ptr_x, align 8 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap index 36dd48f33ed..370cab433c8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %pt = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 store ptr %x, ptr %pt, align 8 %load_pt = load ptr, ptr %pt, align 8 %access___main_pt = getelementptr inbounds i16, ptr %load_pt, i32 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap index 4c6ddacc7bc..65cf973c13a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__pointer_arithmetics_function_call.snap @@ -21,8 +21,8 @@ entry: define void @main(ptr %0) { entry: - %pt = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %pt = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 store ptr %x, ptr %pt, align 8 %load_pt = load ptr, ptr %pt, align 8 %call = call i64 @foo() diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap index 01702b153e2..7584eee7ca0 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unary_expressions_can_be_real.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 store float -2.000000e+00, ptr %b, align 4 %load_b = load float, ptr %b, align 4 %tmpVar = fneg float %load_b diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap index 91b71559d15..86c97c3c089 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__unnecessary_casts_between_pointer_types.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @baz(ptr %0) { entry: - %ptr = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %baz, ptr %0, i32 0, i32 1 - %si = getelementptr inbounds %baz, ptr %0, i32 0, i32 2 - %mb = getelementptr inbounds %baz, ptr %0, i32 0, i32 3 + %ptr = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 1 + %si = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 2 + %mb = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 3 store ptr %b, ptr %ptr, align 8 store ptr %si, ptr %ptr, align 8 store ptr %mb, ptr %ptr, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap index 89cbee3265b..6bdcf2f13ea 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__bitcast_argument_references_for_function_call.snap @@ -61,18 +61,18 @@ entry: define void @main(ptr %0) { entry: - %var1_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2_sint = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var1_int = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %var2_int = getelementptr inbounds %main, ptr %0, i32 0, i32 3 - %var1_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 4 - %var2_dint = getelementptr inbounds %main, ptr %0, i32 0, i32 5 - %var1_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 6 - %var2_lint = getelementptr inbounds %main, ptr %0, i32 0, i32 7 - %var1_real = getelementptr inbounds %main, ptr %0, i32 0, i32 8 - %var2_real = getelementptr inbounds %main, ptr %0, i32 0, i32 9 - %var1_lreal = getelementptr inbounds %main, ptr %0, i32 0, i32 10 - %var2_lreal = getelementptr inbounds %main, ptr %0, i32 0, i32 11 + %var1_sint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2_sint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var1_int = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %var2_int = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 + %var1_dint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 4 + %var2_dint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 5 + %var1_lint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 6 + %var2_lint = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 7 + %var1_real = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 8 + %var2_real = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 9 + %var1_lreal = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 10 + %var2_lreal = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 11 %call = call i8 @fn_sint(ptr %var1_sint, ptr %var2_sint) %call1 = call i8 @fn_sint(ptr %var1_int, ptr %var2_int) %call2 = call i8 @fn_sint(ptr %var1_dint, ptr %var2_dint) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap index c51d8721e35..029efb4a32e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_ref_sized_string_varargs_called_in_program.snap @@ -18,7 +18,7 @@ declare i32 @foo(i32, ptr) define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %1 = alloca [3 x ptr], align 8 %2 = getelementptr inbounds [3 x ptr], ptr %1, i32 0, i32 0 store ptr @utf08_literal_0, ptr %2, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap index 216c1d167d1..bd1a51a9ffe 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_sized_varargs_called_in_program.snap @@ -15,7 +15,7 @@ declare i32 @foo(i32, ptr) define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 1 %1 = alloca [3 x i32], align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap index 688d6976f2f..f3605460f03 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_with_varargs_called_in_program.snap @@ -15,7 +15,7 @@ declare i32 @foo(...) define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %load_x = load i32, ptr %x, align 4 %tmpVar = add i32 %load_x, 1 %call = call i32 (...) @foo(i1 false, i32 3, i32 %tmpVar) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap index 54873ba96fe..6369e68a449 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap @@ -16,7 +16,7 @@ declare void @func(ptr, ptr) define void @main(ptr %0) { entry: - %res = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %res = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %__func0 = alloca [81 x i8], align 1 call void @llvm.memset.p0.i64(ptr align 1 %__func0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) call void @func(ptr %__func0, ptr @utf08_literal_0) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap index b9c24bd4420..d739e237804 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap @@ -25,7 +25,7 @@ entry: define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %call = call i32 @func(ptr %a) %call1 = call i32 @func(ptr @utf08_literal_0) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap index 4b528bd9729..9085281213a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function_as_reference.snap @@ -24,7 +24,7 @@ entry: define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %call = call i32 @func(ptr %a) %call1 = call i32 @func(ptr @utf08_literal_0) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap index 65c5d97d862..cf51f4cac18 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__simple_call.snap @@ -23,7 +23,7 @@ entry: define void @main(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %load_a = load i32, ptr %a, align 4 %call = call i32 @func(i32 %load_a) %call1 = call i32 @func(i32 1) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap index f8602063c45..b844ad6ff27 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__var_output_in_function_call.snap @@ -26,7 +26,7 @@ entry: define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %call = call i32 @func(ptr %x) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap index ec9ee1d640c..44708ac0b3a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__any_real_function_called_with_ints.snap @@ -23,14 +23,14 @@ entry: define void @prg(ptr %0) { entry: - %res_sint = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %res_int = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %res_dint = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %res_lint = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 - %res_usint = getelementptr inbounds %prg, ptr %0, i32 0, i32 4 - %res_uint = getelementptr inbounds %prg, ptr %0, i32 0, i32 5 - %res_udint = getelementptr inbounds %prg, ptr %0, i32 0, i32 6 - %res_ulint = getelementptr inbounds %prg, ptr %0, i32 0, i32 7 + %res_sint = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %res_int = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %res_dint = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %res_lint = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 + %res_usint = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 4 + %res_uint = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 5 + %res_udint = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 6 + %res_ulint = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 7 %v_dint = alloca i32, align 4 %v_udint = alloca i32, align 4 store i32 1, ptr %v_dint, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap index ada38759601..1f29b85a1aa 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_call_generates_real_type_call.snap @@ -25,8 +25,8 @@ entry: define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %call = call i32 @MAX__DINT(i32 1, i32 2) %load_a = load i16, ptr %a, align 2 %load_b = load i16, ptr %b, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap index 8c86d67eb14..7b3f3c86054 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_output_parameter.snap @@ -25,9 +25,9 @@ entry: define void @prg(ptr %0) { entry: - %theInt = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %iResult = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %data = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %theInt = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %iResult = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %data = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_data = load i64, ptr %data, align 8 %call = call i16 @foo__INT(i64 %load_data, ptr %theInt) store i16 %call, ptr %iResult, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap index a03b24909ae..27314b667b4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_in_module.snap @@ -24,6 +24,6 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap index 08ed3c5f08c..202e02dcdf1 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_defined_in_external_file_no_deps_in_module.snap @@ -22,6 +22,6 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap index 2fdb2deeeca..4bbe4461a58 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__datatype_initialized_in_external_file_in_module.snap @@ -18,6 +18,6 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap index 53620c6998a..b230c549b7b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__enum_referenced_in_fb_nested.snap @@ -24,7 +24,7 @@ define void @fb(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %fb, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb, ptr %0, i32 0, i32 0 ret void } @@ -58,7 +58,7 @@ define void @fb2(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %x = getelementptr inbounds %fb2, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %fb2, ptr %0, i32 0, i32 0 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap index 154b51823b4..be76a50743f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__function_defined_in_external_file.snap @@ -42,7 +42,7 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 ret void } @@ -57,7 +57,7 @@ target triple = "[filtered]" define void @prg2(ptr %0) { entry: - %b = getelementptr inbounds %prg2, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg2, ptr %0, i32 0, i32 0 ret void } @@ -78,7 +78,7 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %myFb = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 + %myFb = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 %load_a = load i32, ptr @prg_instance, align 4 call void @prg2(ptr @prg2_instance) %call = call i32 @func() diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap index dbbbcb43130..10fa0eb6bb4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__multifile_codegen_tests__struct_with_custom_init_in_different_file.snap @@ -36,7 +36,7 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %x = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap index 050e1dcb9ae..488508f45f9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_input_param.snap @@ -17,15 +17,15 @@ define void @fb_t(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %in1 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 - %in2 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 + %in1 = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 0 + %in2 = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 1 ret void } define void @main(ptr %0) { entry: - %fb = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %1 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 0 + %fb = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %1 = getelementptr inbounds nuw %fb_t, ptr %fb, i32 0, i32 0 store i32 1, ptr %1, align 4 call void @fb_t(ptr %fb) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap index b5fe8faa4a8..03aa32f1dc5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__fb_accepts_empty_statement_as_output_param.snap @@ -17,17 +17,17 @@ define void @fb_t(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %out1 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 - %out2 = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 + %out1 = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 0 + %out2 = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 1 ret void } define void @main(ptr %0) { entry: - %fb = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %fb = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 call void @fb_t(ptr %fb) - %1 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 0 + %1 = getelementptr inbounds nuw %fb_t, ptr %fb, i32 0, i32 0 %2 = load i32, ptr %1, align 4 store i32 %2, ptr %x, align 4 ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap index 228021382f9..dcda6a560c9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_accepts_empty_statement_as_output_param.snap @@ -22,7 +22,7 @@ entry: define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %1 = alloca i32, align 4 call void @foo(ptr %x, ptr %1) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap index cebc0123416..2e918285c12 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_all_parameters_assigned.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 %call = call i32 @foo(i32 %load_var1, ptr %var2, ptr %var3) %load_var11 = load i32, ptr %var1, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap index 43bcd7fadad..d87843f1c5f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_default_value_parameter_type.snap @@ -29,9 +29,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %1 = alloca i32, align 4 store i32 20, ptr %1, align 4 %2 = alloca i32, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap index 9ed6a085729..aca02d62fcf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_inout_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 %call = call i32 @foo(i32 %load_var1, ptr %var2, ptr %1) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap index 0a4c6ab5049..9ff1372d6df 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_input_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %1 = alloca i32, align 4 %2 = load i32, ptr %1, align 4 %call = call i32 @foo(i32 %2, ptr %var2, ptr %var3) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap index 5a8f77e251b..d1ff58ed780 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 %call = call i32 @foo(i32 %load_var1, ptr %1, ptr %var3) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap index 59f0e250bc8..094484b6d8d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_empty_output_default_value_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 store i32 3, ptr %1, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap index 9ed6a085729..aca02d62fcf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_inout_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 %call = call i32 @foo(i32 %load_var1, ptr %var2, ptr %1) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap index 0a4c6ab5049..9ff1372d6df 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %1 = alloca i32, align 4 %2 = load i32, ptr %1, align 4 %call = call i32 @foo(i32 %2, ptr %var2, ptr %var3) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap index 4731082f763..536d5e56488 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_input_default_value_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %call = call i32 @foo(i32 10, ptr %var2, ptr %var3) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap index 5a8f77e251b..d1ff58ed780 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 %call = call i32 @foo(i32 %load_var1, ptr %1, ptr %var3) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap index 59f0e250bc8..094484b6d8d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__function_missing_output_default_value_assignment.snap @@ -27,9 +27,9 @@ entry: define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 %1 = alloca i32, align 4 store i32 3, ptr %1, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap index fa7ffd87bda..64a043b58e3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__parameters_behind_function_block_pointer_are_assigned_to.snap @@ -15,11 +15,11 @@ target triple = "[filtered]" define void @main(ptr %0) { entry: - %file = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %FileOpen = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %file = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %FileOpen = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 store ptr %file, ptr %FileOpen, align 8 %deref = load ptr, ptr %FileOpen, align 8 - %1 = getelementptr inbounds %file_t, ptr %deref, i32 0, i32 1 + %1 = getelementptr inbounds nuw %file_t, ptr %deref, i32 0, i32 1 store i8 1, ptr %1, align 1 call void @file_t(ptr %deref) ret void @@ -29,7 +29,7 @@ define void @file_t(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %var1 = getelementptr inbounds %file_t, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %file_t, ptr %0, i32 0, i32 1 + %var1 = getelementptr inbounds nuw %file_t, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %file_t, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap index abb15776187..878bba1c687 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_input_param.snap @@ -15,8 +15,8 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %in1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %in2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %in1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %in2 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap index afac299f995..85f0eb21cc9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_accepts_empty_statement_as_output_param.snap @@ -15,8 +15,8 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %out1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %out2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %out1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %out2 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 store i32 1, ptr %out1, align 4 store i32 2, ptr %out2, align 4 ret void @@ -24,7 +24,7 @@ entry: define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 call void @prog(ptr @prog_instance) %1 = load i32, ptr @prog_instance, align 4 store i32 %1, ptr %x, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap index a42b0a6e4b6..037baf314e5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_explicit.snap @@ -15,28 +15,28 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 + %input1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 2 ret void } define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 store i32 %load_var1, ptr @prog_instance, align 4 - store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + store ptr %var3, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 2), align 8 call void @prog(ptr @prog_instance) - %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + %1 = load i32, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), align 4 store i32 %1, ptr %var2, align 4 - store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + store ptr %var3, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 2), align 8 %load_var11 = load i32, ptr %var1, align 4 store i32 %load_var11, ptr @prog_instance, align 4 call void @prog(ptr @prog_instance) - %2 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + %2 = load i32, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), align 4 store i32 %2, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap index 083c0736d82..92e00a2c45d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_all_parameters_assigned_implicit.snap @@ -15,22 +15,22 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 + %input1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 2 ret void } define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 store i32 %load_var1, ptr @prog_instance, align 4 - store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + store ptr %var3, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 2), align 8 call void @prog(ptr @prog_instance) - %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + %1 = load i32, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), align 4 store i32 %1, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap index 465c1887b65..f598444114c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_empty_inout_assignment.snap @@ -15,23 +15,23 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 + %input1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 2 ret void } define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 store i32 %load_var1, ptr @prog_instance, align 4 %empty_varinout = alloca i32, align 4 - store ptr %empty_varinout, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + store ptr %empty_varinout, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 2), align 8 call void @prog(ptr @prog_instance) - %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + %1 = load i32, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), align 4 store i32 %1, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap index f24dfdb4818..0089dba72f4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_input_assignment.snap @@ -15,20 +15,20 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 + %input1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 2 ret void } define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + store ptr %var3, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 2), align 8 call void @prog(ptr @prog_instance) - %1 = load i32, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), align 4 + %1 = load i32, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), align 4 store i32 %1, ptr %var2, align 4 ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap index d218687f109..4862d775198 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__program_missing_output_assignment.snap @@ -15,20 +15,20 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %input1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 - %inout1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 2 + %input1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %output1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 + %inout1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 2 ret void } define void @main(ptr %0) { entry: - %var1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %var2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %var3 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 + %var1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %var2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %var3 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 %load_var1 = load i32, ptr %var1, align 4 store i32 %load_var1, ptr @prog_instance, align 4 - store ptr %var3, ptr getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 2), align 8 + store ptr %var3, ptr getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 2), align 8 call void @prog(ptr @prog_instance) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap index 7d2f6423c21..ef7493d36b6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__parameters_tests__var_in_out_params_can_be_out_of_order.snap @@ -15,17 +15,17 @@ target triple = "[filtered]" define void @mainProg(ptr %0) { entry: - %fb = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 0 - %out1 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 1 - %out2 = getelementptr inbounds %mainProg, ptr %0, i32 0, i32 2 - %1 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 4 + %fb = getelementptr inbounds nuw %mainProg, ptr %0, i32 0, i32 0 + %out1 = getelementptr inbounds nuw %mainProg, ptr %0, i32 0, i32 1 + %out2 = getelementptr inbounds nuw %mainProg, ptr %0, i32 0, i32 2 + %1 = getelementptr inbounds nuw %fb_t, ptr %fb, i32 0, i32 4 store ptr %out1, ptr %1, align 8 - %2 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 2 + %2 = getelementptr inbounds nuw %fb_t, ptr %fb, i32 0, i32 2 store ptr %out2, ptr %2, align 8 call void @fb_t(ptr %fb) - %3 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 2 + %3 = getelementptr inbounds nuw %fb_t, ptr %fb, i32 0, i32 2 store ptr %out1, ptr %3, align 8 - %4 = getelementptr inbounds %fb_t, ptr %fb, i32 0, i32 4 + %4 = getelementptr inbounds nuw %fb_t, ptr %fb, i32 0, i32 4 store ptr %out2, ptr %4, align 8 call void @fb_t(ptr %fb) %load_out2 = load i8, ptr %out2, align 1 @@ -41,11 +41,11 @@ define void @fb_t(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %myVar = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 - %myInput = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 - %myInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 2 - %myOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 3 - %myOtherInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 4 + %myVar = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 0 + %myInput = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 1 + %myInOut = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 2 + %myOut = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 3 + %myOtherInOut = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 4 ret void } @@ -53,11 +53,11 @@ define void @fb_t__foo(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %myVar = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 0 - %myInput = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 1 - %myInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 2 - %myOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 3 - %myOtherInOut = getelementptr inbounds %fb_t, ptr %0, i32 0, i32 4 + %myVar = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 0 + %myInput = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 1 + %myInOut = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 2 + %myOut = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 3 + %myOtherInOut = getelementptr inbounds nuw %fb_t, ptr %0, i32 0, i32 4 %deref = load ptr, ptr %myInOut, align 8 %deref1 = load ptr, ptr %myOtherInOut, align 8 %load_myOtherInOut = load i8, ptr %deref1, align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap index 4c82764682e..8d6bfc7be20 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__bitaccess_generated_as_rsh_and_trunc_i1.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_x = load i32, ptr %x, align 4 %shift = lshr i32 %load_x, 2 %1 = trunc i32 %shift to i8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap index 725ce7d4110..894707f0aa2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__byteaccess_generated_as_rsh_and_trunc_i8.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_x = load i32, ptr %x, align 4 %shift = lshr i32 %load_x, 0 %1 = trunc i32 %shift to i8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap index ffe8e1d6b95..dcef203d302 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__dwordaccess_generated_as_rsh_and_trunc_i32.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_x = load i64, ptr %x, align 8 %shift = lshr i64 %load_x, 0 %1 = trunc i64 %shift to i32 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap index 8626b705d2b..fbb41891982 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__nested_bitwise_access.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i64, ptr %x, align 8 %shift = lshr i64 %load_x, 32 %1 = trunc i64 %shift to i32 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap index d45c4af7cf2..9f72c816365 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__variable_based_bitwise_access.snap @@ -13,10 +13,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 %load_x = load i16, ptr %x, align 2 %load_y = load i16, ptr %y, align 2 %shift = ashr i16 %load_x, %load_y diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap index 9422dc61ba5..87c04e8d438 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__wordaccess_generated_as_rsh_and_trunc_i16.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_x = load i32, ptr %x, align 4 %shift = lshr i32 %load_x, 0 %1 = trunc i32 %shift to i16 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap index e4af56d96d6..8d18c878c0e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap @@ -15,8 +15,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 80, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 80, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %b, ptr align 2 @utf16_literal_0, i32 160, i1 false) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap index c8bf6cbe1b8..7c18a356d13 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap @@ -29,8 +29,8 @@ entry: define void @main(ptr %0) { entry: - %fmt = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %fmt = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %__MID0 = alloca [81 x i8], align 1 call void @llvm.memset.p0.i64(ptr align 1 %__MID0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) call void @MID__STRING(ptr %__MID0, ptr %fmt, i32 1, i32 2) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap index 978d83148f8..e688280df34 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap @@ -23,7 +23,7 @@ entry: define void @main(ptr %0) { entry: - %str = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %str = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %__ret0 = alloca [81 x i8], align 1 call void @llvm.memset.p0.i64(ptr align 1 %__ret0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) call void @ret(ptr %__ret0) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap index c593912f5da..5043bc46da2 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap @@ -26,7 +26,7 @@ entry: define void @main(ptr %0) { entry: - %text1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %text1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 %__read_string0 = alloca [81 x i8], align 1 call void @llvm.memset.p0.i64(ptr align 1 %__read_string0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) call void @read_string(ptr %__read_string0, ptr @utf08_literal_0) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap index a5bb211e80c..0d4985e1345 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap @@ -17,8 +17,8 @@ target triple = "[filtered]" define void @prog(ptr %0) { entry: - %output1 = getelementptr inbounds %prog, ptr %0, i32 0, i32 0 - %output2 = getelementptr inbounds %prog, ptr %0, i32 0, i32 1 + %output1 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 0 + %output2 = getelementptr inbounds nuw %prog, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %output1, ptr align 1 @utf08_literal_0, i32 7, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %output2, ptr align 2 @utf16_literal_0, i32 16, i1 false) ret void @@ -26,11 +26,11 @@ entry: define void @main(ptr %0) { entry: - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 call void @prog(ptr @prog_instance) call void @llvm.memcpy.p0.p0.i32(ptr align 1 %x, ptr align 1 @prog_instance, i32 6, i1 false) - call void @llvm.memcpy.p0.p0.i32(ptr align 2 %y, ptr align 2 getelementptr inbounds (%prog, ptr @prog_instance, i32 0, i32 1), i32 14, i1 false) + call void @llvm.memcpy.p0.p0.i32(ptr align 2 %y, ptr align 2 getelementptr inbounds nuw (%prog, ptr @prog_instance, i32 0, i32 1), i32 14, i1 false) ret void } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap index f4112f36b39..277344796c8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap @@ -17,8 +17,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 80, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %z, ptr align 2 @utf16_literal_1, i32 160, i1 false) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap index 7d3d8705e3e..f55abdfe8a8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap @@ -18,9 +18,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %zz = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %zz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 1 %z, ptr align 1 @utf08_literal_1, i32 17, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %zz, ptr align 2 @utf16_literal_0, i32 34, i1 false) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap index 445f0d05ee8..63c6de734fd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap @@ -30,8 +30,8 @@ buffer_block: ; No predecessors! define void @prg(ptr %0) { entry: - %s = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %s = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %s, i32 11, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 6, i1 false) %call = call i16 @foo(ptr %s) diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap index e58c2c03730..628f35e898a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap @@ -17,10 +17,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %wy = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %wz = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %wy = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %wz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %wy, ptr align 2 @utf16_literal_0, i32 24, i1 false) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap index 1856d2572f7..d82fb05f27f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap @@ -19,10 +19,10 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %wy = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 - %wz = getelementptr inbounds %prg, ptr %0, i32 0, i32 3 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %wy = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 + %wz = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 3 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 @utf08_literal_0, i32 12, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 2 %wy, ptr align 2 @utf16_literal_0, i32 24, i1 false) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap index b0d4e78cbd3..5ddd32dd9c7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap @@ -14,8 +14,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %y, ptr align 1 %z, i32 15, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 1 %z, ptr align 1 %y, i32 16, i1 false) ret void diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap index d034d5443bf..4b8da5c6556 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__aliased_datatypes_respect_conversion_rules.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_b = load i8, ptr %b, align 1 %1 = sext i8 %load_b to i32 %load_c = load i32, ptr %c, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap index 495bbc72f97..a9e6d18f836 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_larger_than_int_promote_the_second_operand.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_b = load i32, ptr %b, align 4 %1 = sext i32 %load_b to i64 %load_c = load i64, ptr %c, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap index 58a1ef7d988..20ed905233f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__datatypes_smaller_than_dint_promoted_to_dint.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_b = load i8, ptr %b, align 1 %1 = sext i8 %load_b to i32 %load_c = load i32, ptr %c, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap index 18e6e6f5400..b4d22943f60 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__even_all_sint_expressions_fallback_to_dint.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_b = load i8, ptr %b, align 1 %1 = sext i8 %load_b to i32 %load_c = load i8, ptr %c, align 1 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap index 004cc46dc0b..64ce638fe54 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_and_double_mix_converted_to_double.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_b = load double, ptr %b, align 8 %load_a = load float, ptr %a, align 4 %1 = fpext float %load_a to double diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap index 9f4e51276ca..0f67b628ace 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assigned_to_int_is_cast.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_c = load float, ptr %c, align 4 %1 = fptosi float %load_c to i16 store i16 %1, ptr %a, align 2 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap index 21e8715c735..2b15ec5ecc6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__float_assinged_to_double_to_double.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_a = load float, ptr %a, align 4 %1 = fpext float %load_a to double store double %1, ptr %b, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap index 415d4c89542..d29bf4420cc 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_assigned_to_float_is_cast.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_a = load i16, ptr %a, align 2 %1 = sitofp i16 %load_a to float store float %1, ptr %c, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap index 18754077d18..a7166e0f1f4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_byte_promoted_on_compare_statement.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_b = load i64, ptr %b, align 8 %load_a = load i8, ptr %a, align 1 %1 = zext i8 %load_a to i64 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap index eca03c9c7a5..2a17d08fc13 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_bigger_than_float_converted_to_double.snap @@ -13,8 +13,8 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_b = load i64, ptr %b, align 8 %1 = sitofp i64 %load_b to double %load_a = load float, ptr %a, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap index 40a88b016a7..65c8c51b740 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__int_smaller_or_equal_to_float_converted_to_float.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_b = load i16, ptr %b, align 2 %1 = sitofp i16 %load_b to float %load_a = load float, ptr %a, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap index 880984e90ab..bc0de2f6b15 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__unsingned_datatypes_smaller_than_dint_promoted_to_dint.snap @@ -13,9 +13,9 @@ target triple = "[filtered]" define void @prg(ptr %0) { entry: - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %c = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %c = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 %load_b = load i8, ptr %b, align 1 %1 = zext i8 %load_b to i32 %load_c = load i32, ptr %c, align 4 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap index 311a3dda097..a7cfd53e9b3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap @@ -17,9 +17,9 @@ entry: %vla = alloca %__foo_vla, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) store i16 0, ptr %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -68,8 +68,8 @@ entry: %auto_deref = load [60 x i16], ptr %arr, align 2 %outer_arr_gep = getelementptr inbounds [60 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [4 x i32] [i32 0, i32 14, i32 -2, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 @@ -79,8 +79,8 @@ entry: %auto_deref1 = load [299 x i16], ptr %arr2, align 2 %outer_arr_gep2 = getelementptr inbounds [299 x i16], ptr %arr2, i32 0, i32 0 %vla_struct3 = alloca %__foo_vla, align 8 - %vla_array_gep4 = getelementptr inbounds %__foo_vla, ptr %vla_struct3, i32 0, i32 0 - %vla_dimensions_gep5 = getelementptr inbounds %__foo_vla, ptr %vla_struct3, i32 0, i32 1 + %vla_array_gep4 = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct3, i32 0, i32 0 + %vla_dimensions_gep5 = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct3, i32 0, i32 1 store [4 x i32] [i32 -8, i32 4, i32 -3, i32 19], ptr %vla_dimensions_gep5, align 4 store ptr %outer_arr_gep2, ptr %vla_array_gep4, align 8 %1 = load %__foo_vla, ptr %vla_struct3, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap index 50c148459be..a3208c89716 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap @@ -18,9 +18,9 @@ entry: %vla = alloca %__foo_vla, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) store i16 0, ptr %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -38,8 +38,8 @@ entry: store i32 0, ptr %main, align 4 %auto_deref = load [2 x i16], ptr @arr, align 2 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr @arr, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap index 2eca19b5c8a..854008fc4e7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap @@ -25,8 +25,8 @@ entry: %auto_deref = load [2 x i16], ptr %arr, align 2 %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap index 37ac74606fa..e10b093f258 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap @@ -17,9 +17,9 @@ entry: %vla = alloca %__foo_vla, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) store i16 0, ptr %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -66,8 +66,8 @@ entry: %auto_deref = load [20 x i16], ptr %arr, align 2 %outer_arr_gep = getelementptr inbounds [20 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [4 x i32] [i32 0, i32 4, i32 -2, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap index a13e2e0f1dc..3b0ec8ee3f8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap @@ -17,9 +17,9 @@ entry: %vla = alloca %__foo_vla, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) store i16 0, ptr %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -41,8 +41,8 @@ entry: %auto_deref = load [2 x i16], ptr %arr, align 2 %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap index 0a2f384f047..c5f0fe3a3fd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap @@ -19,9 +19,9 @@ entry: %i = alloca i32, align 4 store i32 0, ptr %i, align 4 store i16 0, ptr %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -45,8 +45,8 @@ entry: %auto_deref = load [2 x i16], ptr %arr, align 2 %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap index a13e2e0f1dc..3b0ec8ee3f8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap @@ -17,9 +17,9 @@ entry: %vla = alloca %__foo_vla, align 8 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %vla, ptr align 1 %0, i64 ptrtoint (ptr getelementptr (%__foo_vla, ptr null, i32 1) to i64), i1 false) store i16 0, ptr %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -41,8 +41,8 @@ entry: %auto_deref = load [2 x i16], ptr %arr, align 2 %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap index 005ea7f7389..23e781c8173 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap @@ -19,9 +19,9 @@ entry: %i = alloca i32, align 4 store i32 0, ptr %i, align 4 store i16 0, ptr %foo, align 2 - %vla_arr_gep = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_vla, ptr %vla, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_vla, ptr %vla, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -44,8 +44,8 @@ entry: %auto_deref = load [2 x i16], ptr %arr, align 2 %outer_arr_gep = getelementptr inbounds [2 x i16], ptr %arr, i32 0, i32 0 %vla_struct = alloca %__foo_vla, align 8 - %vla_array_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_vla, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_vla, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 1], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_vla, ptr %vla_struct, align 8 diff --git a/src/codegen/tests/typesystem_test.rs b/src/codegen/tests/typesystem_test.rs index aea55167173..e98de69604b 100644 --- a/src/codegen/tests/typesystem_test.rs +++ b/src/codegen/tests/typesystem_test.rs @@ -405,15 +405,15 @@ fn self_referential_struct_via_reference_codegen() { define void @main(ptr %0) { entry: - %node1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %node2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %data = getelementptr inbounds %Node, ptr %node1, i32 0, i32 0 + %node1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %node2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %data = getelementptr inbounds nuw %Node, ptr %node1, i32 0, i32 0 store i32 42, ptr %data, align 4 - %data1 = getelementptr inbounds %Node, ptr %node2, i32 0, i32 0 + %data1 = getelementptr inbounds nuw %Node, ptr %node2, i32 0, i32 0 store i32 84, ptr %data1, align 4 - %next = getelementptr inbounds %Node, ptr %node1, i32 0, i32 1 + %next = getelementptr inbounds nuw %Node, ptr %node1, i32 0, i32 1 store ptr %node2, ptr %next, align 8 - %next2 = getelementptr inbounds %Node, ptr %node2, i32 0, i32 1 + %next2 = getelementptr inbounds nuw %Node, ptr %node2, i32 0, i32 1 store ptr %node1, ptr %next2, align 8 ret void } diff --git a/src/tests/adr/arrays_adr.rs b/src/tests/adr/arrays_adr.rs index 49012a361c1..9b83d9e4536 100644 --- a/src/tests/adr/arrays_adr.rs +++ b/src/tests/adr/arrays_adr.rs @@ -81,8 +81,8 @@ fn assigning_full_arrays() { define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %a, ptr align 1 %b, i64 ptrtoint (ptr getelementptr ([10 x i32], ptr null, i32 1) to i64), i1 false) ret void } @@ -134,8 +134,8 @@ fn accessing_array_elements() { define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %tmpVar = getelementptr inbounds [10 x i32], ptr %a, i32 0, i32 2 %tmpVar1 = getelementptr inbounds [3 x i32], ptr %b, i32 0, i32 1 %load_tmpVar = load i32, ptr %tmpVar1, align 4 diff --git a/src/tests/adr/enum_adr.rs b/src/tests/adr/enum_adr.rs index 6651215bff9..b6adec83060 100644 --- a/src/tests/adr/enum_adr.rs +++ b/src/tests/adr/enum_adr.rs @@ -139,9 +139,9 @@ fn using_enums() { define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 2 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 2 store i32 5, ptr %x, align 4 store i32 4, ptr %y, align 4 store i32 16, ptr %z, align 4 diff --git a/src/tests/adr/initializer_functions_adr.rs b/src/tests/adr/initializer_functions_adr.rs index 20f38761c93..55aa1bc0f33 100644 --- a/src/tests/adr/initializer_functions_adr.rs +++ b/src/tests/adr/initializer_functions_adr.rs @@ -766,8 +766,8 @@ fn generating_init_functions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %ps = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %ps = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } @@ -775,14 +775,14 @@ fn generating_init_functions() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %bar, ptr %0, i32 0, i32 0 - %fb = getelementptr inbounds %bar, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 0 + %fb = getelementptr inbounds nuw %bar, ptr %0, i32 0, i32 1 ret void } define void @baz(ptr %0) { entry: - %fb = getelementptr inbounds %baz, ptr %0, i32 0, i32 0 + %fb = getelementptr inbounds nuw %baz, ptr %0, i32 0, i32 0 ret void } @@ -791,7 +791,7 @@ fn generating_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -801,7 +801,7 @@ fn generating_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @bar, ptr %__body, align 8 ret void } @@ -811,10 +811,10 @@ fn generating_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %fb = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + %fb = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 1 call void @__init_foo(ptr %fb) %deref1 = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %bar, ptr %deref1, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %bar, ptr %deref1, i32 0, i32 0 store ptr @__vtable_bar_instance, ptr %__vtable, align 8 ret void } @@ -824,10 +824,10 @@ fn generating_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %ps = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + %ps = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 1 store ptr @s, ptr %ps, align 8 ret void } @@ -844,7 +844,7 @@ fn generating_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %fb = getelementptr inbounds %baz, ptr %deref, i32 0, i32 0 + %fb = getelementptr inbounds nuw %baz, ptr %deref, i32 0, i32 0 call void @__init_bar(ptr %fb) ret void } @@ -868,7 +868,7 @@ fn generating_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %fb = getelementptr inbounds %baz, ptr %deref, i32 0, i32 0 + %fb = getelementptr inbounds nuw %baz, ptr %deref, i32 0, i32 0 call void @__user_init_bar(ptr %fb) ret void } @@ -878,7 +878,7 @@ fn generating_init_functions() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %fb = getelementptr inbounds %bar, ptr %deref, i32 0, i32 1 + %fb = getelementptr inbounds nuw %bar, ptr %deref, i32 0, i32 1 call void @__user_init_foo(ptr %fb) ret void } @@ -965,8 +965,8 @@ fn intializing_temporary_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %s = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 %s2 = alloca ptr, align 8 store ptr @ps2, ptr %s2, align 8 store ptr @ps2, ptr %s2, align 8 @@ -1000,7 +1000,7 @@ fn intializing_temporary_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 ret void } @@ -1010,10 +1010,10 @@ fn intializing_temporary_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 %deref1 = load ptr, ptr %self, align 8 - %s = getelementptr inbounds %foo, ptr %deref1, i32 0, i32 1 + %s = getelementptr inbounds nuw %foo, ptr %deref1, i32 0, i32 1 store ptr @ps, ptr %s, align 8 ret void } @@ -1081,7 +1081,7 @@ fn initializing_method_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 ret void } @@ -1089,7 +1089,7 @@ fn initializing_method_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 %x = alloca i32, align 4 %px = alloca ptr, align 8 store i32 10, ptr %x, align 4 @@ -1103,10 +1103,10 @@ fn initializing_method_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -1116,7 +1116,7 @@ fn initializing_method_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -1189,8 +1189,8 @@ fn initializing_method_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } @@ -1198,8 +1198,8 @@ fn initializing_method_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 %px = alloca ptr, align 8 store ptr %x, ptr %px, align 8 store ptr %x, ptr %px, align 8 @@ -1210,8 +1210,8 @@ fn initializing_method_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 %px = alloca ptr, align 8 store ptr @y, ptr %px, align 8 store ptr @y, ptr %px, align 8 @@ -1223,13 +1223,13 @@ fn initializing_method_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 %deref2 = load ptr, ptr %self, align 8 - %baz = getelementptr inbounds %__vtable_foo, ptr %deref2, i32 0, i32 2 + %baz = getelementptr inbounds nuw %__vtable_foo, ptr %deref2, i32 0, i32 2 store ptr @foo__baz, ptr %baz, align 8 ret void } @@ -1239,7 +1239,7 @@ fn initializing_method_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } @@ -1301,8 +1301,8 @@ fn initializing_method_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 ret void } @@ -1310,8 +1310,8 @@ fn initializing_method_variables() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 %x1 = alloca i32, align 4 %px = alloca ptr, align 8 store i32 10, ptr %x1, align 4 @@ -1325,10 +1325,10 @@ fn initializing_method_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_foo, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_foo, ptr %deref, i32 0, i32 0 store ptr @foo, ptr %__body, align 8 %deref1 = load ptr, ptr %self, align 8 - %bar = getelementptr inbounds %__vtable_foo, ptr %deref1, i32 0, i32 1 + %bar = getelementptr inbounds nuw %__vtable_foo, ptr %deref1, i32 0, i32 1 store ptr @foo__bar, ptr %bar, align 8 ret void } @@ -1338,7 +1338,7 @@ fn initializing_method_variables() { %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %foo, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %foo, ptr %deref, i32 0, i32 0 store ptr @__vtable_foo_instance, ptr %__vtable, align 8 ret void } diff --git a/src/tests/adr/pou_adr.rs b/src/tests/adr/pou_adr.rs index 9b3d5dac32c..d144941ca62 100644 --- a/src/tests/adr/pou_adr.rs +++ b/src/tests/adr/pou_adr.rs @@ -201,10 +201,10 @@ fn codegen_of_a_program_pou() { define void @main_prg(ptr %0) { entry: - %i = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 0 - %io = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 1 - %o = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 2 - %v = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 3 + %i = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 store i16 0, ptr %vt, align 2 ret void @@ -248,9 +248,9 @@ fn calling_a_program() { store i16 0, ptr %y, align 2 store i16 0, ptr %foo, align 2 store i16 1, ptr @main_prg_instance, align 2 - store ptr %y, ptr getelementptr inbounds (%main_prg, ptr @main_prg_instance, i32 0, i32 1), align 8 + store ptr %y, ptr getelementptr inbounds nuw (%main_prg, ptr @main_prg_instance, i32 0, i32 1), align 8 call void @main_prg(ptr @main_prg_instance) - %0 = load i16, ptr getelementptr inbounds (%main_prg, ptr @main_prg_instance, i32 0, i32 2), align 2 + %0 = load i16, ptr getelementptr inbounds nuw (%main_prg, ptr @main_prg_instance, i32 0, i32 2), align 2 store i16 %0, ptr %x, align 2 %foo_ret = load i16, ptr %foo, align 2 ret i16 %foo_ret @@ -258,10 +258,10 @@ fn calling_a_program() { define void @main_prg(ptr %0) { entry: - %i = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 0 - %io = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 1 - %o = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 2 - %v = getelementptr inbounds %main_prg, ptr %0, i32 0, i32 3 + %i = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds nuw %main_prg, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 store i16 0, ptr %vt, align 2 ret void @@ -308,10 +308,10 @@ fn function_blocks_get_a_method_with_a_self_parameter() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %i = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 0 - %io = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 1 - %o = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 2 - %v = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 3 + %i = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 store i16 2, ptr %vt, align 2 ret void @@ -351,15 +351,15 @@ fn calling_a_function_block() { define void @foo(ptr %0) { entry: - %x = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 - %y = getelementptr inbounds %foo, ptr %0, i32 0, i32 1 - %fb = getelementptr inbounds %foo, ptr %0, i32 0, i32 2 - %1 = getelementptr inbounds %main_fb, ptr %fb, i32 0, i32 0 + %x = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 + %y = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 1 + %fb = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 2 + %1 = getelementptr inbounds nuw %main_fb, ptr %fb, i32 0, i32 0 store i16 1, ptr %1, align 2 - %2 = getelementptr inbounds %main_fb, ptr %fb, i32 0, i32 1 + %2 = getelementptr inbounds nuw %main_fb, ptr %fb, i32 0, i32 1 store ptr %y, ptr %2, align 8 call void @main_fb(ptr %fb) - %3 = getelementptr inbounds %main_fb, ptr %fb, i32 0, i32 2 + %3 = getelementptr inbounds nuw %main_fb, ptr %fb, i32 0, i32 2 %4 = load i16, ptr %3, align 2 store i16 %4, ptr %x, align 2 ret void @@ -369,10 +369,10 @@ fn calling_a_function_block() { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %i = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 0 - %io = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 1 - %o = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 2 - %v = getelementptr inbounds %main_fb, ptr %0, i32 0, i32 3 + %i = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 0 + %io = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 1 + %o = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 2 + %v = getelementptr inbounds nuw %main_fb, ptr %0, i32 0, i32 3 %vt = alloca i16, align 2 store i16 2, ptr %vt, align 2 ret void @@ -455,8 +455,8 @@ fn calling_a_function() { define void @prg(ptr %0) { entry: - %x = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %z = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %x = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %z = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 %load_x = load i16, ptr %x, align 2 %1 = alloca i64, align 8 %call = call i32 @main_fun(i16 %load_x, ptr %z, ptr %1) @@ -529,7 +529,7 @@ fn return_a_complex_type_from_function() { define void @prg(ptr %0) { entry: - %s = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 + %s = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 %__foo0 = alloca [81 x i8], align 1 call void @llvm.memset.p0.i64(ptr align 1 %__foo0, i8 0, i64 ptrtoint (ptr getelementptr ([81 x i8], ptr null, i32 1) to i64), i1 false) call void @foo(ptr %__foo0) @@ -615,10 +615,10 @@ fn passing_aggregate_types_to_functions_by_value() { define void @main(ptr %0) { entry: - %string1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %string2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 - %array1 = getelementptr inbounds %main, ptr %0, i32 0, i32 2 - %struct1 = getelementptr inbounds %main, ptr %0, i32 0, i32 3 + %string1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %string2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 + %array1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 2 + %struct1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 3 call void @foo(ptr %string1, ptr %string2, ptr %array1, ptr %struct1) ret void } @@ -685,8 +685,8 @@ fn passing_by_ref_to_functions() { define void @main(ptr %0) { entry: - %str1 = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %str2 = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %str1 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %str2 = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %call = call i8 @StrEqual(ptr %str1, ptr %str2) ret void } diff --git a/src/tests/adr/strings_adr.rs b/src/tests/adr/strings_adr.rs index 489e28614c4..e874372c5a0 100644 --- a/src/tests/adr/strings_adr.rs +++ b/src/tests/adr/strings_adr.rs @@ -78,8 +78,8 @@ fn assigning_strings() { define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 %b, i32 10, i1 false) ret void } @@ -121,8 +121,8 @@ fn assigning_string_literals() { define void @prg(ptr %0) { entry: - %a = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %a, ptr align 1 @utf08_literal_0, i32 6, i1 false) call void @llvm.memcpy.p0.p0.i32(ptr align 1 %b, ptr align 1 @utf08_literal_1, i32 6, i1 false) ret void diff --git a/src/tests/adr/structs_adr.rs b/src/tests/adr/structs_adr.rs index 84056b5ebe5..ffcd59f6a32 100644 --- a/src/tests/adr/structs_adr.rs +++ b/src/tests/adr/structs_adr.rs @@ -111,8 +111,8 @@ fn initializing_a_struct() { define void @prg(ptr %0) { entry: - %rect1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %rect2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %rect1 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %rect2 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 ret void } "#); @@ -156,8 +156,8 @@ fn assigning_structs() { define void @prg(ptr %0) { entry: - %p1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %p2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 + %p1 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %p2 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %p1, ptr align 1 %p2, i64 ptrtoint (ptr getelementptr (%Point, ptr null, i32 1) to i64), i1 false) ret void } @@ -214,12 +214,12 @@ fn accessing_struct_members() { define void @prg(ptr %0) { entry: - %rect1 = getelementptr inbounds %prg, ptr %0, i32 0, i32 0 - %rect2 = getelementptr inbounds %prg, ptr %0, i32 0, i32 1 - %topLeft = getelementptr inbounds %Rect, ptr %rect1, i32 0, i32 0 - %x = getelementptr inbounds %Point, ptr %topLeft, i32 0, i32 0 - %bottomRight = getelementptr inbounds %Rect, ptr %rect2, i32 0, i32 1 - %x1 = getelementptr inbounds %Point, ptr %bottomRight, i32 0, i32 0 + %rect1 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 0 + %rect2 = getelementptr inbounds nuw %prg, ptr %0, i32 0, i32 1 + %topLeft = getelementptr inbounds nuw %Rect, ptr %rect1, i32 0, i32 0 + %x = getelementptr inbounds nuw %Point, ptr %topLeft, i32 0, i32 0 + %bottomRight = getelementptr inbounds nuw %Rect, ptr %rect2, i32 0, i32 1 + %x1 = getelementptr inbounds nuw %Point, ptr %bottomRight, i32 0, i32 0 %load_x = load i16, ptr %x1, align 2 store i16 %load_x, ptr %x, align 2 ret void diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index 9910c68f9b7..ae2f36efe1e 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -327,8 +327,8 @@ fn pass() { %auto_deref = load [6 x i32], ptr %local, align 4 %outer_arr_gep = getelementptr inbounds [6 x i32], ptr %local, i32 0, i32 0 %vla_struct = alloca %__foo_arr, align 8 - %vla_array_gep = getelementptr inbounds %__foo_arr, ptr %vla_struct, i32 0, i32 0 - %vla_dimensions_gep = getelementptr inbounds %__foo_arr, ptr %vla_struct, i32 0, i32 1 + %vla_array_gep = getelementptr inbounds nuw %__foo_arr, ptr %vla_struct, i32 0, i32 0 + %vla_dimensions_gep = getelementptr inbounds nuw %__foo_arr, ptr %vla_struct, i32 0, i32 1 store [2 x i32] [i32 0, i32 5], ptr %vla_dimensions_gep, align 4 store ptr %outer_arr_gep, ptr %vla_array_gep, align 8 %0 = load %__foo_arr, ptr %vla_struct, align 8 @@ -392,9 +392,9 @@ fn access() { store ptr %0, ptr %arr, align 8 store i32 0, ptr %foo, align 4 %deref = load ptr, ptr %arr, align 8 - %vla_arr_gep = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_arr, ptr %deref, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_arr, ptr %deref, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [2 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 @@ -452,9 +452,9 @@ fn multi_dimensional() { store ptr %0, ptr %arr, align 8 store i32 0, ptr %foo, align 4 %deref = load ptr, ptr %arr, align 8 - %vla_arr_gep = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 0 + %vla_arr_gep = getelementptr inbounds nuw %__foo_arr, ptr %deref, i32 0, i32 0 %vla_arr_ptr = load ptr, ptr %vla_arr_gep, align 8 - %dim_arr = getelementptr inbounds %__foo_arr, ptr %deref, i32 0, i32 1 + %dim_arr = getelementptr inbounds nuw %__foo_arr, ptr %deref, i32 0, i32 1 %start_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 0 %end_idx_ptr0 = getelementptr inbounds [4 x i32], ptr %dim_arr, i32 0, i32 1 %start_idx_value0 = load i32, ptr %start_idx_ptr0, align 4 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap index a53d895feed..2040bb48bdf 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__actions_debug.snap @@ -12,8 +12,8 @@ target triple = "[filtered]" define void @main(ptr %0) !dbg !12 { entry: #dbg_declare(ptr %0, !16, !DIExpression(), !17) - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 store i32 0, ptr %a, align 4, !dbg !18 call void @main__newAction(ptr %0), !dbg !17 call void @main__newAction2(ptr %0), !dbg !19 @@ -22,8 +22,8 @@ entry: define void @main__newAction(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %load_a = load i32, ptr %a, align 4, !dbg !21 %tmpVar = add i32 %load_a, 1, !dbg !21 store i32 %tmpVar, ptr %a, align 4, !dbg !21 @@ -32,8 +32,8 @@ entry: define void @main__newAction2(ptr %0) { entry: - %a = getelementptr inbounds %main, ptr %0, i32 0, i32 0 - %b = getelementptr inbounds %main, ptr %0, i32 0, i32 1 + %a = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 + %b = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 1 %load_b = load i32, ptr %b, align 4, !dbg !23 %tmpVar = add i32 %load_b, 2, !dbg !23 store i32 %tmpVar, ptr %b, align 4, !dbg !23 diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap index 5a988f63c40..d4144965327 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return.snap @@ -16,8 +16,8 @@ define void @conditional_return(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %conditional_return, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %conditional_return, ptr %0, i32 0, i32 1 %load_val = load i32, ptr %val, align 4 %tmpVar = icmp eq i32 %load_val, 5 br i1 %tmpVar, label %then_block, label %else_block @@ -35,7 +35,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_conditional_return, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_conditional_return, ptr %deref, i32 0, i32 0 store ptr @conditional_return, ptr %__body, align 8 ret void } @@ -45,7 +45,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %conditional_return, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %conditional_return, ptr %deref, i32 0, i32 0 store ptr @__vtable_conditional_return_instance, ptr %__vtable, align 8 ret void } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap index ebd3af30335..e1f3c48b1ea 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap @@ -22,11 +22,11 @@ entry: store i32 0, ptr %main, align 4 call void @__init_conditional_return(ptr %conditional) call void @__user_init_conditional_return(ptr %conditional) - %val = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %val = getelementptr inbounds nuw %conditional_return, ptr %conditional, i32 0, i32 1 %load_my_val = load i32, ptr %my_val, align 4 store i32 %load_my_val, ptr %val, align 4 call void @conditional_return(ptr %conditional) - %val1 = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %val1 = getelementptr inbounds nuw %conditional_return, ptr %conditional, i32 0, i32 1 %load_val = load i32, ptr %val1, align 4 store i32 %load_val, ptr %main, align 4 %main_ret = load i32, ptr %main, align 4 @@ -40,8 +40,8 @@ define void @conditional_return(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %conditional_return, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %conditional_return, ptr %0, i32 0, i32 1 %load_val = load i32, ptr %val, align 4 %tmpVar = icmp eq i32 %load_val, 5 br i1 %tmpVar, label %then_block, label %else_block @@ -59,7 +59,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_conditional_return, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_conditional_return, ptr %deref, i32 0, i32 0 store ptr @conditional_return, ptr %__body, align 8 ret void } @@ -69,7 +69,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %conditional_return, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %conditional_return, ptr %deref, i32 0, i32 0 store ptr @__vtable_conditional_return_instance, ptr %__vtable, align 8 ret void } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap index ddf18e96f6a..453b26a7692 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap @@ -22,11 +22,11 @@ entry: store i32 0, ptr %main, align 4 call void @__init_conditional_return(ptr %conditional) call void @__user_init_conditional_return(ptr %conditional) - %val = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %val = getelementptr inbounds nuw %conditional_return, ptr %conditional, i32 0, i32 1 %load_my_val = load i32, ptr %my_val, align 4 store i32 %load_my_val, ptr %val, align 4 call void @conditional_return(ptr %conditional) - %val1 = getelementptr inbounds %conditional_return, ptr %conditional, i32 0, i32 1 + %val1 = getelementptr inbounds nuw %conditional_return, ptr %conditional, i32 0, i32 1 %load_val = load i32, ptr %val1, align 4 store i32 %load_val, ptr %main, align 4 %main_ret = load i32, ptr %main, align 4 @@ -40,8 +40,8 @@ define void @conditional_return(ptr %0) { entry: %this = alloca ptr, align 8 store ptr %0, ptr %this, align 8 - %__vtable = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 0 - %val = getelementptr inbounds %conditional_return, ptr %0, i32 0, i32 1 + %__vtable = getelementptr inbounds nuw %conditional_return, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %conditional_return, ptr %0, i32 0, i32 1 %load_val = load i32, ptr %val, align 4 %tmpVar = icmp eq i32 %load_val, 5 %tmpVar1 = xor i1 %tmpVar, true @@ -60,7 +60,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__body = getelementptr inbounds %__vtable_conditional_return, ptr %deref, i32 0, i32 0 + %__body = getelementptr inbounds nuw %__vtable_conditional_return, ptr %deref, i32 0, i32 0 store ptr @conditional_return, ptr %__body, align 8 ret void } @@ -70,7 +70,7 @@ entry: %self = alloca ptr, align 8 store ptr %0, ptr %self, align 8 %deref = load ptr, ptr %self, align 8 - %__vtable = getelementptr inbounds %conditional_return, ptr %deref, i32 0, i32 0 + %__vtable = getelementptr inbounds nuw %conditional_return, ptr %deref, i32 0, i32 0 store ptr @__vtable_conditional_return_instance, ptr %__vtable, align 8 ret void } diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap index 5a69ca30f82..6d2e4194cbb 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__jump_debug.snap @@ -12,7 +12,7 @@ target triple = "[filtered]" define void @foo(ptr %0) !dbg !11 { entry: #dbg_declare(ptr %0, !15, !DIExpression(), !16) - %val = getelementptr inbounds %foo, ptr %0, i32 0, i32 0 + %val = getelementptr inbounds nuw %foo, ptr %0, i32 0, i32 0 br label %lbl, !dbg !17 lbl: ; preds = %lbl, %entry diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap index d1cd19e3ce8..8082c6f0242 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__sink_source_debug.snap @@ -12,7 +12,7 @@ target triple = "[filtered]" define void @main(ptr %0) !dbg !11 { entry: #dbg_declare(ptr %0, !15, !DIExpression(), !16) - %x = getelementptr inbounds %main, ptr %0, i32 0, i32 0 + %x = getelementptr inbounds nuw %main, ptr %0, i32 0, i32 0 store i32 5, ptr %x, align 4, !dbg !17 ret void, !dbg !18 } From 2ea807693237748a28e9206e2d9126eb307eac23 Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Thu, 11 Dec 2025 10:34:53 +0100 Subject: [PATCH 7/8] chore: update to LLVM 21 --- Cargo.lock | 4 +- Cargo.toml | 2 +- src/codegen/tests/code_gen_tests.rs | 4 +- src/codegen/tests/debug_tests.rs | 6 +-- ...ate_return_value_variable_in_function.snap | 2 +- ...rray_size_correctly_set_in_dwarf_info.snap | 2 +- src/codegen/tests/directaccess_test.rs | 8 ++-- src/codegen/tests/fnptr.rs | 16 +++---- .../complex_initializers.rs | 6 +-- ...initializer_gets_declared_initializer.snap | 2 +- ..._initializer_gets_default_initializer.snap | 4 +- ..._class_struct_initialized_in_function.snap | 2 +- ...ues_for_not_initialized_function_vars.snap | 2 +- ..._block_struct_initialized_in_function.snap | 2 +- ..._is_initialized_with_type_initializer.snap | 2 +- ...lizers__initialized_array_in_function.snap | 2 +- ...s__initialized_array_type_in_function.snap | 2 +- ...for_struct_initialization_in_function.snap | 2 +- src/codegen/tests/oop_tests.rs | 12 ++--- src/codegen/tests/oop_tests/debug_tests.rs | 12 ++--- src/codegen/tests/oop_tests/super_tests.rs | 4 +- src/codegen/tests/parameters_tests.rs | 48 +++++++++---------- src/codegen/tests/polymorphism.rs | 2 +- ...ues_for_not_initialized_function_vars.snap | 2 +- ...ts__method_with_aggregate_return_type.snap | 6 +-- ...s__code_gen_tests__methods_var_output.snap | 6 +-- ..._program_with_special_chars_in_string.snap | 2 +- ...tests__program_with_string_assignment.snap | 2 +- ...uctions_tests__string_comparison_test.snap | 4 +- ...ests__string_equal_with_constant_test.snap | 4 +- ...g_greater_or_equal_with_constant_test.snap | 4 +- ...ts__string_greater_with_constant_test.snap | 4 +- ...tests__string_less_with_constant_test.snap | 4 +- ...__string_not_equal_with_constant_test.snap | 4 +- ...g_smaller_or_equal_with_constant_test.snap | 4 +- ...tests__assigning_const_array_variable.snap | 2 +- ...ests__assigning_const_string_variable.snap | 2 +- ...ests__assigning_const_struct_variable.snap | 2 +- ..._test__qualified_reference_assignment.snap | 2 +- ...function_call_mux_with_aggregate_type.snap | 2 +- ...s__calling_strings_in_function_return.snap | 4 +- ...ion_tests__strings_in_function_return.snap | 2 +- ...ests__argument_fed_by_ref_then_by_val.snap | 4 +- ...ests__function_call_with_array_access.snap | 2 +- ...literal_string_argument_passed_by_ref.snap | 4 +- ...tests__passing_a_string_to_a_function.snap | 4 +- ...generic_codegen_with_aggregate_return.snap | 4 +- ...eneric_function_with_aggregate_return.snap | 2 +- ...n_result_assignment_on_aliased_string.snap | 6 +-- ..._function_result_assignment_on_string.snap | 6 +-- ..._casted_string_assignment_uses_memcpy.snap | 2 +- ...g_generic_string_should_return_by_ref.snap | 4 +- ...ts__function_returns_a_literal_string.snap | 4 +- ...es_string_paramter_and_returns_string.snap | 6 +-- ...rings_should_be_collected_as_literals.snap | 4 +- ...__string_tests__program_string_output.snap | 2 +- ...program_with_casted_string_assignment.snap | 2 +- ...__program_with_string_type_assignment.snap | 2 +- ...ing_tests__string_function_parameters.snap | 6 +-- ...stant_var_string_should_be_memcpyable.snap | 4 +- ...ar_string_should_be_memcpyable_nonref.snap | 4 +- ...ariable_length_strings_can_be_created.snap | 2 +- ...trings_using_constants_can_be_created.snap | 2 +- ...ests__variable_string_assignment_test.snap | 2 +- ...string_tests__vartmp_string_init_test.snap | 4 +- ...ariadic_functions_without_declaration.snap | 2 +- ...e_calls_with_differently_sized_arrays.snap | 4 +- ...al_variable_passed_to_function_as_vla.snap | 2 +- ...ruct_is_generated_for_call_statements.snap | 4 +- ...sts__vla_tests__multi_dimensional_vla.snap | 4 +- ...en__tests__vla_tests__vla_read_access.snap | 4 +- ..._vla_tests__vla_read_access_with_expr.snap | 4 +- ..._vla_tests__vla_read_access_with_lint.snap | 4 +- ...__vla_tests__vla_read_access_with_var.snap | 4 +- src/codegen/tests/statement_codegen_test.rs | 4 +- src/tests/adr/arrays_adr.rs | 2 +- src/tests/adr/initializer_functions_adr.rs | 2 +- src/tests/adr/pou_adr.rs | 8 ++-- src/tests/adr/strings_adr.rs | 4 +- src/tests/adr/structs_adr.rs | 2 +- src/tests/adr/vla_adr.rs | 2 +- ...r__conditional_return_evaluating_true.snap | 2 +- ...tional_return_evaluating_true_negated.snap | 2 +- 83 files changed, 176 insertions(+), 176 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e457444e37a..e1c5d5a694c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2157,9 +2157,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "llvm-sys" -version = "201.0.1" +version = "211.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb947e8b79254ca10d496d0798a9ba1287dcf68e50a92b016fec1cc45bef447" +checksum = "108b3ad2b2eaf2a561fc74196273b20e3436e4a688b8b44e250d83974dc1b2e2" dependencies = [ "anyhow", "cc", diff --git a/Cargo.toml b/Cargo.toml index ce6c6ec95be..627bd1cba5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,7 @@ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.7", features = ["llvm20-1"] } +inkwell = { version = "0.7", features = ["llvm21-1"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" diff --git a/src/codegen/tests/code_gen_tests.rs b/src/codegen/tests/code_gen_tests.rs index 3cb02273add..cdb5e25daa3 100644 --- a/src/codegen/tests/code_gen_tests.rs +++ b/src/codegen/tests/code_gen_tests.rs @@ -1156,7 +1156,7 @@ fn fb_method_called_locally() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) @@ -1246,7 +1246,7 @@ fn fb_local_method_var_shadows_parent_var() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) diff --git a/src/codegen/tests/debug_tests.rs b/src/codegen/tests/debug_tests.rs index 843a0f0fd01..2660f3e1b2f 100644 --- a/src/codegen/tests/debug_tests.rs +++ b/src/codegen/tests/debug_tests.rs @@ -705,13 +705,13 @@ END_FUNCTION } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 define void @__init_struct_(ptr %0) { entry: diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap index 1efff7f938d..dfa01b38ff7 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__aggregate_return_value_variable_in_function.snap @@ -20,7 +20,7 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap index 09758ceb288..3060a82cc21 100644 --- a/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap +++ b/src/codegen/tests/debug_tests/snapshots/rusty__codegen__tests__debug_tests__expression_debugging__array_size_correctly_set_in_dwarf_info.snap @@ -20,7 +20,7 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/directaccess_test.rs b/src/codegen/tests/directaccess_test.rs index a48d3fbf23f..256b4d909c0 100644 --- a/src/codegen/tests/directaccess_test.rs +++ b/src/codegen/tests/directaccess_test.rs @@ -218,7 +218,7 @@ fn direct_acess_in_output_assignment_implicit_explicit_and_mixed() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -284,7 +284,7 @@ fn direct_acess_in_output_assignment_with_simple_expression() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -350,7 +350,7 @@ fn direct_acess_in_output_assignment_with_simple_expression_implicit() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -443,7 +443,7 @@ fn direct_acess_in_output_assignment_with_complexe_expression() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); diff --git a/src/codegen/tests/fnptr.rs b/src/codegen/tests/fnptr.rs index 5ca86b35d4a..e97505e932f 100644 --- a/src/codegen/tests/fnptr.rs +++ b/src/codegen/tests/fnptr.rs @@ -57,7 +57,7 @@ fn function_pointer_method_no_parameters() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -122,7 +122,7 @@ fn function_pointer_method_with_return_type() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -217,13 +217,13 @@ fn function_pointer_method_with_return_type_aggregate() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } @@ -318,10 +318,10 @@ fn function_pointer_method_with_all_variable_parameter_types() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } @@ -412,7 +412,7 @@ fn function_block_body() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); diff --git a/src/codegen/tests/initialization_test/complex_initializers.rs b/src/codegen/tests/initialization_test/complex_initializers.rs index 1002333b3eb..3edc9dd3ad7 100644 --- a/src/codegen/tests/initialization_test/complex_initializers.rs +++ b/src/codegen/tests/initialization_test/complex_initializers.rs @@ -853,7 +853,7 @@ fn user_init_called_for_variables_on_stack() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { entry: @@ -2194,7 +2194,7 @@ fn temporary_variable_ref_to_temporary_variable() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 define void @__init___Test() { entry: @@ -2884,7 +2884,7 @@ fn methods_call_init_functions_for_their_members() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { entry: diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap index acfffce7c8f..458431e0d1e 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_declared_initializer.snap @@ -28,6 +28,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap index dd70fa52db9..6e072b8b516 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__global_initializers__global_constant_without_initializer_gets_default_initializer.snap @@ -31,10 +31,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap index 0d23475d098..b8034faca06 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__class_struct_initialized_in_function.snap @@ -39,6 +39,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap index f6e05137832..06c7173c325 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__default_values_for_not_initialized_function_vars.snap @@ -24,6 +24,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap index c652a9a5571..46e3780e48f 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_block_struct_initialized_in_function.snap @@ -40,6 +40,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap index d6d42ac2581..12a7f2792dd 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__function_return_value_is_initialized_with_type_initializer.snap @@ -35,6 +35,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap index 2fe04095af6..1d9ddabd3fa 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_in_function.snap @@ -20,6 +20,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap index 29b2b8c23a2..0bdf184a82f 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__initialized_array_type_in_function.snap @@ -20,6 +20,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap index bbc2f1fae2e..86347566fde 100644 --- a/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap +++ b/src/codegen/tests/initialization_test/snapshots/rusty__codegen__tests__initialization_test__pou_initializers__memcpy_for_struct_initialization_in_function.snap @@ -22,6 +22,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/oop_tests.rs b/src/codegen/tests/oop_tests.rs index 07c710c370d..a226e6d3af2 100644 --- a/src/codegen/tests/oop_tests.rs +++ b/src/codegen/tests/oop_tests.rs @@ -440,13 +440,13 @@ fn write_to_parent_variable_in_instance() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { entry: @@ -664,7 +664,7 @@ fn array_in_parent_generated() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 define void @__init___vtable_grandparent(ptr %0) { entry: @@ -1395,7 +1395,7 @@ fn pass_this_to_method() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_fb_test(ptr %0) { entry: @@ -2504,7 +2504,7 @@ fn function_with_output_used_in_main_by_extension() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { entry: diff --git a/src/codegen/tests/oop_tests/debug_tests.rs b/src/codegen/tests/oop_tests/debug_tests.rs index 6a66353e71a..0b5a75acf09 100644 --- a/src/codegen/tests/oop_tests/debug_tests.rs +++ b/src/codegen/tests/oop_tests/debug_tests.rs @@ -548,13 +548,13 @@ fn write_to_parent_variable_in_instance() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { entry: @@ -833,7 +833,7 @@ fn array_in_parent_generated() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 define void @__init___vtable_grandparent(ptr %0) { entry: @@ -1754,10 +1754,10 @@ END_FUNCTION } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 define void @__init___vtable_parent(ptr %0) { entry: diff --git a/src/codegen/tests/oop_tests/super_tests.rs b/src/codegen/tests/oop_tests/super_tests.rs index dbaa1274301..3296c8a0d11 100644 --- a/src/codegen/tests/oop_tests/super_tests.rs +++ b/src/codegen/tests/oop_tests/super_tests.rs @@ -1682,7 +1682,7 @@ fn super_as_function_parameter() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_parent(ptr %0) { entry: @@ -2707,7 +2707,7 @@ fn super_with_structured_types() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_parent(ptr %0) { entry: diff --git a/src/codegen/tests/parameters_tests.rs b/src/codegen/tests/parameters_tests.rs index 9f0c06d324a..66c75a6339d 100644 --- a/src/codegen/tests/parameters_tests.rs +++ b/src/codegen/tests/parameters_tests.rs @@ -736,10 +736,10 @@ fn by_value_function_arg_builtin_type_strings_are_memcopied() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } @@ -794,10 +794,10 @@ fn by_value_function_arg_user_type_strings_are_memcopied() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } @@ -851,10 +851,10 @@ fn by_value_function_arg_arrays_are_memcopied() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } @@ -918,7 +918,7 @@ fn by_value_function_arg_structs_are_memcopied() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -990,7 +990,7 @@ fn by_value_function_arg_structs_with_aggregate_members_are_memcopied() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -1057,13 +1057,13 @@ fn by_value_fb_arg_aggregates_are_memcopied() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } @@ -1152,10 +1152,10 @@ fn var_output_aggregate_types_are_memcopied() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -1213,10 +1213,10 @@ fn array_of_string_parameter_with_stride_calculation() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } @@ -1284,7 +1284,7 @@ fn array_of_array_integer_parameter_with_stride_calculation() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#) @@ -1343,10 +1343,10 @@ fn mixed_string_lengths_parameter_compatibility() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } @@ -1414,7 +1414,7 @@ fn program_with_array_of_string_parameter_stride_calculation() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) @@ -1557,7 +1557,7 @@ fn method_with_var_in_out_array_of_strings() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) @@ -1727,7 +1727,7 @@ fn method_with_mixed_array_types() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#) @@ -1861,13 +1861,13 @@ fn function_with_array_of_array_return() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/polymorphism.rs b/src/codegen/tests/polymorphism.rs index d8eacc3106b..b359f473791 100644 --- a/src/codegen/tests/polymorphism.rs +++ b/src/codegen/tests/polymorphism.rs @@ -146,7 +146,7 @@ fn simple_overridden_method() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_a(ptr %0) { entry: diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap index 6e2b7e9ca65..36f365fee1c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__default_values_for_not_initialized_function_vars.snap @@ -24,6 +24,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap index 1bf154b9c9a..da9036ec995 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__method_with_aggregate_return_type.snap @@ -41,13 +41,13 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap index 58818a0bc58..a8e6dae6a4d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__methods_var_output.snap @@ -42,13 +42,13 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap index cea09590df9..f8e0a6ef9ec 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_special_chars_in_string.snap @@ -29,6 +29,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap index b99cc6272f7..4d03d075357 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__code_gen_tests__program_with_string_assignment.snap @@ -23,6 +23,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap index 0fe152bb878..692037b7127 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_comparison_test.snap @@ -43,10 +43,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap index 73de2394330..0fa5db8c636 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_equal_with_constant_test.snap @@ -43,10 +43,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap index adfc1e51e28..6a4e107170f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_or_equal_with_constant_test.snap @@ -65,10 +65,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap index c912abd138b..50a0c4966b5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_greater_with_constant_test.snap @@ -38,10 +38,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap index 744a0359d6d..7db98a4b82f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_less_with_constant_test.snap @@ -38,10 +38,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap index f305ba18cc6..5c87f4609c8 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_not_equal_with_constant_test.snap @@ -41,10 +41,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap index eb3ff346998..8ac4588cba5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__compare_instructions_tests__string_smaller_or_equal_with_constant_test.snap @@ -65,10 +65,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap index df9d360ca7a..91cf487b880 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_array_variable.snap @@ -20,6 +20,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap index c9e9d7e510f..ef93b436d36 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_string_variable.snap @@ -20,6 +20,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap index e3146088dc7..56a5a517329 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__constants_tests__assigning_const_struct_variable.snap @@ -22,6 +22,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap index 27e249741a6..f82921b95fd 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__directaccess_test__qualified_reference_assignment.snap @@ -32,6 +32,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap index 0081423cb60..5485220b844 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__builtin_function_call_mux_with_aggregate_type.snap @@ -48,6 +48,6 @@ continue_block: ; preds = %entry, %5, %4, %3, } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap index 0e2dcc590cf..34e828ce53c 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__calling_strings_in_function_return.snap @@ -32,10 +32,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap index df2a2268acc..b7ee42c2a5f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__expression_tests__strings_in_function_return.snap @@ -23,6 +23,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap index 34ce23cfc7a..c02bee2c95e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__argument_fed_by_ref_then_by_val.snap @@ -41,10 +41,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap index fac9fbf3fb1..77312918ed3 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__function_call_with_array_access.snap @@ -30,6 +30,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap index 6369e68a449..0d86c7cfad5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__literal_string_argument_passed_by_ref.snap @@ -25,10 +25,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap index d739e237804..4d4defd9904 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__function_tests__passing_a_string_to_a_function.snap @@ -32,10 +32,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap index 258c6e86ab1..9988c4ce093 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_codegen_with_aggregate_return.snap @@ -32,10 +32,10 @@ entry: declare void @MID__STRING(ptr, ptr, i32, i32) ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap index 08b261e1171..0c80df95074 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__generics_test__generic_function_with_aggregate_return.snap @@ -21,6 +21,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap index 93d0a46df00..ac10a43fe37 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_aliased_string.snap @@ -28,13 +28,13 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap index 93d0a46df00..ac10a43fe37 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__statement_codegen_test__function_result_assignment_on_string.snap @@ -28,13 +28,13 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap index 8d18c878c0e..ba3f6863dbb 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__casted_string_assignment_uses_memcpy.snap @@ -25,6 +25,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap index 7c18a356d13..8ac95ca400f 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returning_generic_string_should_return_by_ref.snap @@ -39,10 +39,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap index e688280df34..17d47236db5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_returns_a_literal_string.snap @@ -32,10 +32,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap index 5043bc46da2..dc3bb1bc675 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_takes_string_paramter_and_returns_string.snap @@ -35,13 +35,13 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap index 6bc03ab7617..aa5e526bf86 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__function_var_constant_strings_should_be_collected_as_literals.snap @@ -27,9 +27,9 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap index 0d4985e1345..05b0248bc6e 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_string_output.snap @@ -35,6 +35,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap index 277344796c8..7448fe23c2b 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_casted_string_assignment.snap @@ -25,6 +25,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap index f55abdfe8a8..cc98b077af6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__program_with_string_type_assignment.snap @@ -28,6 +28,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap index 63c6de734fd..6aef1d41615 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__string_function_parameters.snap @@ -40,13 +40,13 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap index e8dd12bc444..5b6e50dcee4 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable.snap @@ -45,10 +45,10 @@ continue: ; preds = %condition_body, %en } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap index db7fc849ade..5d0ece5fc14 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__using_a_constant_var_string_should_be_memcpyable_nonref.snap @@ -47,10 +47,10 @@ continue: ; preds = %condition_body, %en } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap index 628f35e898a..99325aed641 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_can_be_created.snap @@ -27,6 +27,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap index d82fb05f27f..08462dcbccf 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_length_strings_using_constants_can_be_created.snap @@ -29,6 +29,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap index 5ddd32dd9c7..39c9cebacd5 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__variable_string_assignment_test.snap @@ -22,6 +22,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap index 7cab6157be2..8170a03e4af 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__string_tests__vartmp_string_init_test.snap @@ -22,10 +22,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap index cd1f75ee508..e02ef5998a9 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__typesystem_test__numerical_promotion_for_variadic_functions_without_declaration.snap @@ -34,6 +34,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap index a7cfd53e9b3..5a01d0da332 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__consecutive_calls_with_differently_sized_arrays.snap @@ -92,10 +92,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap index a3208c89716..78804fea05d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__global_variable_passed_to_function_as_vla.snap @@ -51,6 +51,6 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap index 854008fc4e7..9b48299045d 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__internal_vla_struct_is_generated_for_call_statements.snap @@ -37,10 +37,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap index e10b093f258..7db95ff80e6 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__multi_dimensional_vla.snap @@ -79,10 +79,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap index 3b0ec8ee3f8..f0241e5c9a7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access.snap @@ -54,10 +54,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap index c5f0fe3a3fd..e5e1a510f3a 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_expr.snap @@ -58,10 +58,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap index 3b0ec8ee3f8..f0241e5c9a7 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_lint.snap @@ -54,10 +54,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap index 23e781c8173..91212aa9913 100644 --- a/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap +++ b/src/codegen/tests/snapshots/rusty__codegen__tests__vla_tests__vla_read_access_with_var.snap @@ -57,10 +57,10 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) -declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 +declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } diff --git a/src/codegen/tests/statement_codegen_test.rs b/src/codegen/tests/statement_codegen_test.rs index bb15a7c4782..0942893d874 100644 --- a/src/codegen/tests/statement_codegen_test.rs +++ b/src/codegen/tests/statement_codegen_test.rs @@ -338,7 +338,7 @@ fn reference_to_string_assignment() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -403,7 +403,7 @@ fn local_string_alias() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); diff --git a/src/tests/adr/arrays_adr.rs b/src/tests/adr/arrays_adr.rs index 9b83d9e4536..38ee0de569c 100644 --- a/src/tests/adr/arrays_adr.rs +++ b/src/tests/adr/arrays_adr.rs @@ -88,7 +88,7 @@ fn assigning_full_arrays() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); diff --git a/src/tests/adr/initializer_functions_adr.rs b/src/tests/adr/initializer_functions_adr.rs index 55aa1bc0f33..4dc03288e41 100644 --- a/src/tests/adr/initializer_functions_adr.rs +++ b/src/tests/adr/initializer_functions_adr.rs @@ -993,7 +993,7 @@ fn intializing_temporary_variables() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @__init___vtable_foo(ptr %0) { entry: diff --git a/src/tests/adr/pou_adr.rs b/src/tests/adr/pou_adr.rs index d144941ca62..543bc690129 100644 --- a/src/tests/adr/pou_adr.rs +++ b/src/tests/adr/pou_adr.rs @@ -538,10 +538,10 @@ fn return_a_complex_type_from_function() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) } @@ -624,10 +624,10 @@ fn passing_aggregate_types_to_functions_by_value() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } diff --git a/src/tests/adr/strings_adr.rs b/src/tests/adr/strings_adr.rs index e874372c5a0..3ec72f90d2d 100644 --- a/src/tests/adr/strings_adr.rs +++ b/src/tests/adr/strings_adr.rs @@ -85,7 +85,7 @@ fn assigning_strings() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); @@ -129,7 +129,7 @@ fn assigning_string_literals() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); diff --git a/src/tests/adr/structs_adr.rs b/src/tests/adr/structs_adr.rs index ffcd59f6a32..d20abf518e5 100644 --- a/src/tests/adr/structs_adr.rs +++ b/src/tests/adr/structs_adr.rs @@ -163,7 +163,7 @@ fn assigning_structs() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) - declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 + declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } "#); diff --git a/src/tests/adr/vla_adr.rs b/src/tests/adr/vla_adr.rs index ae2f36efe1e..9a7910c3103 100644 --- a/src/tests/adr/vla_adr.rs +++ b/src/tests/adr/vla_adr.rs @@ -350,7 +350,7 @@ fn pass() { } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) - declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0 + declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) } "#); diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap index e1f3c48b1ea..438167a05f5 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true.snap @@ -34,7 +34,7 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @conditional_return(ptr %0) { entry: diff --git a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap index 453b26a7692..8748237468f 100644 --- a/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap +++ b/tests/integration/snapshots/tests__integration__cfc__ir__conditional_return_evaluating_true_negated.snap @@ -34,7 +34,7 @@ entry: } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) -declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 +declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0 define void @conditional_return(ptr %0) { entry: From 1bd552f62994bff70f4a2af7f90db21cd267d527 Mon Sep 17 00:00:00 2001 From: Volkan Sagcan Date: Wed, 17 Dec 2025 11:46:16 +0100 Subject: [PATCH 8/8] ci: fix workflows for LLVM 21 --- .github/workflows/linux.yml | 3 + .github/workflows/metrics.yml | 3 + .github/workflows/windows.yml | 18 +- Cargo.lock | 1925 ++++++-------------------- Cargo.toml | 7 +- book/book.toml | 1 - errorcode_book_generator/Cargo.toml | 2 +- errorcode_book_generator/src/main.rs | 25 +- tests/lit/lit.cfg | 2 +- 9 files changed, 481 insertions(+), 1505 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7c03d7bf857..bd5696ba2e9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -47,6 +47,9 @@ jobs: - name: Release Build shell: bash run: | + # required by aarch64 build + apt update && apt install -y gcc-aarch64-linux-gnu + echo "Build command : ./scripts/build.sh --build --release" ./scripts/build.sh --build --release --package \ --target x86_64-linux-gnu,aarch64-linux-gnu, \ diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index a4f340e6bbf..389ada675ab 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -20,6 +20,9 @@ jobs: container: ghcr.io/plc-lang/rust-llvm:latest steps: + - name: Install git + run: apt-get update && apt-get install -y git + - uses: actions/checkout@v3 - name: Update git permissions diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cc652de9fe9..c7695d18194 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,9 +13,6 @@ jobs: build: name: Windows Build runs-on: windows-2022 - env: - toolchain-version: 1.90.0 - llvm-version: 14.0.6 steps: - uses: actions/checkout@v3 @@ -23,13 +20,17 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ env.toolchain-version }} + toolchain: 1.90.0 - name: Install LLVM - uses: ghaith/install-llvm-action@latest - with: - version: ${{ env.llvm-version }} - directory: "./llvm" + shell: pwsh + run: | + $llvmUrl = "https://github.com/PLC-lang/llvm-package-windows/releases/download/v21.1.7/LLVM-21.1.7-win64.7z" + $llvmArchive = "LLVM-21.1.7-win64.7z" + Invoke-WebRequest -Uri $llvmUrl -OutFile $llvmArchive + 7z x $llvmArchive -o"./llvm" -y + $llvmBin = (Resolve-Path "./llvm/bin").Path + echo "$llvmBin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Cargo test (Unit) run: cargo test --lib -- --nocapture @@ -47,4 +48,3 @@ jobs: with: name: plc.exe path: target/release/plc.exe - diff --git a/Cargo.lock b/Cargo.lock index e1c5d5a694c..9192a5b94c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - [[package]] name = "ahash" version = "0.8.12" @@ -24,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.3.3", + "getrandom 0.3.4", "once_cell", "serde", "version_check", @@ -33,9 +18,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -46,19 +31,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "ammonia" -version = "4.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e913097e1a2124b46746c980134e8c954bc17a6a59bb3fde96f088d126dde6" -dependencies = [ - "cssparser", - "html5ever", - "maplit", - "tendril", - "url", -] - [[package]] name = "android_system_properties" version = "0.1.5" @@ -75,14 +47,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" dependencies = [ "anstyle", - "unicode-width 0.2.1", + "unicode-width 0.2.2", ] [[package]] name = "anstream" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -110,22 +82,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -221,7 +193,7 @@ dependencies = [ "polling 3.11.0", "rustix 1.1.2", "slab", - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -308,76 +280,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "axum" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98e529aee37b5c8206bb4bf4c44797127566d72f76952c970bd3d1e85de8f4e2" -dependencies = [ - "axum-core", - "base64 0.22.1", - "bytes", - "form_urlencoded", - "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "hyper 1.7.0", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "serde_core", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sha1", - "sync_wrapper 1.0.2", - "tokio", - "tokio-tungstenite", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ac7a6beb1182c7e30253ee75c3e918080bfb83f5a3023bcdf7209d85fd147e6" -dependencies = [ - "bytes", - "futures-core", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "mime", - "pin-project-lite", - "sync_wrapper 1.0.2", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link", -] - [[package]] name = "base64" version = "0.21.7" @@ -392,9 +294,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" [[package]] name = "beef" @@ -425,11 +327,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.4" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -454,22 +356,11 @@ dependencies = [ "piper", ] -[[package]] -name = "bstr" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" -dependencies = [ - "memchr", - "regex-automata", - "serde", -] - [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "bytecount" @@ -485,15 +376,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "cc" -version = "1.2.39" +version = "1.2.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1354349954c6fc9cb0deab020f27f783cf0b604e8bb754dc4658ecf0d29c35f" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" dependencies = [ "find-msvc-tools", "shlex", @@ -501,9 +392,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" @@ -537,34 +428,24 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.48" +version = "4.5.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" +checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" dependencies = [ "clap_builder", - "clap_derive 4.5.47", + "clap_derive 4.5.49", ] [[package]] name = "clap_builder" -version = "4.5.48" +version = "4.5.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" +checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.5", + "clap_lex 0.7.6", "strsim 0.11.1", - "terminal_size", -] - -[[package]] -name = "clap_complete" -version = "4.5.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75bf0b32ad2e152de789bb635ea4d3078f6b838ad7974143e99b99f45a04af4a" -dependencies = [ - "clap 4.5.48", ] [[package]] @@ -575,21 +456,21 @@ checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck 0.4.1", "proc-macro-error", - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "syn 1.0.109", ] [[package]] name = "clap_derive" -version = "4.5.47" +version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ "heck 0.5.0", - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -603,9 +484,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "codespan-reporting" @@ -683,9 +564,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" +checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" dependencies = [ "crc-catalog", ] @@ -732,78 +613,14 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", ] -[[package]] -name = "cssparser" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e901edd733a1472f944a45116df3f846f54d37e67e68640ac8bb69689aca2aa" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa", - "phf", - "smallvec", -] - -[[package]] -name = "cssparser-macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" -dependencies = [ - "quote 1.0.41", - "syn 2.0.106", -] - -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.101", - "quote 1.0.41", - "strsim 0.11.1", - "syn 2.0.106", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core", - "quote 1.0.41", - "syn 2.0.106", -] - -[[package]] -name = "data-encoding" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" - [[package]] name = "der" version = "0.7.10" @@ -817,44 +634,13 @@ dependencies = [ [[package]] name = "deranged" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] -[[package]] -name = "derive_builder" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" -dependencies = [ - "darling", - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", -] - -[[package]] -name = "derive_builder_macro" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" -dependencies = [ - "derive_builder_core", - "syn 2.0.106", -] - [[package]] name = "derive_more" version = "0.99.20" @@ -862,10 +648,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "rustc_version", - "syn 2.0.106", + "syn 2.0.111", ] [[package]] @@ -892,9 +678,9 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -903,21 +689,6 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" -[[package]] -name = "dtoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6add3b8cff394282be81f3fc1a0605db594ed69890078ca6e2cab1c408bcf04" - -[[package]] -name = "dtoa-short" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" -dependencies = [ - "dtoa", -] - [[package]] name = "either" version = "1.15.0" @@ -927,18 +698,6 @@ dependencies = [ "serde", ] -[[package]] -name = "elasticlunr-rs" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41e83863a500656dfa214fee6682de9c5b9f03de6860fec531235ed2ae9f6571" -dependencies = [ - "regex", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "encode_unicode" version = "1.0.0" @@ -963,16 +722,6 @@ dependencies = [ "encoding_rs", ] -[[package]] -name = "env_filter" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -986,19 +735,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "env_logger" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "jiff", - "log", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -1012,18 +748,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] name = "errorcode_book_generator" version = "0.1.0" dependencies = [ - "clap 4.5.48", - "mdbook", + "clap 4.5.53", + "mdbook-preprocessor", "semver", "serde_json", - "toml", + "toml 0.5.11", ] [[package]] @@ -1091,9 +827,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "find-msvc-tools" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" [[package]] name = "flume" @@ -1152,25 +888,6 @@ dependencies = [ "num", ] -[[package]] -name = "fsevent-sys" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" -dependencies = [ - "libc", -] - -[[package]] -name = "futf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" -dependencies = [ - "mac", - "new_debug_unreachable", -] - [[package]] name = "futures" version = "0.3.31" @@ -1258,17 +975,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", -] - [[package]] name = "futures-sink" version = "0.3.31" @@ -1290,7 +996,6 @@ dependencies = [ "futures-channel", "futures-core", "futures-io", - "futures-macro", "futures-sink", "futures-task", "memchr", @@ -1327,47 +1032,28 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.7+wasi-0.2.4", + "wasip2", ] -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - [[package]] name = "glob" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" -[[package]] -name = "globset" -version = "0.4.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax 0.8.6", -] - [[package]] name = "gloo-timers" version = "0.3.0" @@ -1391,30 +1077,14 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.12", - "indexmap 2.11.4", + "http", + "indexmap 2.12.1", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "handlebars" -version = "6.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759e2d5aea3287cb1190c8ec394f42866cb5bf74fcbf213f354e3c856ea26098" -dependencies = [ - "derive_builder", - "log", - "num-order", - "pest", - "pest_derive", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1434,9 +1104,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "hashlink" @@ -1506,11 +1176,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1522,17 +1192,6 @@ dependencies = [ "utf8-width", ] -[[package]] -name = "html5ever" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4" -dependencies = [ - "log", - "markup5ever", - "match_token", -] - [[package]] name = "http" version = "0.2.12" @@ -1544,17 +1203,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http-body" version = "0.4.6" @@ -1562,39 +1210,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http 1.3.1", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http 1.3.1", - "http-body 1.0.1", + "http", "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" - [[package]] name = "httparse" version = "1.10.1" @@ -1624,8 +1243,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.12", - "http-body 0.4.6", + "http", + "http-body", "httparse", "httpdate", "itoa", @@ -1638,47 +1257,10 @@ dependencies = [ ] [[package]] -name = "hyper" -version = "1.7.0" +name = "iana-time-zone" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "http 1.3.1", - "http-body 1.0.1", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "pin-utils", - "smallvec", - "tokio", -] - -[[package]] -name = "hyper-util" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" -dependencies = [ - "bytes", - "futures-core", - "http 1.3.1", - "http-body 1.0.1", - "hyper 1.7.0", - "pin-project-lite", - "tokio", - "tower-service", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1700,9 +1282,9 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", "potential_utf", @@ -1713,9 +1295,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -1726,11 +1308,10 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", @@ -1741,42 +1322,38 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", - "potential_utf", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", - "stable_deref_trait", - "tinystr", "writeable", "yoke", "zerofrom", @@ -1784,12 +1361,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "1.1.0" @@ -1826,22 +1397,6 @@ dependencies = [ "rusty", ] -[[package]] -name = "ignore" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" -dependencies = [ - "crossbeam-deque", - "globset", - "log", - "memchr", - "regex-automata", - "same-file", - "walkdir", - "winapi-util", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -1854,19 +1409,18 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.11.4" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", - "hashbrown 0.16.0", + "hashbrown 0.16.1", ] [[package]] name = "inkwell" version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39457e8611219cf690f862a470575f5c06862910d03ea3c3b187ad7abc44b4e2" +source = "git+https://github.com/TheDan64/inkwell.git?rev=7abf48a2cf4fc3e338fbeb1780ac7507cbb13e98#7abf48a2cf4fc3e338fbeb1780ac7507cbb13e98" dependencies = [ "inkwell_internals", "libc", @@ -1878,39 +1432,18 @@ dependencies = [ [[package]] name = "inkwell_internals" version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9a7dd586b00f2b20e0b9ae3c6faa351fbfd56d15d63bbce35b13bece682eda" -dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", -] - -[[package]] -name = "inotify" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" -dependencies = [ - "bitflags 2.9.4", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +source = "git+https://github.com/TheDan64/inkwell.git?rev=7abf48a2cf4fc3e338fbeb1780ac7507cbb13e98#7abf48a2cf4fc3e338fbeb1780ac7507cbb13e98" dependencies = [ - "libc", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] name = "insta" -version = "1.43.2" +version = "1.44.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fdb647ebde000f43b5b53f773c30cf9b0cb4300453208713fa38b2c70935a0" +checksum = "b5c943d4415edd8153251b6f197de5eb1640e56d84e8d9159bea190421c73698" dependencies = [ "console", "once_cell", @@ -1938,17 +1471,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "io-uring" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" -dependencies = [ - "bitflags 2.9.4", - "cfg-if", - "libc", -] - [[package]] name = "ipnet" version = "2.11.0" @@ -1957,20 +1479,20 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is-terminal" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi 0.5.2", "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "iso8601" @@ -1996,35 +1518,11 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" -[[package]] -name = "jiff" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" -dependencies = [ - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde", -] - -[[package]] -name = "jiff-static" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" -dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", -] - [[package]] name = "js-sys" -version = "0.3.81" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -2040,7 +1538,7 @@ dependencies = [ "anyhow", "base64 0.21.7", "bytecount", - "clap 4.5.48", + "clap 4.5.53", "fancy-regex", "fraction", "getrandom 0.2.16", @@ -2060,26 +1558,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "kqueue" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" -dependencies = [ - "kqueue-sys", - "libc", -] - -[[package]] -name = "kqueue-sys" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" -dependencies = [ - "bitflags 1.3.2", - "libc", -] - [[package]] name = "kv-log-macro" version = "1.0.7" @@ -2100,9 +1578,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.176" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" [[package]] name = "libm" @@ -2112,13 +1590,13 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +checksum = "df15f6eac291ed1cf25865b1ee60399f57e7c227e7f51bdbd4c5270396a9ed50" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "libc", - "redox_syscall", + "redox_syscall 0.6.0", ] [[package]] @@ -2151,9 +1629,9 @@ checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "llvm-sys" @@ -2171,19 +1649,18 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" dependencies = [ "value-bag", ] @@ -2205,52 +1682,12 @@ checksum = "a1d849148dbaf9661a6151d1ca82b13bb4c4c128146a88d05253b38d4e2f496c" dependencies = [ "beef", "fnv", - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "regex-syntax 0.6.29", "syn 1.0.109", ] -[[package]] -name = "mac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" - -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "markup5ever" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fe69c934650f8f19652b3946075f0fc41ad8757dbb68f1ca14e7900ecc1c3" -dependencies = [ - "log", - "tendril", - "web_atoms", -] - -[[package]] -name = "match_token" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf" -dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", -] - -[[package]] -name = "matchit" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" - [[package]] name = "md-5" version = "0.10.6" @@ -2262,41 +1699,29 @@ dependencies = [ ] [[package]] -name = "mdbook" -version = "0.4.52" +name = "mdbook-core" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c284d2855916af7c5919cf9ad897cfc77d3c2db6f55429c7cfb769182030ec" +checksum = "39a3873d4afac65583f1acb56ff058df989d5b4a2464bb02c785549727d307ee" dependencies = [ - "ammonia", "anyhow", - "axum", - "chrono", - "clap 4.5.48", - "clap_complete", - "elasticlunr-rs", - "env_logger 0.11.8", - "futures-util", - "handlebars", - "hex", - "ignore", - "log", - "memchr", - "notify", - "notify-debouncer-mini", - "opener", - "pathdiff", - "pulldown-cmark", "regex", "serde", "serde_json", - "sha2", - "shlex", - "tempfile", - "tokio", - "toml", - "topological-sort", - "tower-http", - "walkdir", + "toml 0.9.8", + "tracing", +] + +[[package]] +name = "mdbook-preprocessor" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d87bf40be0597f26f0822f939a64f02bf92c4655ba04490aadbf83601a013bb" +dependencies = [ + "anyhow", + "mdbook-core", + "serde", + "serde_json", ] [[package]] @@ -2311,41 +1736,21 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - [[package]] name = "mio" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", - "log", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", + "wasi", + "windows-sys 0.61.2", ] [[package]] @@ -2365,12 +1770,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - [[package]] name = "nom" version = "7.1.3" @@ -2390,51 +1789,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "normpath" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf23ab2b905654b4cb177e30b629937b3868311d4e1cba859f899c041046e69b" -dependencies = [ - "windows-sys 0.61.1", -] - -[[package]] -name = "notify" -version = "8.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" -dependencies = [ - "bitflags 2.9.4", - "fsevent-sys", - "inotify", - "kqueue", - "libc", - "log", - "mio", - "notify-types", - "walkdir", - "windows-sys 0.60.2", -] - -[[package]] -name = "notify-debouncer-mini" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a689eb4262184d9a1727f9087cd03883ea716682ab03ed24efec57d7716dccb8" -dependencies = [ - "log", - "notify", - "notify-types", - "tempfile", -] - -[[package]] -name = "notify-types" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" - [[package]] name = "ntapi" version = "0.4.1" @@ -2470,17 +1824,16 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" dependencies = [ - "byteorder", "lazy_static", "libm", "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "rand", "smallvec", "zeroize", ] @@ -2526,21 +1879,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-modular" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17bb261bf36fa7d83f4c294f834e91256769097b3cb505d44831e0a179ac647f" - -[[package]] -name = "num-order" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537b596b97c40fcf8056d153049eb22f481c17ebce72a513ec9286e4986d1bb6" -dependencies = [ - "num-modular", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -2562,15 +1900,6 @@ dependencies = [ "libm", ] -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -2579,28 +1908,17 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" - -[[package]] -name = "opener" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9024962ab91e00c89d2a14352a8d0fc1a64346bf96f1839b45c09149564e47" -dependencies = [ - "bstr", - "normpath", - "windows-sys 0.60.2", -] +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openssl" -version = "0.10.73" +version = "0.10.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "cfg-if", "foreign-types", "libc", @@ -2615,9 +1933,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -2628,9 +1946,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.109" +version = "0.9.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" dependencies = [ "cc", "libc", @@ -2652,160 +1970,58 @@ checksum = "6978128c8b51d8f4080631ceb2302ab51e32cc6e8615f735ee2f83fd269ae3f1" dependencies = [ "bytecount", "fnv", - "unicode-width 0.2.1", + "unicode-width 0.2.2", ] [[package]] name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - -[[package]] -name = "parking_lot" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "pest" -version = "2.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e0a3a33733faeaf8651dfee72dd0f388f0c8e5ad496a3478fa5a922f49cfa8" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc58706f770acb1dbd0973e6530a3cff4746fb721207feb3a8a6064cd0b6c663" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d4f36811dfe07f7b8573462465d5cb8965fffc2e71ae377a33aecf14c2c9a2f" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", -] - -[[package]] -name = "pest_meta" -version = "2.8.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42919b05089acbd0a5dcd5405fb304d17d1053847b81163d09c4ad18ce8e8420" -dependencies = [ - "pest", - "sha2", -] +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] -name = "phf" -version = "0.11.3" +name = "parking_lot" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ - "phf_macros", - "phf_shared", + "lock_api", + "parking_lot_core", ] [[package]] -name = "phf_codegen" -version = "0.11.3" +name = "parking_lot_core" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ - "phf_generator", - "phf_shared", + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link", ] [[package]] -name = "phf_generator" -version = "0.11.3" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand 0.8.5", -] +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "phf_macros" -version = "0.11.3" +name = "pem-rfc7468" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "base64ct", ] [[package]] -name = "phf_shared" -version = "0.11.3" +name = "percent-encoding" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project-lite" @@ -2890,7 +2106,7 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "toml", + "toml 0.5.11", ] [[package]] @@ -2901,8 +2117,8 @@ dependencies = [ "clap 3.2.25", "encoding_rs", "encoding_rs_io", - "env_logger 0.10.2", - "indexmap 2.11.4", + "env_logger", + "indexmap 2.12.1", "insta", "itertools", "log", @@ -2920,7 +2136,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "toml", + "toml 0.5.11", ] [[package]] @@ -2983,7 +2199,7 @@ name = "plc_xml" version = "0.1.0" dependencies = [ "html-escape", - "indexmap 2.11.4", + "indexmap 2.12.1", "insta", "itertools", "logos", @@ -3022,29 +2238,14 @@ dependencies = [ "hermit-abi 0.5.2", "pin-project-lite", "rustix 1.1.2", - "windows-sys 0.61.1", -] - -[[package]] -name = "portable-atomic" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" - -[[package]] -name = "portable-atomic-util" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" -dependencies = [ - "portable-atomic", + "windows-sys 0.61.2", ] [[package]] name = "potential_utf" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" dependencies = [ "zerovec", ] @@ -3064,12 +2265,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - [[package]] name = "pretty_assertions" version = "1.4.1" @@ -3087,8 +2282,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "syn 1.0.109", "version_check", ] @@ -3099,8 +2294,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "version_check", ] @@ -3110,8 +2305,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", ] [[package]] @@ -3121,9 +2316,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ "proc-macro-error-attr2", - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -3137,31 +2332,13 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.101" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] -[[package]] -name = "pulldown-cmark" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" -dependencies = [ - "bitflags 2.9.4", - "memchr", - "pulldown-cmark-escape", - "unicase", -] - -[[package]] -name = "pulldown-cmark-escape" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" - [[package]] name = "quick-xml" version = "0.30.0" @@ -3183,11 +2360,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.41" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ - "proc-macro2 1.0.101", + "proc-macro2 1.0.103", ] [[package]] @@ -3203,18 +2380,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", + "rand_chacha", + "rand_core", ] [[package]] @@ -3224,17 +2391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.3", + "rand_core", ] [[package]] @@ -3246,15 +2403,6 @@ dependencies = [ "getrandom 0.2.16", ] -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" -dependencies = [ - "getrandom 0.3.3", -] - [[package]] name = "rayon" version = "1.11.0" @@ -3277,41 +2425,50 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.17" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "redox_syscall" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +checksum = "ec96166dafa0886eb81fe1c0a388bece180fbef2135f97c1e2cf8302e74b43b5" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", ] [[package]] name = "regex" -version = "1.11.3" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.6", + "regex-syntax 0.8.8", ] [[package]] name = "regex-automata" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.6", + "regex-syntax 0.8.8", ] [[package]] name = "regex-lite" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943f41321c63ef1c92fd763bfe054d2668f7f225a5c29f0105903dc2fc04ba30" +checksum = "8d942b98df5e658f56f20d592c7f868833fe38115e65c33003d8cd224b0155da" [[package]] name = "regex-syntax" @@ -3321,9 +2478,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" @@ -3337,9 +2494,9 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", + "http", + "http-body", + "hyper", "ipnet", "js-sys", "log", @@ -3350,7 +2507,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 0.1.2", + "sync_wrapper", "system-configuration", "tokio", "tower-service", @@ -3363,9 +2520,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b" +checksum = "40a0376c50d0358279d9d643e4bf7b7be212f1f4ff1da9070a7b54d22ef75c88" dependencies = [ "const-oid", "digest", @@ -3374,19 +2531,13 @@ dependencies = [ "num-traits", "pkcs1", "pkcs8", - "rand_core 0.6.4", + "rand_core", "signature", "spki", "subtle", "zeroize", ] -[[package]] -name = "rustc-demangle" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" - [[package]] name = "rustc-hash" version = "1.1.0" @@ -3422,7 +2573,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "errno", "libc", "linux-raw-sys 0.4.15", @@ -3435,11 +2586,11 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -3458,7 +2609,7 @@ dependencies = [ "encoding_rs", "encoding_rs_io", "generational-arena", - "indexmap 2.11.4", + "indexmap 2.12.1", "inkwell", "insta", "itertools", @@ -3486,7 +2637,7 @@ dependencies = [ "tabled", "tempfile", "test_utils", - "toml", + "toml 0.5.11", "which", ] @@ -3496,15 +2647,6 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "scc" version = "2.4.0" @@ -3520,7 +2662,7 @@ version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -3548,7 +2690,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "core-foundation", "core-foundation-sys", "libc", @@ -3596,9 +2738,9 @@ version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -3615,13 +2757,11 @@ dependencies = [ ] [[package]] -name = "serde_path_to_error" -version = "0.1.20" +name = "serde_spanned" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" dependencies = [ - "itoa", - "serde", "serde_core", ] @@ -3657,9 +2797,9 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -3686,9 +2826,9 @@ dependencies = [ [[package]] name = "shell-words" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" [[package]] name = "shlex" @@ -3703,7 +2843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3712,12 +2852,6 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - [[package]] name = "slab" version = "0.4.11" @@ -3755,12 +2889,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -3815,7 +2949,7 @@ dependencies = [ "futures-util", "hashbrown 0.15.5", "hashlink", - "indexmap 2.11.4", + "indexmap 2.12.1", "log", "memchr", "native-tls", @@ -3836,11 +2970,11 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "sqlx-core", "sqlx-macros-core", - "syn 2.0.106", + "syn 2.0.111", ] [[package]] @@ -3855,8 +2989,8 @@ dependencies = [ "heck 0.5.0", "hex", "once_cell", - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "serde", "serde_json", "sha2", @@ -3864,7 +2998,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.106", + "syn 2.0.111", "url", ] @@ -3876,7 +3010,7 @@ checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.9.4", + "bitflags 2.10.0", "byteorder", "bytes", "crc", @@ -3897,7 +3031,7 @@ dependencies = [ "memchr", "once_cell", "percent-encoding", - "rand 0.8.5", + "rand", "rsa", "serde", "sha1", @@ -3918,7 +3052,7 @@ checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" dependencies = [ "atoi", "base64 0.22.1", - "bitflags 2.9.4", + "bitflags 2.10.0", "byteorder", "crc", "dotenvy", @@ -3935,7 +3069,7 @@ dependencies = [ "md-5", "memchr", "once_cell", - "rand 0.8.5", + "rand", "serde", "serde_json", "sha2", @@ -3973,34 +3107,9 @@ dependencies = [ [[package]] name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "string_cache" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared", - "precomputed-hash", - "serde", -] - -[[package]] -name = "string_cache_codegen" -version = "0.5.4" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2 1.0.101", - "quote 1.0.41", -] +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stringprep" @@ -4048,19 +3157,19 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.106" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", + "proc-macro2 1.0.103", + "quote 1.0.42", "unicode-ident", ] @@ -4070,21 +3179,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" - [[package]] name = "synstructure" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -4142,9 +3245,9 @@ checksum = "0ea5d1b13ca6cff1f9231ffd62f15eefd72543dab5e468735f1a456728a02846" dependencies = [ "heck 0.5.0", "proc-macro-error2", - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -4154,21 +3257,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand 2.3.0", - "getrandom 0.3.3", + "getrandom 0.3.4", "once_cell", "rustix 1.1.2", - "windows-sys 0.61.1", -] - -[[package]] -name = "tendril" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" -dependencies = [ - "futf", - "mac", - "utf-8", + "windows-sys 0.61.2", ] [[package]] @@ -4180,16 +3272,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" -dependencies = [ - "rustix 1.1.2", - "windows-sys 0.60.2", -] - [[package]] name = "test_utils" version = "0.1.0" @@ -4212,7 +3294,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f8daae29995a24f65619e19d8d31dea5b389f3d853d8bf297bbf607cd0014cc" dependencies = [ - "unicode-width 0.2.1", + "unicode-width 0.2.2", ] [[package]] @@ -4236,9 +3318,9 @@ version = "2.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -4273,9 +3355,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -4298,50 +3380,23 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.47.1" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", "mio", "pin-project-lite", - "slab", - "socket2 0.6.0", - "tokio-macros", - "windows-sys 0.59.0", -] - -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite", + "socket2 0.6.1", + "windows-sys 0.61.2", ] [[package]] name = "tokio-util" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" dependencies = [ "bytes", "futures-core", @@ -4360,58 +3415,43 @@ dependencies = [ ] [[package]] -name = "topological-sort" -version = "0.2.2" +name = "toml" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" +checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +dependencies = [ + "indexmap 2.12.1", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] [[package]] -name = "tower" -version = "0.5.2" +name = "toml_datetime" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper 1.0.2", - "tokio", - "tower-layer", - "tower-service", - "tracing", + "serde_core", ] [[package]] -name = "tower-http" -version = "0.6.6" +name = "toml_parser" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" dependencies = [ - "bitflags 2.9.4", - "bytes", - "futures-core", - "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", + "winnow", ] [[package]] -name = "tower-layer" -version = "0.3.3" +name = "toml_writer" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" [[package]] name = "tower-service" @@ -4421,9 +3461,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" dependencies = [ "log", "pin-project-lite", @@ -4433,20 +3473,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" dependencies = [ "once_cell", ] @@ -4457,40 +3497,11 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tungstenite" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8628dcc84e5a09eb3d8423d6cb682965dea9133204e8fb3efee74c2a0c259442" -dependencies = [ - "bytes", - "data-encoding", - "http 1.3.1", - "httparse", - "log", - "rand 0.9.2", - "sha1", - "thiserror", - "utf-8", -] - [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - -[[package]] -name = "unicase" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unicode-bidi" @@ -4500,24 +3511,24 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-normalization" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" [[package]] name = "unicode-width" @@ -4527,9 +3538,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -4549,17 +3560,11 @@ dependencies = [ "serde", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8-width" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +checksum = "1292c0d970b54115d14f2492fe0170adf21d68a1de108eebc51c1df4f346a091" [[package]] name = "utf8_iter" @@ -4575,9 +3580,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ "js-sys", "wasm-bindgen", @@ -4585,9 +3590,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" +checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" [[package]] name = "vcpkg" @@ -4607,16 +3612,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "want" version = "0.3.1" @@ -4632,15 +3627,6 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" -[[package]] -name = "wasi" -version = "0.14.7+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" -dependencies = [ - "wasip2", -] - [[package]] name = "wasip2" version = "1.0.1+wasi-0.2.4" @@ -4658,9 +3644,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.104" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", @@ -4669,25 +3655,11 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" -dependencies = [ - "bumpalo", - "log", - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", - "wasm-bindgen-shared", -] - [[package]] name = "wasm-bindgen-futures" -version = "0.4.54" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -4698,58 +3670,46 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.104" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ - "quote 1.0.41", + "quote 1.0.42", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.104" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", - "wasm-bindgen-backend", + "bumpalo", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.104" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.81" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "web_atoms" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ffde1dc01240bdf9992e3205668b235e59421fd085e8a317ed98da0178d414" -dependencies = [ - "phf", - "phf_codegen", - "string_cache", - "string_cache_codegen", -] - [[package]] name = "which" version = "4.4.2" @@ -4794,7 +3754,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.1", + "windows-sys 0.61.2", ] [[package]] @@ -4805,9 +3765,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.62.1" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6844ee5416b285084d3d3fffd743b925a6c9385455f64f6d4fa3031c4c2749a9" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", @@ -4818,46 +3778,46 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.60.1" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb307e42a74fb6de9bf3a02d9712678b22399c87e6fa869d6dfcd8c1b7754e0" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] name = "windows-interface" -version = "0.59.2" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0abd1ddbc6964ac14db11c7213d6532ef34bd9aa042c2e5935f59d7908b46a5" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] name = "windows-link" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-result" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ "windows-link", ] @@ -4895,14 +3855,14 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.4", + "windows-targets 0.53.5", ] [[package]] name = "windows-sys" -version = "0.61.1" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f109e41dd4a3c848907eb83d5a42ea98b3769495597450cf6d153507b166f0f" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ] @@ -4940,19 +3900,19 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.4" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d42b7b7f66d2a06854650af09cfdf8713e427a439c97ad65a6375318033ac4b" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ "windows-link", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -4969,9 +3929,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -4987,9 +3947,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -5005,9 +3965,9 @@ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" @@ -5017,9 +3977,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -5035,9 +3995,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -5053,9 +4013,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -5071,9 +4031,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -5089,9 +4049,15 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" [[package]] name = "winreg" @@ -5111,9 +4077,9 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "xshell" @@ -5136,7 +4102,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-std", - "clap 4.5.48", + "clap 4.5.53", "plc_ast", "plc_source", "rusty", @@ -5156,11 +4122,10 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -5168,34 +4133,34 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] [[package]] @@ -5213,9 +4178,9 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", "synstructure", ] @@ -5227,9 +4192,9 @@ checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" dependencies = [ "displaydoc", "yoke", @@ -5238,9 +4203,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -5249,11 +4214,11 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ - "proc-macro2 1.0.101", - "quote 1.0.41", - "syn 2.0.106", + "proc-macro2 1.0.103", + "quote 1.0.42", + "syn 2.0.111", ] diff --git a/Cargo.toml b/Cargo.toml index 627bd1cba5f..afc82b1fb3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,8 +83,13 @@ members = [ default-members = [".", "compiler/plc_driver", "compiler/plc_xml"] [workspace.dependencies] +# TODO: Version 0.7 and LLVM 21 are incompatible because of https://github.com/TheDan64/inkwell/pull/628. +# We should however move to 0.8 once released, and remove the git version dependency +inkwell = { git = "https://github.com/TheDan64/inkwell.git", rev = "7abf48a2cf4fc3e338fbeb1780ac7507cbb13e98", features = [ + "llvm21-1", +] } + insta = { version = "1.31.0", features = ["filters"] } -inkwell = { version = "0.7", features = ["llvm21-1"] } encoding_rs = "0.8" encoding_rs_io = "0.1" log = "0.4" diff --git a/book/book.toml b/book/book.toml index 6ccd7fa018f..a1eb13d7fa1 100644 --- a/book/book.toml +++ b/book/book.toml @@ -1,7 +1,6 @@ [book] authors = ["Ghaith Hachem", "Mathias Rieder", "Alexander Ulmer"] language = "en" -multilingual = false src = "src" title = "RuSTy User Documentation" [output.html] diff --git a/errorcode_book_generator/Cargo.toml b/errorcode_book_generator/Cargo.toml index 2fabcd6e7f0..390334a44ee 100644 --- a/errorcode_book_generator/Cargo.toml +++ b/errorcode_book_generator/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] clap = "4.5.4" -mdbook = "0.4.37" +mdbook-preprocessor = "0.5" semver = "1.0.22" serde_json.workspace = true toml.workspace = true diff --git a/errorcode_book_generator/src/main.rs b/errorcode_book_generator/src/main.rs index 8542f03106f..55001850586 100644 --- a/errorcode_book_generator/src/main.rs +++ b/errorcode_book_generator/src/main.rs @@ -1,11 +1,10 @@ use std::{fs, io, path::PathBuf, str::FromStr}; use clap::{Arg, Command}; -use mdbook::{ - book::Chapter, +use mdbook_preprocessor::{ + book::{BookItem, Chapter}, errors::Error, - preprocess::{CmdPreprocessor, Preprocessor}, - BookItem, + parse_input, Preprocessor, PreprocessorContext, MDBOOK_VERSION, }; use semver::{Version, VersionReq}; use toml::Value; @@ -35,17 +34,17 @@ fn main() { } fn handle_preprocessing(preprocessor: &ErrorCodeGenerator) -> Result<(), Error> { - let (ctx, book) = CmdPreprocessor::parse_input(io::stdin())?; + let (ctx, book) = parse_input(io::stdin())?; let book_version = Version::parse(&ctx.mdbook_version)?; - let version_req = VersionReq::parse(mdbook::MDBOOK_VERSION)?; + let version_req = VersionReq::parse(MDBOOK_VERSION)?; if !version_req.matches(&book_version) { eprintln!( "Warning: The {} plugin was built against version {} of mdbook, \ but we're being called from version {}", preprocessor.name(), - mdbook::MDBOOK_VERSION, + MDBOOK_VERSION, ctx.mdbook_version ); } @@ -58,7 +57,7 @@ fn handle_preprocessing(preprocessor: &ErrorCodeGenerator) -> Result<(), Error> fn handle_supports(preprocessor: &dyn Preprocessor, sub_args: &clap::ArgMatches) -> ! { let renderer = sub_args.get_one::("renderer").expect("Required argument"); - let supported = preprocessor.supports_renderer(renderer); + let supported = preprocessor.supports_renderer(renderer).unwrap_or(true); if supported { std::process::exit(0); @@ -77,12 +76,14 @@ impl Preprocessor for ErrorCodeGenerator { fn run( &self, - ctx: &mdbook::preprocess::PreprocessorContext, - mut book: mdbook::book::Book, - ) -> mdbook::errors::Result { + ctx: &PreprocessorContext, + mut book: mdbook_preprocessor::book::Book, + ) -> mdbook_preprocessor::errors::Result { //Get a config location on where to read the errors from //Get a config location on where to place the error chapters in the book - let preprocessor = ctx.config.get_preprocessor(self.name()).expect("Preprocessor configured"); + let preprocessors: std::collections::BTreeMap = + ctx.config.preprocessors().expect("Preprocessors configured"); + let preprocessor = preprocessors.get(self.name()).expect("Preprocessor configured"); let Some((source, target)) = preprocessor .get("err_location") .and_then(Value::as_str) diff --git a/tests/lit/lit.cfg b/tests/lit/lit.cfg index 4dfedc3eba3..79b8ff5f3ce 100644 --- a/tests/lit/lit.cfg +++ b/tests/lit/lit.cfg @@ -17,4 +17,4 @@ print(f'Compile command: {compile}') config.substitutions.append(('%COMPILE', f'{compile}')) config.substitutions.append(('%RUN', f'LD_LIBRARY_PATH="{stdlibLocation}/lib" /tmp/%basename_t.out')) -config.substitutions.append(('%CHECK', f'FileCheck-15 --check-prefixes CHECK --allow-unused-prefixes --match-full-lines')) +config.substitutions.append(('%CHECK', f'FileCheck-21 --check-prefixes CHECK --allow-unused-prefixes --match-full-lines'))