diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-03-25 23:08:59 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-03-26 13:48:06 +0000 |
| commit | 5ec6e3036b2772e6efc08726b22c560dedd556bc (patch) | |
| tree | 9c4625688ff540c0cd9bece36bef96276da08842 /src/Module.zig | |
| parent | c6f3e9d79cf849623e6c4f25e02e17cdfab07b7c (diff) | |
| download | zig-5ec6e3036b2772e6efc08726b22c560dedd556bc.tar.gz zig-5ec6e3036b2772e6efc08726b22c560dedd556bc.zip | |
Sema: introduce separate `MutableValue` representation for comptime-mutable memory
Perhaps someday, we will make Sema operate on mutable values more
generally. For now, it makes sense to split out this representation,
since it is only used in comptime pointer accesses.
There are some currently unused methods on `MutableValue` which will
be used once I rewrite the comptime pointer access logic to be less
terrible.
The commit following this one will - at long last - delete the legacy
Value representation
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig index 9cbb2cc89a..a11194c103 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -3598,7 +3598,7 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !SemaDeclResult { const old_has_tv = decl.has_tv; // The following values are ignored if `!old_has_tv` - const old_ty = decl.typeOf(mod); + const old_ty = if (old_has_tv) decl.typeOf(mod) else undefined; const old_val = decl.val; const old_align = decl.alignment; const old_linksection = decl.@"linksection"; |
