aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-17 15:29:59 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-05-17 16:09:20 -0700
commit3d99fb3352eca9da68b6033ad22a166ed68ed36a (patch)
tree3d9a3be8f28f178ea43416d611c1604c0f8cfdb9
parentd5e894a9a7c63ebbfaa3c4eb6d173e15745ad39c (diff)
downloadzig-3d99fb3352eca9da68b6033ad22a166ed68ed36a.tar.gz
zig-3d99fb3352eca9da68b6033ad22a166ed68ed36a.zip
stage2: get rid of DeclRef
-rw-r--r--BRANCH_TODO1
-rw-r--r--src/Module.zig16
2 files changed, 0 insertions, 17 deletions
diff --git a/BRANCH_TODO b/BRANCH_TODO
index f1981b6236..e9d2e26a9f 100644
--- a/BRANCH_TODO
+++ b/BRANCH_TODO
@@ -3,7 +3,6 @@
their indexes starting at 0 so that we can use an array to store Sema
results rather than a map.
- * get rid of Scope.DeclRef
* get rid of NameHash
* handle decl collision with usingnamespace
* the decl doing the looking up needs to create a decl dependency
diff --git a/src/Module.zig b/src/Module.zig
index 6dc0b2a256..afa29d65fd 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -812,7 +812,6 @@ pub const Scope = struct {
.block => scope.cast(Block).?.sema.owner_decl,
.file => null,
.namespace => null,
- .decl_ref => scope.cast(DeclRef).?.decl,
};
}
@@ -821,7 +820,6 @@ pub const Scope = struct {
.block => scope.cast(Block).?.src_decl,
.file => null,
.namespace => scope.cast(Namespace).?.getDecl(),
- .decl_ref => scope.cast(DeclRef).?.decl,
};
}
@@ -831,7 +829,6 @@ pub const Scope = struct {
.block => return scope.cast(Block).?.sema.owner_decl.namespace,
.file => return scope.cast(File).?.root_decl.?.namespace,
.namespace => return scope.cast(Namespace).?,
- .decl_ref => return scope.cast(DeclRef).?.decl.namespace,
}
}
@@ -854,7 +851,6 @@ pub const Scope = struct {
.namespace => return @fieldParentPtr(Namespace, "base", cur).file_scope,
.file => return @fieldParentPtr(File, "base", cur),
.block => return @fieldParentPtr(Block, "base", cur).src_decl.namespace.file_scope,
- .decl_ref => return @fieldParentPtr(DeclRef, "base", cur).decl.namespace.file_scope,
};
}
}
@@ -1403,12 +1399,6 @@ pub const Scope = struct {
return &inst.base;
}
};
-
- pub const DeclRef = struct {
- pub const base_tag: Tag = .decl_ref;
- base: Scope = Scope{ .tag = base_tag },
- decl: *Decl,
- };
};
/// This struct holds data necessary to construct API-facing `AllErrors.Message`.
@@ -4012,12 +4002,6 @@ pub fn failWithOwnedErrorMsg(mod: *Module, scope: *Scope, err_msg: *ErrorMsg) In
},
.file => unreachable,
.namespace => unreachable,
- .decl_ref => {
- const decl_ref = scope.cast(Scope.DeclRef).?;
- decl_ref.decl.analysis = .sema_failure;
- decl_ref.decl.generation = mod.generation;
- mod.failed_decls.putAssumeCapacityNoClobber(decl_ref.decl, err_msg);
- },
}
return error.AnalysisFail;
}