| ... | ... | @@ -4264,7 +4264,7 @@ pub const Function = struct { |
| 4264 | 4264 | => wip.builder.structTypeAssumeCapacity(.normal, &.{ |
| 4265 | 4265 | wip.extraData(CmpXchg, instruction.data).cmp.typeOfWip(wip), |
| 4266 | 4266 | .i1, |
| 4267 | | }) catch unreachable, |
| 4267 | }), |
| 4268 | 4268 | .extractelement => wip.extraData(ExtractElement, instruction.data) |
| 4269 | 4269 | .val.typeOfWip(wip).childType(wip.builder), |
| 4270 | 4270 | .extractvalue => { |
| ... | ... | @@ -4451,7 +4451,7 @@ pub const Function = struct { |
| 4451 | 4451 | function.extraData(CmpXchg, instruction.data) |
| 4452 | 4452 | .cmp.typeOf(function_index, builder), |
| 4453 | 4453 | .i1, |
| 4454 | | }) catch unreachable, |
| 4454 | }), |
| 4455 | 4455 | .extractelement => function.extraData(ExtractElement, instruction.data) |
| 4456 | 4456 | .val.typeOf(function_index, builder).childType(builder), |
| 4457 | 4457 | .extractvalue => { |
| ... | ... | @@ -4840,6 +4840,44 @@ pub const DebugLocation = struct { |
| 4840 | 4840 | inlined_at: Metadata, |
| 4841 | 4841 | }; |
| 4842 | 4842 | |
| 4843 | pub const DIFlags = opaque { |
| 4844 | pub const Zero = 0; |
| 4845 | pub const Private = 1; |
| 4846 | pub const Protected = 2; |
| 4847 | pub const Public = 3; |
| 4848 | |
| 4849 | pub const FwdDecl = 1 << 2; |
| 4850 | pub const AppleBlock = 1 << 3; |
| 4851 | pub const BlockByrefStruct = 1 << 4; |
| 4852 | pub const Virtual = 1 << 5; |
| 4853 | pub const Artificial = 1 << 6; |
| 4854 | pub const Explicit = 1 << 7; |
| 4855 | pub const Prototyped = 1 << 8; |
| 4856 | pub const ObjcClassComplete = 1 << 9; |
| 4857 | pub const ObjectPointer = 1 << 10; |
| 4858 | pub const Vector = 1 << 11; |
| 4859 | pub const StaticMember = 1 << 12; |
| 4860 | pub const LValueReference = 1 << 13; |
| 4861 | pub const RValueReference = 1 << 14; |
| 4862 | pub const Reserved = 1 << 15; |
| 4863 | |
| 4864 | pub const SingleInheritance = 1 << 16; |
| 4865 | pub const MultipleInheritance = 2 << 16; |
| 4866 | pub const VirtualInheritance = 3 << 16; |
| 4867 | |
| 4868 | pub const IntroducedVirtual = 1 << 18; |
| 4869 | pub const BitField = 1 << 19; |
| 4870 | pub const NoReturn = 1 << 20; |
| 4871 | pub const TypePassByValue = 1 << 22; |
| 4872 | pub const TypePassByReference = 1 << 23; |
| 4873 | pub const EnumClass = 1 << 24; |
| 4874 | pub const Thunk = 1 << 25; |
| 4875 | pub const NonTrivial = 1 << 26; |
| 4876 | pub const BigEndian = 1 << 27; |
| 4877 | pub const LittleEndian = 1 << 28; |
| 4878 | pub const AllCallsDescribed = 1 << 29; |
| 4879 | }; |
| 4880 | |
| 4843 | 4881 | pub const WipFunction = struct { |
| 4844 | 4882 | builder: *Builder, |
| 4845 | 4883 | function: Function.Index, |
| ... | ... | @@ -5610,7 +5648,7 @@ pub const WipFunction = struct { |
| 5610 | 5648 | vals: []const Value, |
| 5611 | 5649 | blocks: []const Block.Index, |
| 5612 | 5650 | wip: *WipFunction, |
| 5613 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!void { |
| 5651 | ) void { |
| 5614 | 5652 | const incoming_len = self.block.ptrConst(wip).incoming; |
| 5615 | 5653 | assert(vals.len == incoming_len and blocks.len == incoming_len); |
| 5616 | 5654 | const instruction = wip.instructions.get(@intFromEnum(self.instruction)); |
| ... | ... | @@ -8007,7 +8045,7 @@ pub fn namedTypeSetBody( |
| 8007 | 8045 | self: *Builder, |
| 8008 | 8046 | named_type: Type, |
| 8009 | 8047 | body_type: Type, |
| 8010 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!void { |
| 8048 | ) void { |
| 8011 | 8049 | const named_item = self.type_items.items[@intFromEnum(named_type)]; |
| 8012 | 8050 | self.type_extra.items[named_item.data + std.meta.fieldIndex(Type.NamedStructure, "body").?] = |
| 8013 | 8051 | @intFromEnum(body_type); |
| ... | ... | @@ -9372,7 +9410,7 @@ fn fnTypeAssumeCapacity( |
| 9372 | 9410 | ret: Type, |
| 9373 | 9411 | params: []const Type, |
| 9374 | 9412 | comptime kind: Type.Function.Kind, |
| 9375 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!Type { |
| 9413 | ) Type { |
| 9376 | 9414 | const tag: Type.Tag = switch (kind) { |
| 9377 | 9415 | .normal => .function, |
| 9378 | 9416 | .vararg => .vararg_function, |
| ... | ... | @@ -9528,7 +9566,7 @@ fn structTypeAssumeCapacity( |
| 9528 | 9566 | self: *Builder, |
| 9529 | 9567 | comptime kind: Type.Structure.Kind, |
| 9530 | 9568 | fields: []const Type, |
| 9531 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!Type { |
| 9569 | ) Type { |
| 9532 | 9570 | const tag: Type.Tag = switch (kind) { |
| 9533 | 9571 | .normal => .structure, |
| 9534 | 9572 | .@"packed" => .packed_structure, |
| ... | ... | @@ -9739,10 +9777,7 @@ fn bigIntConstAssumeCapacity( |
| 9739 | 9777 | assert(type_item.tag == .integer); |
| 9740 | 9778 | const bits = type_item.data; |
| 9741 | 9779 | |
| 9742 | | const ExpectedContents = extern struct { |
| 9743 | | limbs: [64 / @sizeOf(std.math.big.Limb)]std.math.big.Limb, |
| 9744 | | llvm_limbs: if (build_options.have_llvm) [64 / @sizeOf(u64)]u64 else void, |
| 9745 | | }; |
| 9780 | const ExpectedContents = [64 / @sizeOf(std.math.big.Limb)]std.math.big.Limb; |
| 9746 | 9781 | var stack align(@alignOf(ExpectedContents)) = |
| 9747 | 9782 | std.heap.stackFallback(@sizeOf(ExpectedContents), self.gpa); |
| 9748 | 9783 | const allocator = stack.get(); |
| ... | ... | @@ -9973,11 +10008,7 @@ fn noneConstAssumeCapacity(self: *Builder, ty: Type) Constant { |
| 9973 | 10008 | return result.constant; |
| 9974 | 10009 | } |
| 9975 | 10010 | |
| 9976 | | fn structConstAssumeCapacity( |
| 9977 | | self: *Builder, |
| 9978 | | ty: Type, |
| 9979 | | vals: []const Constant, |
| 9980 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!Constant { |
| 10011 | fn structConstAssumeCapacity(self: *Builder, ty: Type, vals: []const Constant) Constant { |
| 9981 | 10012 | const type_item = self.type_items.items[@intFromEnum(ty)]; |
| 9982 | 10013 | var extra = self.typeExtraDataTrail(Type.Structure, switch (type_item.tag) { |
| 9983 | 10014 | .structure, .packed_structure => type_item.data, |
| ... | ... | @@ -10007,11 +10038,7 @@ fn structConstAssumeCapacity( |
| 10007 | 10038 | return result.constant; |
| 10008 | 10039 | } |
| 10009 | 10040 | |
| 10010 | | fn arrayConstAssumeCapacity( |
| 10011 | | self: *Builder, |
| 10012 | | ty: Type, |
| 10013 | | vals: []const Constant, |
| 10014 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!Constant { |
| 10041 | fn arrayConstAssumeCapacity(self: *Builder, ty: Type, vals: []const Constant) Constant { |
| 10015 | 10042 | const type_item = self.type_items.items[@intFromEnum(ty)]; |
| 10016 | 10043 | const type_extra: struct { len: u64, child: Type } = switch (type_item.tag) { |
| 10017 | 10044 | inline .small_array, .array => |kind| extra: { |
| ... | ... | @@ -10055,11 +10082,7 @@ fn stringNullConstAssumeCapacity(self: *Builder, val: String) Constant { |
| 10055 | 10082 | return result.constant; |
| 10056 | 10083 | } |
| 10057 | 10084 | |
| 10058 | | fn vectorConstAssumeCapacity( |
| 10059 | | self: *Builder, |
| 10060 | | ty: Type, |
| 10061 | | vals: []const Constant, |
| 10062 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!Constant { |
| 10085 | fn vectorConstAssumeCapacity(self: *Builder, ty: Type, vals: []const Constant) Constant { |
| 10063 | 10086 | assert(ty.isVector(self)); |
| 10064 | 10087 | assert(ty.vectorLen(self) == vals.len); |
| 10065 | 10088 | for (vals) |val| assert(ty.childType(self) == val.typeOf(self)); |
| ... | ... | @@ -10075,11 +10098,7 @@ fn vectorConstAssumeCapacity( |
| 10075 | 10098 | return result.constant; |
| 10076 | 10099 | } |
| 10077 | 10100 | |
| 10078 | | fn splatConstAssumeCapacity( |
| 10079 | | self: *Builder, |
| 10080 | | ty: Type, |
| 10081 | | val: Constant, |
| 10082 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!Constant { |
| 10101 | fn splatConstAssumeCapacity(self: *Builder, ty: Type, val: Constant) Constant { |
| 10083 | 10102 | assert(ty.scalarType(self) == val.typeOf(self)); |
| 10084 | 10103 | |
| 10085 | 10104 | if (!ty.isVector(self)) return val; |
| ... | ... | @@ -10327,7 +10346,7 @@ fn gepConstAssumeCapacity( |
| 10327 | 10346 | base: Constant, |
| 10328 | 10347 | inrange: ?u16, |
| 10329 | 10348 | indices: []const Constant, |
| 10330 | | ) (if (build_options.have_llvm) Allocator.Error else error{})!Constant { |
| 10349 | ) Constant { |
| 10331 | 10350 | const tag: Constant.Tag = switch (kind) { |
| 10332 | 10351 | .normal => .getelementptr, |
| 10333 | 10352 | .inbounds => .@"getelementptr inbounds", |