github-actions[bot] wrote: <!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning: <details> <summary> You can test this locally with the following command: </summary> ``````````bash git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- flang/include/flang/Optimizer/Builder/DirectivesCommon.h flang/lib/Optimizer/Dialect/FIRType.cpp flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp `````````` </details> <details> <summary> View the diff from clang-format here. </summary> ``````````diff diff --git a/flang/include/flang/Optimizer/Builder/DirectivesCommon.h b/flang/include/flang/Optimizer/Builder/DirectivesCommon.h index be11b9b5e..ce960ea19 100644 --- a/flang/include/flang/Optimizer/Builder/DirectivesCommon.h +++ b/flang/include/flang/Optimizer/Builder/DirectivesCommon.h @@ -160,7 +160,8 @@ genBoundsOpFromBoxChar(fir::FirOpBuilder &builder, mlir::Location loc, if (info.isPresent) { llvm::SmallVector<mlir::Type> resTypes = {idxTy, idxTy}; mlir::Operation::result_range ifRes = - builder.genIfOp(loc, resTypes, info.isPresent, /*withElseRegion=*/true) + builder + .genIfOp(loc, resTypes, info.isPresent, /*withElseRegion=*/true) .genThen([&]() { mlir::Value boxChar = fir::isa_ref_type(info.addr.getType()) @@ -171,13 +172,15 @@ genBoundsOpFromBoxChar(fir::FirOpBuilder &builder, mlir::Location loc, mlir::Type refType = builder.getRefType(boxCharType.getEleTy()); auto unboxed = builder.create<fir::UnboxCharOp>( loc, refType, lenType, boxChar); - mlir::SmallVector<mlir::Value> results = {unboxed.getResult(1), one }; + mlir::SmallVector<mlir::Value> results = {unboxed.getResult(1), + one}; builder.create<fir::ResultOp>(loc, results); }) - .genElse([&]() { - mlir::SmallVector<mlir::Value> results = {zero, zero }; - builder.create<fir::ResultOp>(loc, results); }) - .getResults(); + .genElse([&]() { + mlir::SmallVector<mlir::Value> results = {zero, zero}; + builder.create<fir::ResultOp>(loc, results); + }) + .getResults(); return {ifRes[0], ifRes[1]}; } // We have already established that info.addr.getType() is a boxchar diff --git a/flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp b/flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp index 51237840f..f052cf8d2 100644 --- a/flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp +++ b/flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp @@ -295,15 +295,17 @@ class MapInfoFinalizationPass if (mlir::isa<fir::ReferenceType>(op.getVarPtr().getType())) boxChar = builder.create<fir::LoadOp>(loc, op.getVarPtr()); - fir::BoxCharType boxCharType = mlir::dyn_cast<fir::BoxCharType>(boxChar.getType()); - mlir::Value boxAddr = builder.create<fir::BoxOffsetOp>(loc, op.getVarPtr(), fir::BoxFieldAttr::base_addr); + fir::BoxCharType boxCharType = + mlir::dyn_cast<fir::BoxCharType>(boxChar.getType()); + mlir::Value boxAddr = builder.create<fir::BoxOffsetOp>( + loc, op.getVarPtr(), fir::BoxFieldAttr::base_addr); uint64_t mapTypeToImplicit = static_cast< std::underlying_type_t<llvm::omp::OpenMPOffloadMappingFlags>>( llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_TO | llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_IMPLICIT); - mlir::ArrayAttr newMembersAttr; + mlir::ArrayAttr newMembersAttr; llvm::SmallVector<llvm::SmallVector<int64_t>> memberIdx = {{0}}; newMembersAttr = builder.create2DI64ArrayAttr(memberIdx); @@ -324,10 +326,10 @@ class MapInfoFinalizationPass mlir::omp::MapInfoOp newMapInfoOp = builder.create<mlir::omp::MapInfoOp>( op.getLoc(), op.getResult().getType(), varPtr, - mlir::TypeAttr::get(llvm::cast<mlir::omp::PointerLikeType>(varPtr.getType()) - .getElementType()), - op.getMapTypeAttr(), - op.getMapCaptureTypeAttr(), + mlir::TypeAttr::get( + llvm::cast<mlir::omp::PointerLikeType>(varPtr.getType()) + .getElementType()), + op.getMapTypeAttr(), op.getMapCaptureTypeAttr(), /*varPtrPtr=*/mlir::Value{}, /*members=*/llvm::SmallVector<mlir::Value>{memberMapInfoOp}, /*member_index=*/newMembersAttr, diff --git a/flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp b/flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp index 70f051789..b6caeca70 100644 --- a/flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp +++ b/flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp @@ -217,16 +217,19 @@ class MapsForPrivatizedSymbolsPass } } else { mlir::Location loc = var.getLoc(); - fir::factory::AddrAndBoundsInfo info = fir::factory::getDataOperandBaseAddr(builder, var, /*isOptional=*/false, loc); + fir::factory::AddrAndBoundsInfo info = + fir::factory::getDataOperandBaseAddr(builder, var, + /*isOptional=*/false, loc); fir::ExtendedValue extendedValue = hlfir::translateToExtendedValue(loc, builder, hlfir::Entity{info.addr}, - /*continguousHint=*/true).first; + /*continguousHint=*/true) + .first; llvm::SmallVector<mlir::Value> boundsOpsVec = fir::factory::genImplicitBoundsOps<mlir::omp::MapBoundsOp, mlir::omp::MapBoundsType>( - builder, info, extendedValue, - /*dataExvIsAssumedSize=*/false, loc); + builder, info, extendedValue, + /*dataExvIsAssumedSize=*/false, loc); for (auto bounds : boundsOpsVec) boundsOps.push_back(bounds); } `````````` </details> https://github.com/llvm/llvm-project/pull/141715 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits