Add support for specifying whether a type allows lvalue access or not by
using the lvalue_access argument of the CCode attribute.
return get_cvalue (node);
}
+ public bool is_lvalue_access_allowed (DataType type) {
+ var array_type = type as ArrayType;
+ if (array_type != null && array_type.inline_allocated) {
+ return false;
+ }
+ if (type.data_type != null) {
+ var a = type.data_type.get_attribute ("CCode");
+ if (a != null && a.has_argument ("lvalue_access")) {
+ return a.get_bool ("lvalue_access");
+ }
+ }
+ return true;
+ }
+
public override void visit_class (Class cl) {
}
}
result.value_type.value_owned = false;
- if (!(variable is Parameter && variable.name == "this") && !(array_type != null && array_type.inline_allocated)) {
+ if (!(variable is Parameter && variable.name == "this") && is_lvalue_access_allowed (result.value_type)) {
result = (GLibValue) store_temp_value (result, variable);
}