aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorMeghan Denny <hello@nektro.net>2023-11-25 15:02:32 -0800
committerAndrew Kelley <andrew@ziglang.org>2023-11-26 02:24:40 -0500
commit2549de80b226cddd0664ce4ad8c40887101f302b (patch)
tree9674c446649114e88339256b24ef00660e1a168b /src/codegen/c.zig
parent7103088e4a51d4362e6665d5949a9677e18fb74a (diff)
downloadzig-2549de80b226cddd0664ce4ad8c40887101f302b.tar.gz
zig-2549de80b226cddd0664ce4ad8c40887101f302b.zip
move Module.Decl.Index and Module.Namespace.Index to InternPool
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 5d0e0f4246..5e326336a5 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -39,8 +39,8 @@ pub const CValue = union(enum) {
/// Index into a tuple's fields
field: usize,
/// By-value
- decl: Decl.Index,
- decl_ref: Decl.Index,
+ decl: InternPool.DeclIndex,
+ decl_ref: InternPool.DeclIndex,
/// An undefined value (cannot be dereferenced)
undef: Type,
/// Render the slice as an identifier (using fmtIdent)
@@ -57,9 +57,9 @@ const BlockData = struct {
pub const CValueMap = std.AutoHashMap(Air.Inst.Ref, CValue);
pub const LazyFnKey = union(enum) {
- tag_name: Decl.Index,
- never_tail: Decl.Index,
- never_inline: Decl.Index,
+ tag_name: InternPool.DeclIndex,
+ never_tail: InternPool.DeclIndex,
+ never_inline: InternPool.DeclIndex,
};
pub const LazyFnValue = struct {
fn_name: []const u8,
@@ -534,7 +534,7 @@ pub const DeclGen = struct {
aligned_anon_decls: std.AutoArrayHashMapUnmanaged(InternPool.Index, Alignment),
pub const Pass = union(enum) {
- decl: Decl.Index,
+ decl: InternPool.DeclIndex,
anon: InternPool.Index,
flush,
};
@@ -624,7 +624,7 @@ pub const DeclGen = struct {
writer: anytype,
ty: Type,
val: Value,
- decl_index: Decl.Index,
+ decl_index: InternPool.DeclIndex,
location: ValueRenderLocation,
) error{ OutOfMemory, AnalysisFail }!void {
const mod = dg.module;
@@ -1585,7 +1585,7 @@ pub const DeclGen = struct {
fn renderFunctionSignature(
dg: *DeclGen,
w: anytype,
- fn_decl_index: Decl.Index,
+ fn_decl_index: InternPool.DeclIndex,
kind: CType.Kind,
name: union(enum) {
export_index: u32,
@@ -1926,7 +1926,7 @@ pub const DeclGen = struct {
try dg.writeCValue(writer, member);
}
- fn renderFwdDecl(dg: *DeclGen, decl_index: Decl.Index, variable: InternPool.Key.Variable) !void {
+ fn renderFwdDecl(dg: *DeclGen, decl_index: InternPool.DeclIndex, variable: InternPool.Key.Variable) !void {
const decl = dg.module.declPtr(decl_index);
const fwd = dg.fwd_decl.writer();
const is_global = dg.declIsGlobal(.{ .ty = decl.ty, .val = decl.val }) or variable.is_extern;
@@ -1948,7 +1948,7 @@ pub const DeclGen = struct {
try fwd.writeAll(";\n");
}
- fn renderDeclName(dg: *DeclGen, writer: anytype, decl_index: Decl.Index, export_index: u32) !void {
+ fn renderDeclName(dg: *DeclGen, writer: anytype, decl_index: InternPool.DeclIndex, export_index: u32) !void {
const mod = dg.module;
const decl = mod.declPtr(decl_index);
try mod.markDeclAlive(decl);