| ... | @@ -478,7 +478,7 @@ pub fn hasRuntimeBitsAdvanced( | ... | @@ -478,7 +478,7 @@ pub fn hasRuntimeBitsAdvanced( |
| 478 | ty: Type, | 478 | ty: Type, |
| 479 | pt: Zcu.PerThread, | 479 | pt: Zcu.PerThread, |
| 480 | ignore_comptime_only: bool, | 480 | ignore_comptime_only: bool, |
| 481 | strat: ResolveStratLazy, | 481 | comptime strat: ResolveStratLazy, |
| 482 | ) RuntimeBitsError!bool { | 482 | ) RuntimeBitsError!bool { |
| 483 | const mod = pt.zcu; | 483 | const mod = pt.zcu; |
| 484 | const ip = &mod.intern_pool; | 484 | const ip = &mod.intern_pool; |
| ... | @@ -792,7 +792,7 @@ pub fn fnHasRuntimeBits(ty: Type, pt: Zcu.PerThread) bool { | ... | @@ -792,7 +792,7 @@ pub fn fnHasRuntimeBits(ty: Type, pt: Zcu.PerThread) bool { |
| 792 | /// Determines whether a function type has runtime bits, i.e. whether a | 792 | /// Determines whether a function type has runtime bits, i.e. whether a |
| 793 | /// function with this type can exist at runtime. | 793 | /// function with this type can exist at runtime. |
| 794 | /// Asserts that `ty` is a function type. | 794 | /// Asserts that `ty` is a function type. |
| 795 | pub fn fnHasRuntimeBitsAdvanced(ty: Type, pt: Zcu.PerThread, strat: ResolveStrat) SemaError!bool { | 795 | pub fn fnHasRuntimeBitsAdvanced(ty: Type, pt: Zcu.PerThread, comptime strat: ResolveStrat) SemaError!bool { |
| 796 | const fn_info = pt.zcu.typeToFunc(ty).?; | 796 | const fn_info = pt.zcu.typeToFunc(ty).?; |
| 797 | if (fn_info.is_generic) return false; | 797 | if (fn_info.is_generic) return false; |
| 798 | if (fn_info.is_var_args) return true; | 798 | if (fn_info.is_var_args) return true; |
| ... | @@ -824,7 +824,7 @@ pub fn ptrAlignment(ty: Type, pt: Zcu.PerThread) Alignment { | ... | @@ -824,7 +824,7 @@ pub fn ptrAlignment(ty: Type, pt: Zcu.PerThread) Alignment { |
| 824 | return ptrAlignmentAdvanced(ty, pt, .normal) catch unreachable; | 824 | return ptrAlignmentAdvanced(ty, pt, .normal) catch unreachable; |
| 825 | } | 825 | } |
| 826 | | 826 | |
| 827 | pub fn ptrAlignmentAdvanced(ty: Type, pt: Zcu.PerThread, strat: ResolveStrat) !Alignment { | 827 | pub fn ptrAlignmentAdvanced(ty: Type, pt: Zcu.PerThread, comptime strat: ResolveStrat) !Alignment { |
| 828 | return switch (pt.zcu.intern_pool.indexToKey(ty.toIntern())) { | 828 | return switch (pt.zcu.intern_pool.indexToKey(ty.toIntern())) { |
| 829 | .ptr_type => |ptr_type| { | 829 | .ptr_type => |ptr_type| { |
| 830 | if (ptr_type.flags.alignment != .none) | 830 | if (ptr_type.flags.alignment != .none) |
| ... | @@ -891,7 +891,7 @@ pub const ResolveStrat = enum { | ... | @@ -891,7 +891,7 @@ pub const ResolveStrat = enum { |
| 891 | /// This should typically be used from semantic analysis. | 891 | /// This should typically be used from semantic analysis. |
| 892 | sema, | 892 | sema, |
| 893 | | 893 | |
| 894 | pub fn toLazy(strat: ResolveStrat) ResolveStratLazy { | 894 | pub inline fn toLazy(strat: ResolveStrat) ResolveStratLazy { |
| 895 | return switch (strat) { | 895 | return switch (strat) { |
| 896 | .normal => .eager, | 896 | .normal => .eager, |
| 897 | .sema => .sema, | 897 | .sema => .sema, |
| ... | @@ -908,7 +908,7 @@ pub const ResolveStrat = enum { | ... | @@ -908,7 +908,7 @@ pub const ResolveStrat = enum { |
| 908 | pub fn abiAlignmentAdvanced( | 908 | pub fn abiAlignmentAdvanced( |
| 909 | ty: Type, | 909 | ty: Type, |
| 910 | pt: Zcu.PerThread, | 910 | pt: Zcu.PerThread, |
| 911 | strat: ResolveStratLazy, | 911 | comptime strat: ResolveStratLazy, |
| 912 | ) SemaError!AbiAlignmentAdvanced { | 912 | ) SemaError!AbiAlignmentAdvanced { |
| 913 | const mod = pt.zcu; | 913 | const mod = pt.zcu; |
| 914 | const target = mod.getTarget(); | 914 | const target = mod.getTarget(); |
| ... | @@ -1130,7 +1130,7 @@ pub fn abiAlignmentAdvanced( | ... | @@ -1130,7 +1130,7 @@ pub fn abiAlignmentAdvanced( |
| 1130 | fn abiAlignmentAdvancedErrorUnion( | 1130 | fn abiAlignmentAdvancedErrorUnion( |
| 1131 | ty: Type, | 1131 | ty: Type, |
| 1132 | pt: Zcu.PerThread, | 1132 | pt: Zcu.PerThread, |
| 1133 | strat: ResolveStratLazy, | 1133 | comptime strat: ResolveStratLazy, |
| 1134 | payload_ty: Type, | 1134 | payload_ty: Type, |
| 1135 | ) SemaError!AbiAlignmentAdvanced { | 1135 | ) SemaError!AbiAlignmentAdvanced { |
| 1136 | // This code needs to be kept in sync with the equivalent switch prong | 1136 | // This code needs to be kept in sync with the equivalent switch prong |
| ... | @@ -1167,7 +1167,7 @@ fn abiAlignmentAdvancedErrorUnion( | ... | @@ -1167,7 +1167,7 @@ fn abiAlignmentAdvancedErrorUnion( |
| 1167 | fn abiAlignmentAdvancedOptional( | 1167 | fn abiAlignmentAdvancedOptional( |
| 1168 | ty: Type, | 1168 | ty: Type, |
| 1169 | pt: Zcu.PerThread, | 1169 | pt: Zcu.PerThread, |
| 1170 | strat: ResolveStratLazy, | 1170 | comptime strat: ResolveStratLazy, |
| 1171 | ) SemaError!AbiAlignmentAdvanced { | 1171 | ) SemaError!AbiAlignmentAdvanced { |
| 1172 | const mod = pt.zcu; | 1172 | const mod = pt.zcu; |
| 1173 | const target = mod.getTarget(); | 1173 | const target = mod.getTarget(); |
| ... | @@ -1231,7 +1231,7 @@ const AbiSizeAdvanced = union(enum) { | ... | @@ -1231,7 +1231,7 @@ const AbiSizeAdvanced = union(enum) { |
| 1231 | pub fn abiSizeAdvanced( | 1231 | pub fn abiSizeAdvanced( |
| 1232 | ty: Type, | 1232 | ty: Type, |
| 1233 | pt: Zcu.PerThread, | 1233 | pt: Zcu.PerThread, |
| 1234 | strat: ResolveStratLazy, | 1234 | comptime strat: ResolveStratLazy, |
| 1235 | ) SemaError!AbiSizeAdvanced { | 1235 | ) SemaError!AbiSizeAdvanced { |
| 1236 | const mod = pt.zcu; | 1236 | const mod = pt.zcu; |
| 1237 | const target = mod.getTarget(); | 1237 | const target = mod.getTarget(); |
| ... | @@ -1505,7 +1505,7 @@ pub fn abiSizeAdvanced( | ... | @@ -1505,7 +1505,7 @@ pub fn abiSizeAdvanced( |
| 1505 | fn abiSizeAdvancedOptional( | 1505 | fn abiSizeAdvancedOptional( |
| 1506 | ty: Type, | 1506 | ty: Type, |
| 1507 | pt: Zcu.PerThread, | 1507 | pt: Zcu.PerThread, |
| 1508 | strat: ResolveStratLazy, | 1508 | comptime strat: ResolveStratLazy, |
| 1509 | ) SemaError!AbiSizeAdvanced { | 1509 | ) SemaError!AbiSizeAdvanced { |
| 1510 | const mod = pt.zcu; | 1510 | const mod = pt.zcu; |
| 1511 | const child_ty = ty.optionalChild(mod); | 1511 | const child_ty = ty.optionalChild(mod); |
| ... | @@ -1680,7 +1680,7 @@ pub fn bitSize(ty: Type, pt: Zcu.PerThread) u64 { | ... | @@ -1680,7 +1680,7 @@ pub fn bitSize(ty: Type, pt: Zcu.PerThread) u64 { |
| 1680 | pub fn bitSizeAdvanced( | 1680 | pub fn bitSizeAdvanced( |
| 1681 | ty: Type, | 1681 | ty: Type, |
| 1682 | pt: Zcu.PerThread, | 1682 | pt: Zcu.PerThread, |
| 1683 | strat: ResolveStrat, | 1683 | comptime strat: ResolveStrat, |
| 1684 | ) SemaError!u64 { | 1684 | ) SemaError!u64 { |
| 1685 | const mod = pt.zcu; | 1685 | const mod = pt.zcu; |
| 1686 | const target = mod.getTarget(); | 1686 | const target = mod.getTarget(); |
| ... | @@ -2739,7 +2739,7 @@ pub fn comptimeOnly(ty: Type, pt: Zcu.PerThread) bool { | ... | @@ -2739,7 +2739,7 @@ pub fn comptimeOnly(ty: Type, pt: Zcu.PerThread) bool { |
| 2739 | | 2739 | |
| 2740 | /// `generic_poison` will return false. | 2740 | /// `generic_poison` will return false. |
| 2741 | /// May return false negatives when structs and unions are having their field types resolved. | 2741 | /// May return false negatives when structs and unions are having their field types resolved. |
| 2742 | pub fn comptimeOnlyAdvanced(ty: Type, pt: Zcu.PerThread, strat: ResolveStrat) SemaError!bool { | 2742 | pub fn comptimeOnlyAdvanced(ty: Type, pt: Zcu.PerThread, comptime strat: ResolveStrat) SemaError!bool { |
| 2743 | const mod = pt.zcu; | 2743 | const mod = pt.zcu; |
| 2744 | const ip = &mod.intern_pool; | 2744 | const ip = &mod.intern_pool; |
| 2745 | return switch (ty.toIntern()) { | 2745 | return switch (ty.toIntern()) { |
| ... | @@ -3198,7 +3198,7 @@ pub fn structFieldAlign(ty: Type, index: usize, pt: Zcu.PerThread) Alignment { | ... | @@ -3198,7 +3198,7 @@ pub fn structFieldAlign(ty: Type, index: usize, pt: Zcu.PerThread) Alignment { |
| 3198 | return ty.structFieldAlignAdvanced(index, pt, .normal) catch unreachable; | 3198 | return ty.structFieldAlignAdvanced(index, pt, .normal) catch unreachable; |
| 3199 | } | 3199 | } |
| 3200 | | 3200 | |
| 3201 | pub fn structFieldAlignAdvanced(ty: Type, index: usize, pt: Zcu.PerThread, strat: ResolveStrat) !Alignment { | 3201 | pub fn structFieldAlignAdvanced(ty: Type, index: usize, pt: Zcu.PerThread, comptime strat: ResolveStrat) !Alignment { |
| 3202 | const ip = &pt.zcu.intern_pool; | 3202 | const ip = &pt.zcu.intern_pool; |
| 3203 | switch (ip.indexToKey(ty.toIntern())) { | 3203 | switch (ip.indexToKey(ty.toIntern())) { |
| 3204 | .struct_type => { | 3204 | .struct_type => { |