aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-04-07 15:34:13 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-04-07 15:35:38 -0400
commitf7e9d7aa5d115a6a8158625cd1aceb7e8dafe880 (patch)
treea6a7ef8030a4b44d4b87b8e04fe7002c006ce381 /src/codegen.cpp
parentffb4852012509327c646c9899259e894965b2259 (diff)
downloadzig-f7e9d7aa5d115a6a8158625cd1aceb7e8dafe880.tar.gz
zig-f7e9d7aa5d115a6a8158625cd1aceb7e8dafe880.zip
ability to implicitly cast integer literal to &const Int
where Int is an integer type also introduce `@intToPtr` builtin for converting a usize to a pointer. users now have to use this instead of `(&T)(int)`. closes #311
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 8bc204caea..edd2cd181e 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -4326,6 +4326,7 @@ static void define_builtin_fns(CodeGen *g) {
create_builtin_fn(g, BuiltinFnIdSetGlobalLinkage, "setGlobalLinkage", 2);
create_builtin_fn(g, BuiltinFnIdPanic, "panic", 1);
create_builtin_fn(g, BuiltinFnIdPtrCast, "ptrcast", 2);
+ create_builtin_fn(g, BuiltinFnIdIntToPtr, "intToPtr", 2);
}
static void add_compile_var(CodeGen *g, const char *name, ConstExprValue *value) {