@@ -82,7 +82,7 @@ parseOperandList(OpAsmParser &parser, StringRef keyword,
82
82
static void printOperandList (Operation::operand_range operands,
83
83
StringRef listName, OpAsmPrinter &printer) {
84
84
85
- if (operands.size () > 0 ) {
85
+ if (! operands.empty () ) {
86
86
printer << " " << listName << " (" ;
87
87
llvm::interleaveComma (operands, printer, [&](Value op) {
88
88
printer << op << " : " << op.getType ();
@@ -692,7 +692,7 @@ static LogicalResult verify(acc::DataOp dataOp) {
692
692
// 2.6.5. Data Construct restriction
693
693
// At least one copy, copyin, copyout, create, no_create, present, deviceptr,
694
694
// attach, or default clause must appear on a data construct.
695
- if (dataOp.getOperands ().size () == 0 && !dataOp.defaultAttr ())
695
+ if (dataOp.getOperands ().empty () && !dataOp.defaultAttr ())
696
696
return dataOp.emitError (" at least one operand or the default attribute "
697
697
" must appear on the data operation" );
698
698
return success ();
@@ -838,8 +838,7 @@ static LogicalResult verify(acc::ShutdownOp op) {
838
838
839
839
static LogicalResult verify (acc::UpdateOp updateOp) {
840
840
// At least one of host or device should have a value.
841
- if (updateOp.hostOperands ().size () == 0 &&
842
- updateOp.deviceOperands ().size () == 0 )
841
+ if (updateOp.hostOperands ().empty () && updateOp.deviceOperands ().empty ())
843
842
return updateOp.emitError (" at least one value must be present in"
844
843
" hostOperands or deviceOperands" );
845
844
@@ -851,10 +850,10 @@ static LogicalResult verify(acc::UpdateOp updateOp) {
851
850
852
851
// The wait attribute represent the wait clause without values. Therefore the
853
852
// attribute and operands cannot appear at the same time.
854
- if (updateOp.waitOperands ().size () > 0 && updateOp.wait ())
853
+ if (! updateOp.waitOperands ().empty () && updateOp.wait ())
855
854
return updateOp.emitError (" wait attribute cannot appear with waitOperands" );
856
855
857
- if (updateOp.waitDevnum () && updateOp.waitOperands ().size () == 0 )
856
+ if (updateOp.waitDevnum () && updateOp.waitOperands ().empty () )
858
857
return updateOp.emitError (" wait_devnum cannot appear without waitOperands" );
859
858
860
859
return success ();
0 commit comments