@@ -211,6 +211,7 @@ pub const File = struct {
211
211
c : void ,
212
212
wasm : Wasm.DeclBlock ,
213
213
spirv : void ,
214
+ nvptx : void ,
214
215
};
215
216
216
217
pub const LinkFn = union {
@@ -221,6 +222,7 @@ pub const File = struct {
221
222
c : void ,
222
223
wasm : Wasm.FnData ,
223
224
spirv : SpirV.FnData ,
225
+ nvptx : void ,
224
226
};
225
227
226
228
pub const Export = union {
@@ -231,6 +233,7 @@ pub const File = struct {
231
233
c : void ,
232
234
wasm : void ,
233
235
spirv : void ,
236
+ nvptx : void ,
234
237
};
235
238
236
239
/// For DWARF .debug_info.
@@ -265,6 +268,7 @@ pub const File = struct {
265
268
.plan9 = > return &(try Plan9 .createEmpty (allocator , options )).base ,
266
269
.c = > unreachable , // Reported error earlier.
267
270
.spirv = > &(try SpirV .createEmpty (allocator , options )).base ,
271
+ .nvptx = > &(try NvPtx .createEmpty (allocator , options )).base ,
268
272
.hex = > return error .HexObjectFormatUnimplemented ,
269
273
.raw = > return error .RawObjectFormatUnimplemented ,
270
274
};
@@ -283,6 +287,7 @@ pub const File = struct {
283
287
.wasm = > &(try Wasm .createEmpty (allocator , options )).base ,
284
288
.c = > unreachable , // Reported error earlier.
285
289
.spirv = > &(try SpirV .createEmpty (allocator , options )).base ,
290
+ .nvptx = > &(try NvPtx .createEmpty (allocator , options )).base ,
286
291
.hex = > return error .HexObjectFormatUnimplemented ,
287
292
.raw = > return error .RawObjectFormatUnimplemented ,
288
293
};
@@ -303,6 +308,7 @@ pub const File = struct {
303
308
.wasm = > &(try Wasm .openPath (allocator , sub_path , options )).base ,
304
309
.c = > &(try C .openPath (allocator , sub_path , options )).base ,
305
310
.spirv = > &(try SpirV .openPath (allocator , sub_path , options )).base ,
311
+ .nvptx = > &(try NvPtx .openPath (allocator , sub_path , options )).base ,
306
312
.hex = > return error .HexObjectFormatUnimplemented ,
307
313
.raw = > return error .RawObjectFormatUnimplemented ,
308
314
};
@@ -335,7 +341,7 @@ pub const File = struct {
335
341
.mode = determineMode (base .options ),
336
342
});
337
343
},
338
- .c , .wasm , .spirv = > {},
344
+ .c , .wasm , .spirv , .nvptx = > {},
339
345
}
340
346
}
341
347
@@ -380,7 +386,7 @@ pub const File = struct {
380
386
f .close ();
381
387
base .file = null ;
382
388
},
383
- .c , .wasm , .spirv = > {},
389
+ .c , .wasm , .spirv , .nvptx = > {},
384
390
}
385
391
}
386
392
@@ -428,6 +434,7 @@ pub const File = struct {
428
434
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).updateDecl (module , decl ),
429
435
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).updateDecl (module , decl ),
430
436
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).updateDecl (module , decl ),
437
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).updateDecl (module , decl ),
431
438
// zig fmt: on
432
439
}
433
440
}
@@ -447,6 +454,7 @@ pub const File = struct {
447
454
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).updateFunc (module , func , air , liveness ),
448
455
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).updateFunc (module , func , air , liveness ),
449
456
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).updateFunc (module , func , air , liveness ),
457
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).updateFunc (module , func , air , liveness ),
450
458
// zig fmt: on
451
459
}
452
460
}
@@ -462,7 +470,7 @@ pub const File = struct {
462
470
.macho = > return @fieldParentPtr (MachO , "base" , base ).updateDeclLineNumber (module , decl ),
463
471
.c = > return @fieldParentPtr (C , "base" , base ).updateDeclLineNumber (module , decl ),
464
472
.plan9 = > @panic ("TODO: implement updateDeclLineNumber for plan9" ),
465
- .wasm , .spirv = > {},
473
+ .wasm , .spirv , .nvptx = > {},
466
474
}
467
475
}
468
476
@@ -484,7 +492,7 @@ pub const File = struct {
484
492
},
485
493
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).allocateDeclIndexes (decl ),
486
494
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).allocateDeclIndexes (decl ),
487
- .c , .spirv = > {},
495
+ .c , .spirv , .nvptx = > {},
488
496
}
489
497
}
490
498
@@ -542,6 +550,11 @@ pub const File = struct {
542
550
parent .deinit ();
543
551
base .allocator .destroy (parent );
544
552
},
553
+ .nvptx = > {
554
+ const parent = @fieldParentPtr (NvPtx , "base" , base );
555
+ parent .deinit ();
556
+ base .allocator .destroy (parent );
557
+ },
545
558
}
546
559
}
547
560
@@ -575,6 +588,7 @@ pub const File = struct {
575
588
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).flush (comp ),
576
589
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).flush (comp ),
577
590
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).flush (comp ),
591
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).flush (comp ),
578
592
}
579
593
}
580
594
@@ -589,6 +603,7 @@ pub const File = struct {
589
603
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).flushModule (comp ),
590
604
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).flushModule (comp ),
591
605
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).flushModule (comp ),
606
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).flushModule (comp ),
592
607
}
593
608
}
594
609
@@ -603,6 +618,7 @@ pub const File = struct {
603
618
.wasm = > @fieldParentPtr (Wasm , "base" , base ).freeDecl (decl ),
604
619
.spirv = > @fieldParentPtr (SpirV , "base" , base ).freeDecl (decl ),
605
620
.plan9 = > @fieldParentPtr (Plan9 , "base" , base ).freeDecl (decl ),
621
+ .nvptx = > @fieldParentPtr (NvPtx , "base" , base ).freeDecl (decl ),
606
622
}
607
623
}
608
624
@@ -613,7 +629,7 @@ pub const File = struct {
613
629
.macho = > return @fieldParentPtr (MachO , "base" , base ).error_flags ,
614
630
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).error_flags ,
615
631
.c = > return .{ .no_entry_point_found = false },
616
- .wasm , .spirv = > return ErrorFlags {},
632
+ .wasm , .spirv , .nvptx = > return ErrorFlags {},
617
633
}
618
634
}
619
635
@@ -635,6 +651,7 @@ pub const File = struct {
635
651
.wasm = > return @fieldParentPtr (Wasm , "base" , base ).updateDeclExports (module , decl , exports ),
636
652
.spirv = > return @fieldParentPtr (SpirV , "base" , base ).updateDeclExports (module , decl , exports ),
637
653
.plan9 = > return @fieldParentPtr (Plan9 , "base" , base ).updateDeclExports (module , decl , exports ),
654
+ .nvptx = > return @fieldParentPtr (NvPtx , "base" , base ).updateDeclExports (module , decl , exports ),
638
655
}
639
656
}
640
657
@@ -647,6 +664,7 @@ pub const File = struct {
647
664
.c = > unreachable ,
648
665
.wasm = > unreachable ,
649
666
.spirv = > unreachable ,
667
+ .nvptx = > unreachable ,
650
668
}
651
669
}
652
670
@@ -839,6 +857,7 @@ pub const File = struct {
839
857
wasm ,
840
858
spirv ,
841
859
plan9 ,
860
+ nvptx ,
842
861
};
843
862
844
863
pub const ErrorFlags = struct {
@@ -852,6 +871,7 @@ pub const File = struct {
852
871
pub const MachO = @import ("link/MachO.zig" );
853
872
pub const SpirV = @import ("link/SpirV.zig" );
854
873
pub const Wasm = @import ("link/Wasm.zig" );
874
+ pub const NvPtx = @import ("link/NvPtx.zig" );
855
875
};
856
876
857
877
pub fn determineMode (options : Options ) fs.File.Mode {
0 commit comments