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