Commit e2e0054a authored by Rico Tzschichholz's avatar Rico Tzschichholz

codegen: Add boolean "use_inplace" ccode-attribute for methods

This can be use to avoid temp-variables for an expanding macro.

https://bugzilla.gnome.org/show_bug.cgi?id=750840
parent 1eb5044f
......@@ -803,6 +803,8 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
if (m != null && m.get_format_arg_index () >= 0) {
set_cvalue (expr, ccall_expr);
} else if (m != null && m.get_attribute_bool ("CCode", "use_inplace", false)) {
set_cvalue (expr, ccall_expr);
} else if (!return_result_via_out_param) {
var temp_var = get_temp_variable (result_type, result_type.value_owned, null, false);
var temp_ref = get_variable_cexpression (temp_var.name);
......
......@@ -39,7 +39,8 @@ public class Vala.UsedAttr : CodeVisitor {
"has_copy_function", "lower_case_csuffix", "ref_sink_function", "dup_function", "finish_function", "generic_type_pos",
"array_length_type", "array_length", "array_length_cname", "array_length_cexpr", "array_null_terminated",
"vfunc_name", "finish_vfunc_name", "finish_name", "free_function_address_of", "pos", "delegate_target", "delegate_target_cname",
"array_length_pos", "delegate_target_pos", "destroy_notify_pos", "ctype", "has_new_function", "notify", "finish_instance", "",
"array_length_pos", "delegate_target_pos", "destroy_notify_pos", "ctype", "has_new_function", "notify", "finish_instance",
"use_inplace", "",
"Immutable", "",
"Compact", "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment