aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-08-11 13:59:34 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-08-12 10:48:54 -0700
commit6eecc4af99e2affc44d153e5f127200f2adf4642 (patch)
tree736bf309197456d46eb3a5e3a44c011ac1726fb0 /src/codegen/llvm.zig
parenta0670e748ec4914f7fc198422d0815e71e90a54f (diff)
downloadzig-6eecc4af99e2affc44d153e5f127200f2adf4642.tar.gz
zig-6eecc4af99e2affc44d153e5f127200f2adf4642.zip
stage2 llvm backend: implement const inttoptr
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 7cfbc8da5e..4f9a24f80c 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -768,6 +768,11 @@ pub const DeclGen = struct {
};
return self.context.constStruct(&fields, fields.len, .False);
},
+ .int_u64 => {
+ const llvm_usize = try self.llvmType(Type.initTag(.usize));
+ const llvm_int = llvm_usize.constInt(tv.val.toUnsignedInt(), .False);
+ return llvm_int.constIntToPtr(try self.llvmType(tv.ty));
+ },
else => |tag| return self.todo("implement const of pointer type '{}' ({})", .{ tv.ty, tag }),
},
.Array => {