Merge pull request #5203 from tadeokondrak/@type-for-even-more-types

implement @typeInfo for Frame and implement @Type for Frame, EnumLiteral, and ErrorSet
This commit is contained in:
Andrew Kelley
2020-06-18 21:25:03 -04:00
committed by GitHub
7 changed files with 171 additions and 23 deletions

View File

@@ -6012,6 +6012,19 @@ ZigValue *create_const_null(CodeGen *g, ZigType *type) {
return const_val;
}
void init_const_fn(ZigValue *const_val, ZigFn *fn) {
const_val->special = ConstValSpecialStatic;
const_val->type = fn->type_entry;
const_val->data.x_ptr.special = ConstPtrSpecialFunction;
const_val->data.x_ptr.data.fn.fn_entry = fn;
}
ZigValue *create_const_fn(CodeGen *g, ZigFn *fn) {
ZigValue *const_val = g->pass1_arena->create<ZigValue>();
init_const_fn(const_val, fn);
return const_val;
}
void init_const_float(ZigValue *const_val, ZigType *type, double value) {
const_val->special = ConstValSpecialStatic;
const_val->type = type;