@@ -20,7 +20,6 @@ use std::ptr;
20
20
use bitflags:: bitflags;
21
21
use libc:: { c_char, c_int, c_uchar, c_uint, c_ulonglong, c_void, size_t} ;
22
22
use rustc_macros:: TryFromU32 ;
23
- use rustc_target:: spec:: SymbolVisibility ;
24
23
25
24
use super :: RustString ;
26
25
use super :: debuginfo:: {
@@ -220,16 +219,6 @@ pub(crate) enum Visibility {
220
219
Protected = 2 ,
221
220
}
222
221
223
- impl Visibility {
224
- pub ( crate ) fn from_generic ( visibility : SymbolVisibility ) -> Self {
225
- match visibility {
226
- SymbolVisibility :: Hidden => Visibility :: Hidden ,
227
- SymbolVisibility :: Protected => Visibility :: Protected ,
228
- SymbolVisibility :: Interposable => Visibility :: Default ,
229
- }
230
- }
231
- }
232
-
233
222
/// LLVMUnnamedAddr
234
223
#[ repr( C ) ]
235
224
pub ( crate ) enum UnnamedAddr {
@@ -319,24 +308,6 @@ pub(crate) enum IntPredicate {
319
308
IntSLE = 41 ,
320
309
}
321
310
322
- impl IntPredicate {
323
- pub ( crate ) fn from_generic ( intpre : rustc_codegen_ssa:: common:: IntPredicate ) -> Self {
324
- use rustc_codegen_ssa:: common:: IntPredicate as Common ;
325
- match intpre {
326
- Common :: IntEQ => Self :: IntEQ ,
327
- Common :: IntNE => Self :: IntNE ,
328
- Common :: IntUGT => Self :: IntUGT ,
329
- Common :: IntUGE => Self :: IntUGE ,
330
- Common :: IntULT => Self :: IntULT ,
331
- Common :: IntULE => Self :: IntULE ,
332
- Common :: IntSGT => Self :: IntSGT ,
333
- Common :: IntSGE => Self :: IntSGE ,
334
- Common :: IntSLT => Self :: IntSLT ,
335
- Common :: IntSLE => Self :: IntSLE ,
336
- }
337
- }
338
- }
339
-
340
311
/// LLVMRealPredicate
341
312
#[ derive( Copy , Clone ) ]
342
313
#[ repr( C ) ]
@@ -359,30 +330,6 @@ pub(crate) enum RealPredicate {
359
330
RealPredicateTrue = 15 ,
360
331
}
361
332
362
- impl RealPredicate {
363
- pub ( crate ) fn from_generic ( realp : rustc_codegen_ssa:: common:: RealPredicate ) -> Self {
364
- use rustc_codegen_ssa:: common:: RealPredicate as Common ;
365
- match realp {
366
- Common :: RealPredicateFalse => Self :: RealPredicateFalse ,
367
- Common :: RealOEQ => Self :: RealOEQ ,
368
- Common :: RealOGT => Self :: RealOGT ,
369
- Common :: RealOGE => Self :: RealOGE ,
370
- Common :: RealOLT => Self :: RealOLT ,
371
- Common :: RealOLE => Self :: RealOLE ,
372
- Common :: RealONE => Self :: RealONE ,
373
- Common :: RealORD => Self :: RealORD ,
374
- Common :: RealUNO => Self :: RealUNO ,
375
- Common :: RealUEQ => Self :: RealUEQ ,
376
- Common :: RealUGT => Self :: RealUGT ,
377
- Common :: RealUGE => Self :: RealUGE ,
378
- Common :: RealULT => Self :: RealULT ,
379
- Common :: RealULE => Self :: RealULE ,
380
- Common :: RealUNE => Self :: RealUNE ,
381
- Common :: RealPredicateTrue => Self :: RealPredicateTrue ,
382
- }
383
- }
384
- }
385
-
386
333
/// Must match the layout of `LLVMTypeKind`.
387
334
///
388
335
/// Use [`RawEnum<TypeKind>`] for values of `LLVMTypeKind` returned from LLVM,
@@ -458,25 +405,6 @@ pub(crate) enum AtomicRmwBinOp {
458
405
AtomicUMin = 10 ,
459
406
}
460
407
461
- impl AtomicRmwBinOp {
462
- pub ( crate ) fn from_generic ( op : rustc_codegen_ssa:: common:: AtomicRmwBinOp ) -> Self {
463
- use rustc_codegen_ssa:: common:: AtomicRmwBinOp as Common ;
464
- match op {
465
- Common :: AtomicXchg => Self :: AtomicXchg ,
466
- Common :: AtomicAdd => Self :: AtomicAdd ,
467
- Common :: AtomicSub => Self :: AtomicSub ,
468
- Common :: AtomicAnd => Self :: AtomicAnd ,
469
- Common :: AtomicNand => Self :: AtomicNand ,
470
- Common :: AtomicOr => Self :: AtomicOr ,
471
- Common :: AtomicXor => Self :: AtomicXor ,
472
- Common :: AtomicMax => Self :: AtomicMax ,
473
- Common :: AtomicMin => Self :: AtomicMin ,
474
- Common :: AtomicUMax => Self :: AtomicUMax ,
475
- Common :: AtomicUMin => Self :: AtomicUMin ,
476
- }
477
- }
478
- }
479
-
480
408
/// LLVMAtomicOrdering
481
409
#[ derive( Copy , Clone ) ]
482
410
#[ repr( C ) ]
@@ -493,19 +421,6 @@ pub(crate) enum AtomicOrdering {
493
421
SequentiallyConsistent = 7 ,
494
422
}
495
423
496
- impl AtomicOrdering {
497
- pub ( crate ) fn from_generic ( ao : rustc_middle:: ty:: AtomicOrdering ) -> Self {
498
- use rustc_middle:: ty:: AtomicOrdering as Common ;
499
- match ao {
500
- Common :: Relaxed => Self :: Monotonic ,
501
- Common :: Acquire => Self :: Acquire ,
502
- Common :: Release => Self :: Release ,
503
- Common :: AcqRel => Self :: AcquireRelease ,
504
- Common :: SeqCst => Self :: SequentiallyConsistent ,
505
- }
506
- }
507
- }
508
-
509
424
/// LLVMRustFileType
510
425
#[ derive( Copy , Clone ) ]
511
426
#[ repr( C ) ]
@@ -940,28 +855,6 @@ pub(crate) mod debuginfo {
940
855
DebugDirectivesOnly ,
941
856
}
942
857
943
- impl DebugEmissionKind {
944
- pub ( crate ) fn from_generic ( kind : rustc_session:: config:: DebugInfo ) -> Self {
945
- // We should be setting LLVM's emission kind to `LineTablesOnly` if
946
- // we are compiling with "limited" debuginfo. However, some of the
947
- // existing tools relied on slightly more debuginfo being generated than
948
- // would be the case with `LineTablesOnly`, and we did not want to break
949
- // these tools in a "drive-by fix", without a good idea or plan about
950
- // what limited debuginfo should exactly look like. So for now we are
951
- // instead adding a new debuginfo option "line-tables-only" so as to
952
- // not break anything and to allow users to have 'limited' debug info.
953
- //
954
- // See https://github.com/rust-lang/rust/issues/60020 for details.
955
- use rustc_session:: config:: DebugInfo ;
956
- match kind {
957
- DebugInfo :: None => DebugEmissionKind :: NoDebug ,
958
- DebugInfo :: LineDirectivesOnly => DebugEmissionKind :: DebugDirectivesOnly ,
959
- DebugInfo :: LineTablesOnly => DebugEmissionKind :: LineTablesOnly ,
960
- DebugInfo :: Limited | DebugInfo :: Full => DebugEmissionKind :: FullDebug ,
961
- }
962
- }
963
- }
964
-
965
858
/// LLVMRustDebugNameTableKind
966
859
#[ derive( Clone , Copy ) ]
967
860
#[ repr( C ) ]
0 commit comments