aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-08-20 15:38:36 -0700
committerGitHub <noreply@github.com>2023-08-20 15:38:36 -0700
commit411462e1cdac518ccb67a8dd7aa5ef93332f8d19 (patch)
tree06759e2ef15cdb58bda051fe0ca17f013ba41f6b /src/codegen
parent020105d0dde614538a5839ede697e63a43bf6aa6 (diff)
parent4ac20f69acd446e6d9ac59f1fc4172147c05559e (diff)
downloadzig-411462e1cdac518ccb67a8dd7aa5ef93332f8d19.tar.gz
zig-411462e1cdac518ccb67a8dd7aa5ef93332f8d19.zip
Merge pull request #16875 from mlugg/astgen-rl-pass
AstGen: add result location analysis pass
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/c.zig2
-rw-r--r--src/codegen/llvm/Builder.zig8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index bea3c02985..330a9b33e8 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -4285,7 +4285,7 @@ fn airBlock(f: *Function, inst: Air.Inst.Index) !CValue {
const writer = f.object.writer();
const inst_ty = f.typeOfIndex(inst);
- const result = if (inst_ty.ip_index != .void_type and !f.liveness.isUnused(inst))
+ const result = if (inst_ty.hasRuntimeBitsIgnoreComptime(mod) and !f.liveness.isUnused(inst))
try f.allocLocal(inst, inst_ty)
else
.none;
diff --git a/src/codegen/llvm/Builder.zig b/src/codegen/llvm/Builder.zig
index 9632beef3a..00b3826d7d 100644
--- a/src/codegen/llvm/Builder.zig
+++ b/src/codegen/llvm/Builder.zig
@@ -10092,8 +10092,8 @@ fn vectorTypeAssumeCapacity(
.data = self.addTypeExtraAssumeCapacity(data),
});
if (self.useLibLlvm()) self.llvm.types.appendAssumeCapacity(switch (kind) {
- .normal => llvm.Type.vectorType,
- .scalable => llvm.Type.scalableVectorType,
+ .normal => &llvm.Type.vectorType,
+ .scalable => &llvm.Type.scalableVectorType,
}(child.toLlvm(self), @intCast(len)));
}
return @enumFromInt(gop.index);
@@ -11274,8 +11274,8 @@ fn gepConstAssumeCapacity(
for (llvm_indices, indices) |*llvm_index, index| llvm_index.* = index.toLlvm(self);
self.llvm.constants.appendAssumeCapacity(switch (kind) {
- .normal => llvm.Type.constGEP,
- .inbounds => llvm.Type.constInBoundsGEP,
+ .normal => &llvm.Type.constGEP,
+ .inbounds => &llvm.Type.constInBoundsGEP,
}(ty.toLlvm(self), base.toLlvm(self), llvm_indices.ptr, @intCast(llvm_indices.len)));
}
}