aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted/value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-27 13:38:49 -0500
committerGitHub <noreply@github.com>2019-11-27 13:38:49 -0500
commit83c664eaa080669cff83f7c30046376f3399eafb (patch)
tree06cccc09052be4459e924d04a867ff34a889d87c /src-self-hosted/value.zig
parent63300a21ddf4cfe209a39796c6d7ea7773e14fd6 (diff)
parent4d8a8e65df79ddd5edf52f961552036ccfca6e8e (diff)
downloadzig-83c664eaa080669cff83f7c30046376f3399eafb.tar.gz
zig-83c664eaa080669cff83f7c30046376f3399eafb.zip
Merge pull request #3780 from Vexu/stage2-async-review
Update use of async functions in self hosted compiler
Diffstat (limited to 'src-self-hosted/value.zig')
-rw-r--r--src-self-hosted/value.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src-self-hosted/value.zig b/src-self-hosted/value.zig
index 0458bac12a..accd70d9cc 100644
--- a/src-self-hosted/value.zig
+++ b/src-self-hosted/value.zig
@@ -156,7 +156,7 @@ pub const Value = struct {
const llvm_fn_type = try self.base.typ.getLlvmType(ofile.arena, ofile.context);
const llvm_fn = llvm.AddFunction(
ofile.module,
- self.symbol_name.ptr(),
+ self.symbol_name.toSliceConst(),
llvm_fn_type,
) orelse return error.OutOfMemory;
@@ -241,7 +241,7 @@ pub const Value = struct {
const llvm_fn_type = try self.base.typ.getLlvmType(ofile.arena, ofile.context);
const llvm_fn = llvm.AddFunction(
ofile.module,
- self.symbol_name.ptr(),
+ self.symbol_name.toSliceConst(),
llvm_fn_type,
) orelse return error.OutOfMemory;
@@ -334,7 +334,7 @@ pub const Value = struct {
field_index: usize,
};
- pub async fn createArrayElemPtr(
+ pub fn createArrayElemPtr(
comp: *Compilation,
array_val: *Array,
mut: Type.Pointer.Mut,
@@ -350,7 +350,7 @@ pub const Value = struct {
.mut = mut,
.vol = Type.Pointer.Vol.Non,
.size = size,
- .alignment = Type.Pointer.Align.Abi,
+ .alignment = .Abi,
});
var ptr_type_consumed = false;
errdefer if (!ptr_type_consumed) ptr_type.base.base.deref(comp);
@@ -390,13 +390,13 @@ pub const Value = struct {
const array_llvm_value = (try base_array.val.getLlvmConst(ofile)).?;
const ptr_bit_count = ofile.comp.target_ptr_bits;
const usize_llvm_type = llvm.IntTypeInContext(ofile.context, ptr_bit_count) orelse return error.OutOfMemory;
- const indices = [_]*llvm.Value{
+ var indices = [_]*llvm.Value{
llvm.ConstNull(usize_llvm_type) orelse return error.OutOfMemory,
llvm.ConstInt(usize_llvm_type, base_array.elem_index, 0) orelse return error.OutOfMemory,
};
return llvm.ConstInBoundsGEP(
array_llvm_value,
- &indices,
+ @ptrCast([*]*llvm.Value, &indices),
@intCast(c_uint, indices.len),
) orelse return error.OutOfMemory;
},
@@ -423,7 +423,7 @@ pub const Value = struct {
};
/// Takes ownership of buffer
- pub async fn createOwnedBuffer(comp: *Compilation, buffer: []u8) !*Array {
+ pub fn createOwnedBuffer(comp: *Compilation, buffer: []u8) !*Array {
const u8_type = Type.Int.get_u8(comp);
defer u8_type.base.base.deref(comp);