diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-30 19:12:05 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-08-30 19:12:05 -0700 |
| commit | 20145016ac0d098e8e63d5107a05eca376d1e7bb (patch) | |
| tree | 9fa59538541c7a92a5b593a248d00ec8be06f87d /src/Module.zig | |
| parent | ea4ef832e364d48b4670c71d948782df12e5e4ca (diff) | |
| parent | 56cfa8f22f69d813efedb1fa01fdcb7077ca0e5a (diff) | |
| download | zig-20145016ac0d098e8e63d5107a05eca376d1e7bb.tar.gz zig-20145016ac0d098e8e63d5107a05eca376d1e7bb.zip | |
Merge remote-tracking branch 'origin/master' into llvm15
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index 66c36b939b..9410c4ea4a 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -1496,6 +1496,22 @@ pub const Fn = struct { /// active Sema context. Importantly, this value is also updated when an existing /// generic function instantiation is found and called. branch_quota: u32, + + /// If this is not none, this function is a generic function instantiation, and + /// this is the generic function decl from which the instance was derived. + /// This information is redundant with a combination of checking if comptime_args is + /// not null and looking at the first decl dependency of owner_decl. This redundant + /// information is useful for three reasons: + /// 1. Improved perf of monomorphed_funcs when checking the eql() function because it + /// can do two fewer pointer chases by grabbing the info from this field directly + /// instead of accessing the decl and then the dependencies set. + /// 2. While a generic function instantiation is being initialized, we need hash() + /// and eql() to work before the initialization is complete. Completing the + /// insertion into the decl dependency set has more fallible operations than simply + /// setting this field. + /// 3. I forgot what the third thing was while typing up the other two. + generic_owner_decl: Decl.OptionalIndex, + state: Analysis, is_cold: bool = false, is_noinline: bool, |
