aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-08-25 20:52:35 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-08-29 22:14:10 -0700
commit6e6d138c2f50f95fe9c6b4acbc16ffa17475a4a5 (patch)
treef89b50b2a9f57c9149b555240e2e9a2fc760c6b8 /src/codegen.cpp
parent651dc31247c2f637925ed6a6e92c8bc1a19efd5c (diff)
downloadzig-6e6d138c2f50f95fe9c6b4acbc16ffa17475a4a5.tar.gz
zig-6e6d138c2f50f95fe9c6b4acbc16ffa17475a4a5.zip
add ability to explicitly cast enum with no payload to int
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 82f7084159..bf13ba3036 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -1062,6 +1062,8 @@ static LLVMValueRef gen_cast_expr(CodeGen *g, AstNode *node) {
case CastOpIntToEnum:
return gen_widen_or_shorten(g, node, actual_type, wanted_type->data.enumeration.tag_type, expr_val);
+ case CastOpEnumToInt:
+ return gen_widen_or_shorten(g, node, actual_type->data.enumeration.tag_type, wanted_type, expr_val);
}
zig_unreachable();
}