diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-11 04:06:07 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-11 04:06:07 -0500 |
| commit | 8fcb1a141b1f76a0c6b28338723535ec5fbf638b (patch) | |
| tree | 6789b38ce297bedeb60e15446a5980bc3da18574 /src/analyze.cpp | |
| parent | 10cea15cc3061272a0ed05fafe9e762f6454fafc (diff) | |
| download | zig-8fcb1a141b1f76a0c6b28338723535ec5fbf638b.tar.gz zig-8fcb1a141b1f76a0c6b28338723535ec5fbf638b.zip | |
IR: implement fence and cmpxchg builtins
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index d0ba3f9972..3782d0a3e2 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -2798,3 +2798,14 @@ ConstExprValue *create_const_float(double value) { init_const_float(const_val, value); return const_val; } + +void init_const_enum_tag(ConstExprValue *const_val, uint64_t tag) { + const_val->special = ConstValSpecialStatic; + const_val->data.x_enum.tag = tag; +} + +ConstExprValue *create_const_enum_tag(uint64_t tag) { + ConstExprValue *const_val = allocate<ConstExprValue>(1); + init_const_enum_tag(const_val, tag); + return const_val; +} |
