@@ -20,7 +20,6 @@ use std::ptr;
2020use bitflags:: bitflags;
2121use libc:: { c_char, c_int, c_uchar, c_uint, c_ulonglong, c_void, size_t} ;
2222use rustc_macros:: TryFromU32 ;
23- use rustc_target:: spec:: SymbolVisibility ;
2423
2524use super :: RustString ;
2625use super :: debuginfo:: {
@@ -220,16 +219,6 @@ pub(crate) enum Visibility {
220219 Protected = 2 ,
221220}
222221
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-
233222/// LLVMUnnamedAddr
234223#[ repr( C ) ]
235224pub ( crate ) enum UnnamedAddr {
@@ -319,24 +308,6 @@ pub(crate) enum IntPredicate {
319308 IntSLE = 41 ,
320309}
321310
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-
340311/// LLVMRealPredicate
341312#[ derive( Copy , Clone ) ]
342313#[ repr( C ) ]
@@ -359,30 +330,6 @@ pub(crate) enum RealPredicate {
359330 RealPredicateTrue = 15 ,
360331}
361332
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-
386333/// Must match the layout of `LLVMTypeKind`.
387334///
388335/// Use [`RawEnum<TypeKind>`] for values of `LLVMTypeKind` returned from LLVM,
@@ -458,25 +405,6 @@ pub(crate) enum AtomicRmwBinOp {
458405 AtomicUMin = 10 ,
459406}
460407
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-
480408/// LLVMAtomicOrdering
481409#[ derive( Copy , Clone ) ]
482410#[ repr( C ) ]
@@ -493,19 +421,6 @@ pub(crate) enum AtomicOrdering {
493421 SequentiallyConsistent = 7 ,
494422}
495423
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-
509424/// LLVMRustFileType
510425#[ derive( Copy , Clone ) ]
511426#[ repr( C ) ]
@@ -940,28 +855,6 @@ pub(crate) mod debuginfo {
940855 DebugDirectivesOnly ,
941856 }
942857
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-
965858 /// LLVMRustDebugNameTableKind
966859 #[ derive( Clone , Copy ) ]
967860 #[ repr( C ) ]
0 commit comments