aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-07-19 11:31:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-07-19 11:31:37 -0700
commitfe8c3ffeb1c6cfb1cc0b7a81e433add3c57b2337 (patch)
treedeb8a54263d2b2fe565634477859e9b15cf95b7b /src/codegen
parent74fb65fb424a0fbb2eb00109fe4cee17aa2646c2 (diff)
downloadzig-fe8c3ffeb1c6cfb1cc0b7a81e433add3c57b2337.tar.gz
zig-fe8c3ffeb1c6cfb1cc0b7a81e433add3c57b2337.zip
LLVM: change commentary on isByRef
This branch originally started out as a potential workaround to address #11450. It did not solve that problem, however, it did end up fixing #11498!
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 992ea0ff45..53c97c880f 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -9356,11 +9356,11 @@ fn ccAbiPromoteInt(
return null;
}
+/// This is the one source of truth for whether a type is passed around as an LLVM pointer,
+/// or as an LLVM value.
fn isByRef(ty: Type) bool {
// For tuples and structs, if there are more than this many non-void
// fields, then we make it byref, otherwise byval.
- // TODO we actually want to set this to 2, however it is tripping an LLVM 14 regression:
- // https://github.com/llvm/llvm-project/issues/56585
const max_fields_byval = 0;
switch (ty.zigTypeTag()) {
@@ -9421,10 +9421,6 @@ fn isByRef(ty: Type) bool {
return false;
}
return true;
- // TODO we actually want this logic:
- // however it is tripping an LLVM 14 regression:
- // https://github.com/llvm/llvm-project/issues/56585
- //return isByRef(payload_ty);
},
.Optional => {
var buf: Type.Payload.ElemType = undefined;
@@ -9436,10 +9432,6 @@ fn isByRef(ty: Type) bool {
return false;
}
return true;
- // TODO we actually want this logic:
- // however it is tripping an LLVM 14 regression:
- // https://github.com/llvm/llvm-project/issues/56585
- //return isByRef(payload_ty);
},
}
}