bool ast_generate_accessors(ast_value *self, ir_builder *ir)
{
size_t i;
+ bool warn = OPTS_WARN(WARN_USED_UNINITIALIZED);
if (!self->setter || !self->getter)
return true;
for (i = 0; i < self->expression.count; ++i) {
return false;
}
}
+
+ options_set(opts_warn, WARN_USED_UNINITIALIZED, false);
if (self->setter) {
if (!ast_global_codegen (self->setter, ir, false) ||
!ast_function_codegen(self->setter->constval.vfunc, ir) ||
!ir_function_finalize(self->setter->constval.vfunc->ir_func))
{
compile_error(ast_ctx(self), "internal error: failed to generate setter for `%s`", self->name);
+ options_set(opts_warn, WARN_USED_UNINITIALIZED, warn);
return false;
}
}
!ir_function_finalize(self->getter->constval.vfunc->ir_func))
{
compile_error(ast_ctx(self), "internal error: failed to generate getter for `%s`", self->name);
+ options_set(opts_warn, WARN_USED_UNINITIALIZED, warn);
return false;
}
}
+ for (i = 0; i < self->expression.count; ++i) {
+ vec_free(self->ir_values[i]->life);
+ }
+ options_set(opts_warn, WARN_USED_UNINITIALIZED, warn);
return true;
}
extern uint32_t opts_warn [1 + (COUNT_WARNINGS / 32)];
extern uint32_t opts_optimization[1 + (COUNT_OPTIMIZATIONS / 32)];
+void options_set(uint32_t *flags, size_t idx, bool on);
+
#endif
return options_long_witharg_all(optname, argc_, argv_, out, 1, false);
}
-static void options_set(uint32_t *flags, size_t idx, bool on)
+void options_set(uint32_t *flags, size_t idx, bool on)
{
longbit lb = LONGBIT(idx);
#if 0