@@ -722,28 +722,13 @@ impl block {
722
722
723
723
// LLVM type constructors.
724
724
fn T_void ( ) -> TypeRef {
725
- // Note: For the time being llvm is kinda busted here, it has the notion
726
- // of a 'void' type that can only occur as part of the signature of a
727
- // function, but no general unit type of 0-sized value. This is, afaict,
728
- // vestigial from its C heritage, and we'll be attempting to submit a
729
- // patch upstream to fix it. In the mean time we only model function
730
- // outputs (Rust functions and C functions) using T_void, and model the
731
- // Rust general purpose nil type you can construct as 1-bit (always
732
- // zero). This makes the result incorrect for now -- things like a tuple
733
- // of 10 nil values will have 10-bit size -- but it doesn't seem like we
734
- // have any other options until it's fixed upstream.
735
-
736
725
unsafe {
737
726
return llvm:: LLVMVoidType ( ) ;
738
727
}
739
728
}
740
729
741
730
fn T_nil ( ) -> TypeRef {
742
- // NB: See above in T_void().
743
-
744
- unsafe {
745
- return llvm:: LLVMInt1Type ( ) ;
746
- }
731
+ return T_struct ( ~[ ] )
747
732
}
748
733
749
734
fn T_metadata ( ) -> TypeRef { unsafe { return llvm:: LLVMMetadataType ( ) ; } }
@@ -1098,9 +1083,7 @@ fn C_floating(s: ~str, t: TypeRef) -> ValueRef {
1098
1083
}
1099
1084
1100
1085
fn C_nil ( ) -> ValueRef {
1101
- // NB: See comment above in T_void().
1102
-
1103
- return C_integral ( T_i1 ( ) , 0u64 , False ) ;
1086
+ return C_struct ( ~[ ] ) ;
1104
1087
}
1105
1088
1106
1089
fn C_bool ( b : bool ) -> ValueRef {
0 commit comments