aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-12-13 03:09:24 +0100
committerGitHub <noreply@github.com>2024-12-13 03:09:24 +0100
commit130f7c2ed8e3358e24bb2fc7cca57f7a6f1f85c3 (patch)
treeebb88312b13fb8b1e67b852bcb0e42903ad11193 /src/codegen/llvm.zig
parentd48611ba67c7871cb348f28a01b89d8771170dd8 (diff)
parentc666ebb1f8aac440a4d0d554e9f8aa836bf58060 (diff)
downloadzig-130f7c2ed8e3358e24bb2fc7cca57f7a6f1f85c3.tar.gz
zig-130f7c2ed8e3358e24bb2fc7cca57f7a6f1f85c3.zip
Merge pull request #22035 from alexrp/unwind-fixes
Better unwind table support + unwind protection in `_start()` and `clone()`
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index ff1e679898..b94ea07995 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -3141,8 +3141,11 @@ pub const Object = struct {
} }, &o.builder);
}
try attributes.addFnAttr(.nounwind, &o.builder);
- if (owner_mod.unwind_tables) {
- try attributes.addFnAttr(.{ .uwtable = Builder.Attribute.UwTable.default }, &o.builder);
+ if (owner_mod.unwind_tables != .none) {
+ try attributes.addFnAttr(
+ .{ .uwtable = if (owner_mod.unwind_tables == .@"async") .@"async" else .sync },
+ &o.builder,
+ );
}
if (owner_mod.no_builtin) {
// The intent here is for compiler-rt and libc functions to not generate