aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorDavid Rubin <daviru007@icloud.com>2024-05-29 17:36:53 -0700
committerDavid Rubin <daviru007@icloud.com>2024-07-14 23:02:32 -0700
commit0460572899482f7aa7ec6d9d177ed48984802c80 (patch)
tree027b9132b140fbfde4f0d7b3344a84c02b8699ab /src/codegen.zig
parentea084e9519a8e6f14d1bcb5f1fb2cddf842333b6 (diff)
downloadzig-0460572899482f7aa7ec6d9d177ed48984802c80.tar.gz
zig-0460572899482f7aa7ec6d9d177ed48984802c80.zip
riscv: `@atomicRmw`
Now we generate debug undefined constants when the user asks for them to dedup across the function decl. This takes 2 instructions instead of 7 in the RISC-V backend. TODO, we need to dedupe across function decl boundaries.
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index 9e0f4db305..1658f63616 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -987,8 +987,9 @@ pub fn genTypedValue(
log.debug("genTypedValue: val = {}", .{val.fmtValue(pt, null)});
- if (val.isUndef(zcu))
+ if (val.isUndef(zcu)) {
return GenResult.mcv(.undef);
+ }
const owner_decl = zcu.declPtr(owner_decl_index);
const namespace = zcu.namespacePtr(owner_decl.src_namespace);