authorgravatar for liljaanton2001@gmail.comantlilja <liljaanton2001@gmail.com> 2024-02-23 03:12:54+01:00
committergravatar for liljaanton2001@gmail.comantlilja <liljaanton2001@gmail.com> 2024-02-23 03:12:54+01:00
logdfde194287b7afa66a14804fdbc43211ce52e2f7
tree856c723121d0348ab8f5fa87a537d68e582cd30c
parent0ba2185a4233f1717497c03bcc93e806eb111492

LLVM Builder: Make some Metadata no longer be distinct


2 files changed, 24 insertions(+), 24 deletions(-)

src/codegen/llvm/Builder.zig+14-14
...@@ -12284,7 +12284,7 @@ fn debugFileAssumeCapacity(...@@ -12284,7 +12284,7 @@ fn debugFileAssumeCapacity(
12284 directory: MetadataString,12284 directory: MetadataString,
12285) Metadata {12285) Metadata {
12286 assert(!self.strip);12286 assert(!self.strip);
12287 return self.metadataDistinctAssumeCapacity(.file, Metadata.File{12287 return self.metadataSimpleAssumeCapacity(.file, Metadata.File{
12288 .filename = filename,12288 .filename = filename,
12289 .directory = directory,12289 .directory = directory,
12290 });12290 });
...@@ -12338,7 +12338,7 @@ fn debugSubprogramAssumeCapacity(...@@ -12338,7 +12338,7 @@ fn debugSubprogramAssumeCapacity(
1233812338
12339fn debugLexicalBlockAssumeCapacity(self: *Builder, scope: Metadata, file: Metadata, line: u32, column: u32) Metadata {12339fn debugLexicalBlockAssumeCapacity(self: *Builder, scope: Metadata, file: Metadata, line: u32, column: u32) Metadata {
12340 assert(!self.strip);12340 assert(!self.strip);
12341 return self.metadataDistinctAssumeCapacity(.lexical_block, Metadata.LexicalBlock{12341 return self.metadataSimpleAssumeCapacity(.lexical_block, Metadata.LexicalBlock{
12342 .scope = scope,12342 .scope = scope,
12343 .file = file,12343 .file = file,
12344 .line = line,12344 .line = line,
...@@ -12358,7 +12358,7 @@ fn debugLocationAssumeCapacity(self: *Builder, line: u32, column: u32, scope: Me...@@ -12358,7 +12358,7 @@ fn debugLocationAssumeCapacity(self: *Builder, line: u32, column: u32, scope: Me
1235812358
12359fn debugBoolTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {12359fn debugBoolTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {
12360 assert(!self.strip);12360 assert(!self.strip);
12361 return self.metadataDistinctAssumeCapacity(.basic_bool_type, Metadata.BasicType{12361 return self.metadataSimpleAssumeCapacity(.basic_bool_type, Metadata.BasicType{
12362 .name = name,12362 .name = name,
12363 .size_in_bits_lo = @truncate(size_in_bits),12363 .size_in_bits_lo = @truncate(size_in_bits),
12364 .size_in_bits_hi = @truncate(size_in_bits >> 32),12364 .size_in_bits_hi = @truncate(size_in_bits >> 32),
...@@ -12367,7 +12367,7 @@ fn debugBoolTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bit...@@ -12367,7 +12367,7 @@ fn debugBoolTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bit
1236712367
12368fn debugUnsignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {12368fn debugUnsignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {
12369 assert(!self.strip);12369 assert(!self.strip);
12370 return self.metadataDistinctAssumeCapacity(.basic_unsigned_type, Metadata.BasicType{12370 return self.metadataSimpleAssumeCapacity(.basic_unsigned_type, Metadata.BasicType{
12371 .name = name,12371 .name = name,
12372 .size_in_bits_lo = @truncate(size_in_bits),12372 .size_in_bits_lo = @truncate(size_in_bits),
12373 .size_in_bits_hi = @truncate(size_in_bits >> 32),12373 .size_in_bits_hi = @truncate(size_in_bits >> 32),
...@@ -12376,7 +12376,7 @@ fn debugUnsignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in...@@ -12376,7 +12376,7 @@ fn debugUnsignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in
1237612376
12377fn debugSignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {12377fn debugSignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {
12378 assert(!self.strip);12378 assert(!self.strip);
12379 return self.metadataDistinctAssumeCapacity(.basic_signed_type, Metadata.BasicType{12379 return self.metadataSimpleAssumeCapacity(.basic_signed_type, Metadata.BasicType{
12380 .name = name,12380 .name = name,
12381 .size_in_bits_lo = @truncate(size_in_bits),12381 .size_in_bits_lo = @truncate(size_in_bits),
12382 .size_in_bits_hi = @truncate(size_in_bits >> 32),12382 .size_in_bits_hi = @truncate(size_in_bits >> 32),
...@@ -12385,7 +12385,7 @@ fn debugSignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_b...@@ -12385,7 +12385,7 @@ fn debugSignedTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_b
1238512385
12386fn debugFloatTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {12386fn debugFloatTypeAssumeCapacity(self: *Builder, name: MetadataString, size_in_bits: u64) Metadata {
12387 assert(!self.strip);12387 assert(!self.strip);
12388 return self.metadataDistinctAssumeCapacity(.basic_float_type, Metadata.BasicType{12388 return self.metadataSimpleAssumeCapacity(.basic_float_type, Metadata.BasicType{
12389 .name = name,12389 .name = name,
12390 .size_in_bits_lo = @truncate(size_in_bits),12390 .size_in_bits_lo = @truncate(size_in_bits),
12391 .size_in_bits_hi = @truncate(size_in_bits >> 32),12391 .size_in_bits_hi = @truncate(size_in_bits >> 32),
...@@ -12537,7 +12537,7 @@ fn debugCompositeTypeAssumeCapacity(...@@ -12537,7 +12537,7 @@ fn debugCompositeTypeAssumeCapacity(
12537 fields_tuple: Metadata,12537 fields_tuple: Metadata,
12538) Metadata {12538) Metadata {
12539 assert(!self.strip);12539 assert(!self.strip);
12540 return self.metadataDistinctAssumeCapacity(tag, Metadata.CompositeType{12540 return self.metadataSimpleAssumeCapacity(tag, Metadata.CompositeType{
12541 .name = name,12541 .name = name,
12542 .file = file,12542 .file = file,
12543 .scope = scope,12543 .scope = scope,
...@@ -12563,7 +12563,7 @@ fn debugPointerTypeAssumeCapacity(...@@ -12563,7 +12563,7 @@ fn debugPointerTypeAssumeCapacity(
12563 offset_in_bits: u64,12563 offset_in_bits: u64,
12564) Metadata {12564) Metadata {
12565 assert(!self.strip);12565 assert(!self.strip);
12566 return self.metadataDistinctAssumeCapacity(.derived_pointer_type, Metadata.DerivedType{12566 return self.metadataSimpleAssumeCapacity(.derived_pointer_type, Metadata.DerivedType{
12567 .name = name,12567 .name = name,
12568 .file = file,12568 .file = file,
12569 .scope = scope,12569 .scope = scope,
...@@ -12590,7 +12590,7 @@ fn debugMemberTypeAssumeCapacity(...@@ -12590,7 +12590,7 @@ fn debugMemberTypeAssumeCapacity(
12590 offset_in_bits: u64,12590 offset_in_bits: u64,
12591) Metadata {12591) Metadata {
12592 assert(!self.strip);12592 assert(!self.strip);
12593 return self.metadataDistinctAssumeCapacity(.derived_member_type, Metadata.DerivedType{12593 return self.metadataSimpleAssumeCapacity(.derived_member_type, Metadata.DerivedType{
12594 .name = name,12594 .name = name,
12595 .file = file,12595 .file = file,
12596 .scope = scope,12596 .scope = scope,
...@@ -12610,7 +12610,7 @@ fn debugSubroutineTypeAssumeCapacity(...@@ -12610,7 +12610,7 @@ fn debugSubroutineTypeAssumeCapacity(
12610 types_tuple: Metadata,12610 types_tuple: Metadata,
12611) Metadata {12611) Metadata {
12612 assert(!self.strip);12612 assert(!self.strip);
12613 return self.metadataDistinctAssumeCapacity(.subroutine_type, Metadata.SubroutineType{12613 return self.metadataSimpleAssumeCapacity(.subroutine_type, Metadata.SubroutineType{
12614 .types_tuple = types_tuple,12614 .types_tuple = types_tuple,
12615 });12615 });
12616}12616}
...@@ -12674,7 +12674,7 @@ fn debugSubrangeAssumeCapacity(...@@ -12674,7 +12674,7 @@ fn debugSubrangeAssumeCapacity(
12674 count: Metadata,12674 count: Metadata,
12675) Metadata {12675) Metadata {
12676 assert(!self.strip);12676 assert(!self.strip);
12677 return self.metadataDistinctAssumeCapacity(.subrange, Metadata.Subrange{12677 return self.metadataSimpleAssumeCapacity(.subrange, Metadata.Subrange{
12678 .lower_bound = lower_bound,12678 .lower_bound = lower_bound,
12679 .count = count,12679 .count = count,
12680 });12680 });
...@@ -12797,7 +12797,7 @@ fn debugLocalVarAssumeCapacity(...@@ -12797,7 +12797,7 @@ fn debugLocalVarAssumeCapacity(
12797 ty: Metadata,12797 ty: Metadata,
12798) Metadata {12798) Metadata {
12799 assert(!self.strip);12799 assert(!self.strip);
12800 return self.metadataDistinctAssumeCapacity(.local_var, Metadata.LocalVar{12800 return self.metadataSimpleAssumeCapacity(.local_var, Metadata.LocalVar{
12801 .name = name,12801 .name = name,
12802 .file = file,12802 .file = file,
12803 .scope = scope,12803 .scope = scope,
...@@ -12816,7 +12816,7 @@ fn debugParameterAssumeCapacity(...@@ -12816,7 +12816,7 @@ fn debugParameterAssumeCapacity(
12816 arg_no: u32,12816 arg_no: u32,
12817) Metadata {12817) Metadata {
12818 assert(!self.strip);12818 assert(!self.strip);
12819 return self.metadataDistinctAssumeCapacity(.parameter, Metadata.Parameter{12819 return self.metadataSimpleAssumeCapacity(.parameter, Metadata.Parameter{
12820 .name = name,12820 .name = name,
12821 .file = file,12821 .file = file,
12822 .scope = scope,12822 .scope = scope,
...@@ -12858,7 +12858,7 @@ fn debugGlobalVarExpressionAssumeCapacity(...@@ -12858,7 +12858,7 @@ fn debugGlobalVarExpressionAssumeCapacity(
12858 expression: Metadata,12858 expression: Metadata,
12859) Metadata {12859) Metadata {
12860 assert(!self.strip);12860 assert(!self.strip);
12861 return self.metadataDistinctAssumeCapacity(.global_var_expression, Metadata.GlobalVarExpression{12861 return self.metadataSimpleAssumeCapacity(.global_var_expression, Metadata.GlobalVarExpression{
12862 .variable = variable,12862 .variable = variable,
12863 .expression = expression,12863 .expression = expression,
12864 });12864 });
src/codegen/llvm/ir.zig+10-10
...@@ -658,7 +658,7 @@ pub const MetadataBlock = struct {...@@ -658,7 +658,7 @@ pub const MetadataBlock = struct {
658 pub const File = struct {658 pub const File = struct {
659 pub const ops = [_]AbbrevOp{659 pub const ops = [_]AbbrevOp{
660 .{ .literal = 16 },660 .{ .literal = 16 },
661 .{ .literal = 1 }, // is distinct661 .{ .literal = 0 }, // is distinct
662 MetadataAbbrev, // filename662 MetadataAbbrev, // filename
663 MetadataAbbrev, // directory663 MetadataAbbrev, // directory
664 .{ .literal = 0 }, // checksum664 .{ .literal = 0 }, // checksum
...@@ -743,7 +743,7 @@ pub const MetadataBlock = struct {...@@ -743,7 +743,7 @@ pub const MetadataBlock = struct {
743 pub const LexicalBlock = struct {743 pub const LexicalBlock = struct {
744 pub const ops = [_]AbbrevOp{744 pub const ops = [_]AbbrevOp{
745 .{ .literal = 22 },745 .{ .literal = 22 },
746 .{ .literal = 1 }, // is distinct746 .{ .literal = 0 }, // is distinct
747 MetadataAbbrev, // scope747 MetadataAbbrev, // scope
748 MetadataAbbrev, // file748 MetadataAbbrev, // file
749 LineAbbrev, // line749 LineAbbrev, // line
...@@ -776,7 +776,7 @@ pub const MetadataBlock = struct {...@@ -776,7 +776,7 @@ pub const MetadataBlock = struct {
776 pub const BasicType = struct {776 pub const BasicType = struct {
777 pub const ops = [_]AbbrevOp{777 pub const ops = [_]AbbrevOp{
778 .{ .literal = 15 },778 .{ .literal = 15 },
779 .{ .literal = 1 }, // is distinct779 .{ .literal = 0 }, // is distinct
780 .{ .literal = std.dwarf.TAG.base_type }, // tag780 .{ .literal = std.dwarf.TAG.base_type }, // tag
781 MetadataAbbrev, // name781 MetadataAbbrev, // name
782 .{ .vbr = 6 }, // size in bits782 .{ .vbr = 6 }, // size in bits
...@@ -793,7 +793,7 @@ pub const MetadataBlock = struct {...@@ -793,7 +793,7 @@ pub const MetadataBlock = struct {
793 pub const CompositeType = struct {793 pub const CompositeType = struct {
794 pub const ops = [_]AbbrevOp{794 pub const ops = [_]AbbrevOp{
795 .{ .literal = 18 },795 .{ .literal = 18 },
796 .{ .literal = 1 | 0x2 }, // is distinct | is not used in old type ref796 .{ .literal = 0 | 0x2 }, // is distinct | is not used in old type ref
797 .{ .fixed = 32 }, // tag797 .{ .fixed = 32 }, // tag
798 MetadataAbbrev, // name798 MetadataAbbrev, // name
799 MetadataAbbrev, // file799 MetadataAbbrev, // file
...@@ -832,7 +832,7 @@ pub const MetadataBlock = struct {...@@ -832,7 +832,7 @@ pub const MetadataBlock = struct {
832 pub const DerivedType = struct {832 pub const DerivedType = struct {
833 pub const ops = [_]AbbrevOp{833 pub const ops = [_]AbbrevOp{
834 .{ .literal = 17 },834 .{ .literal = 17 },
835 .{ .literal = 1 }, // is distinct835 .{ .literal = 0 }, // is distinct
836 .{ .fixed = 32 }, // tag836 .{ .fixed = 32 }, // tag
837 MetadataAbbrev, // name837 MetadataAbbrev, // name
838 MetadataAbbrev, // file838 MetadataAbbrev, // file
...@@ -860,7 +860,7 @@ pub const MetadataBlock = struct {...@@ -860,7 +860,7 @@ pub const MetadataBlock = struct {
860 pub const SubroutineType = struct {860 pub const SubroutineType = struct {
861 pub const ops = [_]AbbrevOp{861 pub const ops = [_]AbbrevOp{
862 .{ .literal = 19 },862 .{ .literal = 19 },
863 .{ .literal = 1 | 0x2 }, // is distinct | has no old type refs863 .{ .literal = 0 | 0x2 }, // is distinct | has no old type refs
864 .{ .literal = 0 }, // flags864 .{ .literal = 0 }, // flags
865 MetadataAbbrev, // types865 MetadataAbbrev, // types
866 .{ .literal = 0 }, // cc866 .{ .literal = 0 }, // cc
...@@ -895,7 +895,7 @@ pub const MetadataBlock = struct {...@@ -895,7 +895,7 @@ pub const MetadataBlock = struct {
895 pub const Subrange = struct {895 pub const Subrange = struct {
896 pub const ops = [_]AbbrevOp{896 pub const ops = [_]AbbrevOp{
897 .{ .literal = 13 },897 .{ .literal = 13 },
898 .{ .literal = 0b11 }, // is distinct | version898 .{ .literal = 0b10 }, // is distinct | version
899 MetadataAbbrev, // count899 MetadataAbbrev, // count
900 MetadataAbbrev, // lower bound900 MetadataAbbrev, // lower bound
901 .{ .literal = 0 }, // upper bound901 .{ .literal = 0 }, // upper bound
...@@ -928,7 +928,7 @@ pub const MetadataBlock = struct {...@@ -928,7 +928,7 @@ pub const MetadataBlock = struct {
928 pub const LocalVar = struct {928 pub const LocalVar = struct {
929 pub const ops = [_]AbbrevOp{929 pub const ops = [_]AbbrevOp{
930 .{ .literal = 28 },930 .{ .literal = 28 },
931 .{ .literal = 0b11 }, // is distinct | has alignment931 .{ .literal = 0b10 }, // is distinct | has alignment
932 MetadataAbbrev, // scope932 MetadataAbbrev, // scope
933 MetadataAbbrev, // name933 MetadataAbbrev, // name
934 MetadataAbbrev, // file934 MetadataAbbrev, // file
...@@ -950,7 +950,7 @@ pub const MetadataBlock = struct {...@@ -950,7 +950,7 @@ pub const MetadataBlock = struct {
950 pub const Parameter = struct {950 pub const Parameter = struct {
951 pub const ops = [_]AbbrevOp{951 pub const ops = [_]AbbrevOp{
952 .{ .literal = 28 },952 .{ .literal = 28 },
953 .{ .literal = 0b11 }, // is distinct | has alignment953 .{ .literal = 0b10 }, // is distinct | has alignment
954 MetadataAbbrev, // scope954 MetadataAbbrev, // scope
955 MetadataAbbrev, // name955 MetadataAbbrev, // name
956 MetadataAbbrev, // file956 MetadataAbbrev, // file
...@@ -1000,7 +1000,7 @@ pub const MetadataBlock = struct {...@@ -1000,7 +1000,7 @@ pub const MetadataBlock = struct {
1000 pub const GlobalVarExpression = struct {1000 pub const GlobalVarExpression = struct {
1001 pub const ops = [_]AbbrevOp{1001 pub const ops = [_]AbbrevOp{
1002 .{ .literal = 37 },1002 .{ .literal = 37 },
1003 .{ .literal = 1 }, // is distinct1003 .{ .literal = 0 }, // is distinct
1004 MetadataAbbrev, // variable1004 MetadataAbbrev, // variable
1005 MetadataAbbrev, // expression1005 MetadataAbbrev, // expression
1006 };1006 };