@@ -35,7 +35,7 @@ use crate::attributes;
3535use crate :: common:: Funclet ;
3636use crate :: context:: { CodegenCx , FullCx , GenericCx , SCx } ;
3737use crate :: llvm:: {
38- self , AtomicOrdering , AtomicRmwBinOp , BasicBlock , False , GEPNoWrapFlags , Metadata , True ,
38+ self , AtomicOrdering , AtomicRmwBinOp , BasicBlock , GEPNoWrapFlags , Metadata , ToLlvmBool , True ,
3939} ;
4040use crate :: type_:: Type ;
4141use crate :: type_of:: LayoutLlvmExt ;
@@ -717,7 +717,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
717717 let mut const_llval = None ;
718718 let llty = place. layout . llvm_type ( self ) ;
719719 if let Some ( global) = llvm:: LLVMIsAGlobalVariable ( place. val . llval ) {
720- if llvm:: LLVMIsGlobalConstant ( global) == llvm :: True {
720+ if llvm:: LLVMIsGlobalConstant ( global) . is_true ( ) {
721721 if let Some ( init) = llvm:: LLVMGetInitializer ( global) {
722722 if self . val_ty ( init) == llty {
723723 const_llval = Some ( init) ;
@@ -1067,13 +1067,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
10671067
10681068 fn intcast ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type , is_signed : bool ) -> & ' ll Value {
10691069 unsafe {
1070- llvm:: LLVMBuildIntCast2 (
1071- self . llbuilder ,
1072- val,
1073- dest_ty,
1074- if is_signed { True } else { False } ,
1075- UNNAMED ,
1076- )
1070+ llvm:: LLVMBuildIntCast2 ( self . llbuilder , val, dest_ty, is_signed. to_llvm_bool ( ) , UNNAMED )
10771071 }
10781072 }
10791073
@@ -1317,7 +1311,6 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
13171311 failure_order : rustc_middle:: ty:: AtomicOrdering ,
13181312 weak : bool ,
13191313 ) -> ( & ' ll Value , & ' ll Value ) {
1320- let weak = if weak { llvm:: True } else { llvm:: False } ;
13211314 unsafe {
13221315 let value = llvm:: LLVMBuildAtomicCmpXchg (
13231316 self . llbuilder ,
@@ -1328,7 +1321,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
13281321 AtomicOrdering :: from_generic ( failure_order) ,
13291322 llvm:: False , // SingleThreaded
13301323 ) ;
1331- llvm:: LLVMSetWeak ( value, weak) ;
1324+ llvm:: LLVMSetWeak ( value, weak. to_llvm_bool ( ) ) ;
13321325 let val = self . extract_value ( value, 0 ) ;
13331326 let success = self . extract_value ( value, 1 ) ;
13341327 ( val, success)
@@ -1368,14 +1361,14 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
13681361 scope : SynchronizationScope ,
13691362 ) {
13701363 let single_threaded = match scope {
1371- SynchronizationScope :: SingleThread => llvm :: True ,
1372- SynchronizationScope :: CrossThread => llvm :: False ,
1364+ SynchronizationScope :: SingleThread => true ,
1365+ SynchronizationScope :: CrossThread => false ,
13731366 } ;
13741367 unsafe {
13751368 llvm:: LLVMBuildFence (
13761369 self . llbuilder ,
13771370 AtomicOrdering :: from_generic ( order) ,
1378- single_threaded,
1371+ single_threaded. to_llvm_bool ( ) ,
13791372 UNNAMED ,
13801373 ) ;
13811374 }
0 commit comments