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
This commit is contained in:
mlugg
2024-03-25 23:08:59 +00:00
parent c6f3e9d79c
commit 5ec6e3036b
4 changed files with 733 additions and 440 deletions

View File

@@ -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";