@@ -26,7 +26,6 @@ use cabi_asmjs;
26
26
use machine:: { llalign_of_min, llsize_of, llsize_of_real, llsize_of_store} ;
27
27
use type_:: Type ;
28
28
use type_of;
29
- use adt;
30
29
31
30
use rustc:: hir;
32
31
use rustc:: ty:: { self , Ty } ;
@@ -36,6 +35,7 @@ use std::cmp;
36
35
37
36
pub use syntax:: abi:: Abi ;
38
37
pub use rustc:: ty:: layout:: { FAT_PTR_ADDR , FAT_PTR_EXTRA } ;
38
+ use rustc:: ty:: layout:: Layout ;
39
39
40
40
#[ derive( Clone , Copy , PartialEq , Debug ) ]
41
41
enum ArgKind {
@@ -318,13 +318,10 @@ impl FnType {
318
318
if ty. is_integral ( ) {
319
319
arg. signedness = Some ( ty. is_signed ( ) ) ;
320
320
}
321
- // Rust enum types that map onto C enums (LLVM integers) also
322
- // need to follow the target ABI zero-/sign-extension rules.
323
- if let ty:: TyEnum ( ..) = ty. sty {
324
- if arg. ty . kind ( ) == llvm:: Integer {
325
- let repr = adt:: represent_type ( ccx, ty) ;
326
- arg. signedness = Some ( adt:: is_discr_signed ( & repr) ) ;
327
- }
321
+ // Rust enum types that map onto C enums also need to follow
322
+ // the target ABI zero-/sign-extension rules.
323
+ if let Layout :: CEnum { signed, .. } = * ccx. layout_of ( ty) {
324
+ arg. signedness = Some ( signed) ;
328
325
}
329
326
if llsize_of_real ( ccx, arg. ty ) == 0 {
330
327
// For some forsaken reason, x86_64-pc-windows-gnu
0 commit comments