aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-06-18 21:25:03 -0400
committerGitHub <noreply@github.com>2020-06-18 21:25:03 -0400
commitc70633eacdf4e17cfafe0ab44f4ea83323b6d7a3 (patch)
tree8154639afe68f601754de51366af3a6c817eb558 /src/analyze.cpp
parentb9e3df92db1b5cb137d880a7612b6ee2e7e1f60e (diff)
parenta62e9bc8e50296e2d5b201614a78b0e658887aa9 (diff)
downloadzig-c70633eacdf4e17cfafe0ab44f4ea83323b6d7a3.tar.gz
zig-c70633eacdf4e17cfafe0ab44f4ea83323b6d7a3.zip
Merge pull request #5203 from tadeokondrak/@type-for-even-more-types
implement @typeInfo for Frame and implement @Type for Frame, EnumLiteral, and ErrorSet
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 9062c1fb13..542fbb56ce 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -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;