@@ -30,6 +30,9 @@ public static unsafe partial class LLVM
30
30
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLanaiTargetInfo" , ExactSpelling = true ) ]
31
31
public static extern void InitializeLanaiTargetInfo ( ) ;
32
32
33
+ [ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLoongArchTargetInfo" , ExactSpelling = true ) ]
34
+ public static extern void InitializeLoongArchTargetInfo ( ) ;
35
+
33
36
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeMipsTargetInfo" , ExactSpelling = true ) ]
34
37
public static extern void InitializeMipsTargetInfo ( ) ;
35
38
@@ -84,6 +87,9 @@ public static unsafe partial class LLVM
84
87
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLanaiTarget" , ExactSpelling = true ) ]
85
88
public static extern void InitializeLanaiTarget ( ) ;
86
89
90
+ [ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLoongArchTarget" , ExactSpelling = true ) ]
91
+ public static extern void InitializeLoongArchTarget ( ) ;
92
+
87
93
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeMipsTarget" , ExactSpelling = true ) ]
88
94
public static extern void InitializeMipsTarget ( ) ;
89
95
@@ -138,6 +144,9 @@ public static unsafe partial class LLVM
138
144
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLanaiTargetMC" , ExactSpelling = true ) ]
139
145
public static extern void InitializeLanaiTargetMC ( ) ;
140
146
147
+ [ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLoongArchTargetMC" , ExactSpelling = true ) ]
148
+ public static extern void InitializeLoongArchTargetMC ( ) ;
149
+
141
150
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeMipsTargetMC" , ExactSpelling = true ) ]
142
151
public static extern void InitializeMipsTargetMC ( ) ;
143
152
@@ -192,6 +201,9 @@ public static unsafe partial class LLVM
192
201
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLanaiAsmPrinter" , ExactSpelling = true ) ]
193
202
public static extern void InitializeLanaiAsmPrinter ( ) ;
194
203
204
+ [ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLoongArchAsmPrinter" , ExactSpelling = true ) ]
205
+ public static extern void InitializeLoongArchAsmPrinter ( ) ;
206
+
195
207
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeMipsAsmPrinter" , ExactSpelling = true ) ]
196
208
public static extern void InitializeMipsAsmPrinter ( ) ;
197
209
@@ -246,6 +258,9 @@ public static unsafe partial class LLVM
246
258
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLanaiAsmParser" , ExactSpelling = true ) ]
247
259
public static extern void InitializeLanaiAsmParser ( ) ;
248
260
261
+ [ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLoongArchAsmParser" , ExactSpelling = true ) ]
262
+ public static extern void InitializeLoongArchAsmParser ( ) ;
263
+
249
264
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeMipsAsmParser" , ExactSpelling = true ) ]
250
265
public static extern void InitializeMipsAsmParser ( ) ;
251
266
@@ -294,6 +309,9 @@ public static unsafe partial class LLVM
294
309
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLanaiDisassembler" , ExactSpelling = true ) ]
295
310
public static extern void InitializeLanaiDisassembler ( ) ;
296
311
312
+ [ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeLoongArchDisassembler" , ExactSpelling = true ) ]
313
+ public static extern void InitializeLoongArchDisassembler ( ) ;
314
+
297
315
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeMipsDisassembler" , ExactSpelling = true ) ]
298
316
public static extern void InitializeMipsDisassembler ( ) ;
299
317
@@ -323,4 +341,326 @@ public static unsafe partial class LLVM
323
341
324
342
[ DllImport ( "libLLVM" , CallingConvention = CallingConvention . Cdecl , EntryPoint = "LLVMInitializeXCoreDisassembler" , ExactSpelling = true ) ]
325
343
public static extern void InitializeXCoreDisassembler ( ) ;
344
+
345
+ [ return : NativeTypeName ( "LLVMBool" ) ]
346
+ public static int InitializeNativeTarget ( )
347
+ {
348
+ switch ( RuntimeInformation . ProcessArchitecture )
349
+ {
350
+ case Architecture . X86 :
351
+ case Architecture . X64 :
352
+ {
353
+ InitializeX86TargetInfo ( ) ;
354
+ InitializeX86Target ( ) ;
355
+ InitializeX86TargetMC ( ) ;
356
+ return 0 ;
357
+ }
358
+
359
+ case Architecture . Arm :
360
+ #if NET7_0_OR_GREATER
361
+ case Architecture . Armv6:
362
+ #else
363
+ case ( Architecture ) ( 7 ) :
364
+ #endif
365
+ {
366
+ InitializeARMTargetInfo( ) ;
367
+ InitializeARMTarget ( ) ;
368
+ InitializeARMTargetMC ( ) ;
369
+ return 0 ;
370
+ }
371
+
372
+ case Architecture . Arm64:
373
+ {
374
+ InitializeAArch64TargetInfo ( ) ;
375
+ InitializeAArch64Target ( ) ;
376
+ InitializeAArch64TargetMC ( ) ;
377
+ return 0 ;
378
+ }
379
+
380
+ #if NET6_0_OR_GREATER
381
+ case Architecture . Wasm:
382
+ #else
383
+ case ( Architecture ) ( 4 ) :
384
+ #endif
385
+ {
386
+ InitializeWebAssemblyTargetInfo( ) ;
387
+ InitializeWebAssemblyTarget ( ) ;
388
+ InitializeWebAssemblyTargetMC ( ) ;
389
+ return 0 ;
390
+ }
391
+
392
+ #if NET6_0_OR_GREATER
393
+ case Architecture . S390x :
394
+ #else
395
+ case ( Architecture ) ( 5 ) :
396
+ #endif
397
+ {
398
+ InitializeSystemZTargetInfo ( ) ;
399
+ InitializeSystemZTarget ( ) ;
400
+ InitializeSystemZTargetMC ( ) ;
401
+ return 0 ;
402
+ }
403
+
404
+ #if NET7_0_OR_GREATER
405
+ case Architecture . LoongArch64 :
406
+ #else
407
+ case ( Architecture ) ( 6 ) :
408
+ #endif
409
+ {
410
+ InitializeLoongArchTargetInfo ( ) ;
411
+ InitializeLoongArchTarget ( ) ;
412
+ InitializeLoongArchTargetMC ( ) ;
413
+ return 0 ;
414
+ }
415
+
416
+ #if NET7_0_OR_GREATER
417
+ case Architecture . Ppc64le :
418
+ #else
419
+ case ( Architecture ) ( 8 ) :
420
+ #endif
421
+ {
422
+ InitializePowerPCTargetInfo ( ) ;
423
+ InitializePowerPCTarget ( ) ;
424
+ InitializePowerPCTargetMC ( ) ;
425
+ return 0 ;
426
+ }
427
+
428
+
429
+ default :
430
+ {
431
+ return 1 ;
432
+ }
433
+ }
434
+ }
435
+
436
+ [ return : NativeTypeName( "LLVMBool" ) ]
437
+ public static int InitializeNativeAsmParser ( )
438
+ {
439
+ switch ( RuntimeInformation . ProcessArchitecture )
440
+ {
441
+ case Architecture . X86 :
442
+ case Architecture . X64 :
443
+ {
444
+ InitializeX86AsmParser ( ) ;
445
+ return 0 ;
446
+ }
447
+
448
+ case Architecture . Arm :
449
+ #if NET7_0_OR_GREATER
450
+ case Architecture . Armv6:
451
+ #else
452
+ case ( Architecture ) ( 7 ) :
453
+ #endif
454
+ {
455
+ InitializeARMAsmParser( ) ;
456
+ return 0 ;
457
+ }
458
+
459
+ case Architecture . Arm64:
460
+ {
461
+ InitializeAArch64AsmParser ( ) ;
462
+ return 0 ;
463
+ }
464
+
465
+ #if NET6_0_OR_GREATER
466
+ case Architecture . Wasm:
467
+ #else
468
+ case ( Architecture ) ( 4 ) :
469
+ #endif
470
+ {
471
+ InitializeWebAssemblyAsmParser( ) ;
472
+ return 0 ;
473
+ }
474
+
475
+ #if NET6_0_OR_GREATER
476
+ case Architecture . S390x :
477
+ #else
478
+ case ( Architecture ) ( 5 ) :
479
+ #endif
480
+ {
481
+ InitializeSystemZAsmParser ( ) ;
482
+ return 0 ;
483
+ }
484
+
485
+ #if NET7_0_OR_GREATER
486
+ case Architecture . LoongArch64 :
487
+ #else
488
+ case ( Architecture ) ( 6 ) :
489
+ #endif
490
+ {
491
+ InitializeLoongArchAsmParser ( ) ;
492
+ return 0 ;
493
+ }
494
+
495
+ #if NET7_0_OR_GREATER
496
+ case Architecture . Ppc64le :
497
+ #else
498
+ case ( Architecture ) ( 8 ) :
499
+ #endif
500
+ {
501
+ InitializePowerPCAsmParser ( ) ;
502
+ return 0 ;
503
+ }
504
+
505
+
506
+ default :
507
+ {
508
+ return 1 ;
509
+ }
510
+ }
511
+ }
512
+
513
+ [ return : NativeTypeName( "LLVMBool" ) ]
514
+ public static int InitializeNativeAsmPrinter ( )
515
+ {
516
+ switch ( RuntimeInformation . ProcessArchitecture )
517
+ {
518
+ case Architecture . X86 :
519
+ case Architecture . X64 :
520
+ {
521
+ InitializeX86AsmPrinter ( ) ;
522
+ return 0 ;
523
+ }
524
+
525
+ case Architecture . Arm :
526
+ #if NET7_0_OR_GREATER
527
+ case Architecture . Armv6:
528
+ #else
529
+ case ( Architecture ) ( 7 ) :
530
+ #endif
531
+ {
532
+ InitializeARMAsmPrinter( ) ;
533
+ return 0 ;
534
+ }
535
+
536
+ case Architecture . Arm64:
537
+ {
538
+ InitializeAArch64AsmPrinter ( ) ;
539
+ return 0 ;
540
+ }
541
+
542
+ #if NET6_0_OR_GREATER
543
+ case Architecture . Wasm:
544
+ #else
545
+ case ( Architecture ) ( 4 ) :
546
+ #endif
547
+ {
548
+ InitializeWebAssemblyAsmPrinter( ) ;
549
+ return 0 ;
550
+ }
551
+
552
+ #if NET6_0_OR_GREATER
553
+ case Architecture . S390x :
554
+ #else
555
+ case ( Architecture ) ( 5 ) :
556
+ #endif
557
+ {
558
+ InitializeSystemZAsmPrinter ( ) ;
559
+ return 0 ;
560
+ }
561
+
562
+ #if NET7_0_OR_GREATER
563
+ case Architecture . LoongArch64 :
564
+ #else
565
+ case ( Architecture ) ( 6 ) :
566
+ #endif
567
+ {
568
+ InitializeLoongArchAsmPrinter ( ) ;
569
+ return 0 ;
570
+ }
571
+
572
+ #if NET7_0_OR_GREATER
573
+ case Architecture . Ppc64le :
574
+ #else
575
+ case ( Architecture ) ( 8 ) :
576
+ #endif
577
+ {
578
+ InitializePowerPCAsmPrinter ( ) ;
579
+ return 0 ;
580
+ }
581
+
582
+
583
+ default :
584
+ {
585
+ return 1 ;
586
+ }
587
+ }
588
+ }
589
+
590
+ [ return : NativeTypeName( "LLVMBool" ) ]
591
+ public static int InitializeNativeDisassembler ( )
592
+ {
593
+ switch ( RuntimeInformation . ProcessArchitecture )
594
+ {
595
+ case Architecture . X86 :
596
+ case Architecture . X64 :
597
+ {
598
+ InitializeX86Disassembler ( ) ;
599
+ return 0 ;
600
+ }
601
+
602
+ case Architecture . Arm :
603
+ #if NET7_0_OR_GREATER
604
+ case Architecture . Armv6:
605
+ #else
606
+ case ( Architecture ) ( 7 ) :
607
+ #endif
608
+ {
609
+ InitializeARMDisassembler( ) ;
610
+ return 0 ;
611
+ }
612
+
613
+ case Architecture . Arm64:
614
+ {
615
+ InitializeAArch64Disassembler ( ) ;
616
+ return 0 ;
617
+ }
618
+
619
+ #if NET6_0_OR_GREATER
620
+ case Architecture . Wasm:
621
+ #else
622
+ case ( Architecture ) ( 4 ) :
623
+ #endif
624
+ {
625
+ InitializeWebAssemblyDisassembler( ) ;
626
+ return 0 ;
627
+ }
628
+
629
+ #if NET6_0_OR_GREATER
630
+ case Architecture . S390x :
631
+ #else
632
+ case ( Architecture ) ( 5 ) :
633
+ #endif
634
+ {
635
+ InitializeSystemZDisassembler ( ) ;
636
+ return 0 ;
637
+ }
638
+
639
+ #if NET7_0_OR_GREATER
640
+ case Architecture . LoongArch64 :
641
+ #else
642
+ case ( Architecture ) ( 6 ) :
643
+ #endif
644
+ {
645
+ InitializeLoongArchDisassembler ( ) ;
646
+ return 0 ;
647
+ }
648
+
649
+ #if NET7_0_OR_GREATER
650
+ case Architecture . Ppc64le :
651
+ #else
652
+ case ( Architecture ) ( 8 ) :
653
+ #endif
654
+ {
655
+ InitializePowerPCDisassembler ( ) ;
656
+ return 0 ;
657
+ }
658
+
659
+
660
+ default :
661
+ {
662
+ return 1 ;
663
+ }
664
+ }
665
+ }
326
666
}
0 commit comments