@@ -215,6 +215,7 @@ pub const File = struct {
215
215
c : void ,
216
216
wasm : Wasm.DeclBlock ,
217
217
spirv : void ,
218
+ nvptx : void ,
218
219
};
219
220
220
221
pub const LinkFn = union {
@@ -225,6 +226,7 @@ pub const File = struct {
225
226
c : void ,
226
227
wasm : Wasm.FnData ,
227
228
spirv : SpirV.FnData ,
229
+ nvptx : void ,
228
230
};
229
231
230
232
pub const Export = union {
@@ -235,6 +237,7 @@ pub const File = struct {
235
237
c : void ,
236
238
wasm : void ,
237
239
spirv : void ,
240
+ nvptx : void ,
238
241
};
239
242
240
243
/// For DWARF .debug_info.
@@ -274,6 +277,7 @@ pub const File = struct {
274
277
.plan9 = > return &(try Plan9 .createEmpty (allocator , options )).base ,
275
278
.c = > unreachable , // Reported error earlier.
276
279
.spirv = > &(try SpirV .createEmpty (allocator , options )).base ,
280
+ .nvptx = > &(try NvPtx .createEmpty (allocator , options )).base ,
277
281
.hex = > return error .HexObjectFormatUnimplemented ,
278
282
.raw = > return error .RawObjectFormatUnimplemented ,
279
283
};
@@ -292,6 +296,7 @@ pub const File = struct {
292
296
.wasm = > &(try Wasm .createEmpty (allocator , options )).base ,
293
297
.c = > unreachable , // Reported error earlier.
294
298
.spirv = > &(try SpirV .createEmpty (allocator , options )).base ,
299
+ .nvptx = > &(try NvPtx .createEmpty (allocator , options )).base ,
295
300
.hex = > return error .HexObjectFormatUnimplemented ,
296
301
.raw = > return error .RawObjectFormatUnimplemented ,
297
302
};
@@ -312,6 +317,7 @@ pub const File = struct {
312
317
.wasm = > &(try Wasm .openPath (allocator , sub_path , options )).base ,
313
318
.c = > &(try C .openPath (allocator , sub_path , options )).base ,
314
319
.spirv = > &(try SpirV .openPath (allocator , sub_path , options )).base ,
320
+ .nvptx = > &(try NvPtx .openPath (allocator , sub_path , options )).base ,
315
321
.hex = > return error .HexObjectFormatUnimplemented ,
316
322
.raw = > return error .RawObjectFormatUnimplemented ,
317
323
};
@@ -344,7 +350,7 @@ pub const File = struct {
344
350
.mode = determineMode (base .options ),
345
351
});
346
352
},
347
- .c , .wasm , .spirv = > {},
353
+ .c , .wasm , .spirv , .nvptx = > {},
348
354
}
349
355
}
350
356
@@ -389,7 +395,7 @@ pub const File = struct {
389
395
f .close ();
390
396
base .file = null ;
391
397
},
392
- .c , .wasm , .spirv = > {},
398
+ .c , .wasm , .spirv , .nvptx = > {},
393
399
}
394
400
}
395
401
@@ -437,6 +443,7 @@ pub const File = struct {
437
443
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).updateDecl (module , decl ),
438
444
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).updateDecl (module , decl ),
439
445
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).updateDecl (module , decl ),
446
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).updateDecl (module , decl ),
440
447
// zig fmt: on
441
448
}
442
449
}
@@ -456,6 +463,7 @@ pub const File = struct {
456
463
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).updateFunc (module , func , air , liveness ),
457
464
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).updateFunc (module , func , air , liveness ),
458
465
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).updateFunc (module , func , air , liveness ),
466
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).updateFunc (module , func , air , liveness ),
459
467
// zig fmt: on
460
468
}
461
469
}
@@ -471,7 +479,7 @@ pub const File = struct {
471
479
.macho = > return @fieldParentPtr (MachO , "base" , base ).updateDeclLineNumber (module , decl ),
472
480
.c = > return @fieldParentPtr (C , "base" , base ).updateDeclLineNumber (module , decl ),
473
481
.plan9 = > @panic ("TODO: implement updateDeclLineNumber for plan9" ),
474
- .wasm , .spirv = > {},
482
+ .wasm , .spirv , .nvptx = > {},
475
483
}
476
484
}
477
485
@@ -493,7 +501,7 @@ pub const File = struct {
493
501
},
494
502
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).allocateDeclIndexes (decl ),
495
503
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).allocateDeclIndexes (decl ),
496
- .c , .spirv = > {},
504
+ .c , .spirv , .nvptx = > {},
497
505
}
498
506
}
499
507
@@ -551,6 +559,11 @@ pub const File = struct {
551
559
parent .deinit ();
552
560
base .allocator .destroy (parent );
553
561
},
562
+ .nvptx = > {
563
+ const parent = @fieldParentPtr (NvPtx , "base" , base );
564
+ parent .deinit ();
565
+ base .allocator .destroy (parent );
566
+ },
554
567
}
555
568
}
556
569
@@ -584,6 +597,7 @@ pub const File = struct {
584
597
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).flush (comp ),
585
598
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).flush (comp ),
586
599
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).flush (comp ),
600
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).flush (comp ),
587
601
}
588
602
}
589
603
@@ -598,6 +612,7 @@ pub const File = struct {
598
612
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).flushModule (comp ),
599
613
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).flushModule (comp ),
600
614
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).flushModule (comp ),
615
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).flushModule (comp ),
601
616
}
602
617
}
603
618
@@ -612,6 +627,7 @@ pub const File = struct {
612
627
.wasm = > @fieldParentPtr (Wasm , "base" , base ).freeDecl (decl ),
613
628
.spirv = > @fieldParentPtr (SpirV , "base" , base ).freeDecl (decl ),
614
629
.plan9 = > @fieldParentPtr (Plan9 , "base" , base ).freeDecl (decl ),
630
+ .nvptx = > @fieldParentPtr (NvPtx , "base" , base ).freeDecl (decl ),
615
631
}
616
632
}
617
633
@@ -622,7 +638,7 @@ pub const File = struct {
622
638
.macho = > return @fieldParentPtr (MachO , "base" , base ).error_flags ,
623
639
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).error_flags ,
624
640
.c = > return .{ .no_entry_point_found = false },
625
- .wasm , .spirv = > return ErrorFlags {},
641
+ .wasm , .spirv , .nvptx = > return ErrorFlags {},
626
642
}
627
643
}
628
644
@@ -644,6 +660,7 @@ pub const File = struct {
644
660
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).updateDeclExports (module , decl , exports ),
645
661
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).updateDeclExports (module , decl , exports ),
646
662
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).updateDeclExports (module , decl , exports ),
663
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).updateDeclExports (module , decl , exports ),
647
664
}
648
665
}
649
666
@@ -656,6 +673,7 @@ pub const File = struct {
656
673
.c = > unreachable ,
657
674
.wasm = > unreachable ,
658
675
.spirv = > unreachable ,
676
+ .nvptx = > unreachable ,
659
677
}
660
678
}
661
679
@@ -851,6 +869,7 @@ pub const File = struct {
851
869
wasm ,
852
870
spirv ,
853
871
plan9 ,
872
+ nvptx ,
854
873
};
855
874
856
875
pub const ErrorFlags = struct {
@@ -864,6 +883,7 @@ pub const File = struct {
864
883
pub const MachO = @import ("link/MachO.zig" );
865
884
pub const SpirV = @import ("link/SpirV.zig" );
866
885
pub const Wasm = @import ("link/Wasm.zig" );
886
+ pub const NvPtx = @import ("link/NvPtx.zig" );
867
887
};
868
888
869
889
pub fn determineMode (options : Options ) fs.File.Mode {
0 commit comments