Skip to content

Commit 428479c

Browse files
committed
format
1 parent 9012aca commit 428479c

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

flang/lib/Lower/Allocatable.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,11 @@ class AllocateStmtHelper {
468468
}
469469

470470
void genSimpleAllocation(const Allocation &alloc,
471-
const fir::MutableBoxValue &box) {
471+
const fir::MutableBoxValue &box) {
472472
bool isCudaSymbol = Fortran::semantics::HasCUDAAttr(alloc.getSymbol());
473-
473+
474474
unsigned allocatorIdx = Fortran::lower::getAllocatorIdx(alloc.getSymbol());
475-
475+
476476
if (isCudaSymbol) {
477477
bool inlineAllocation = !box.isDerived() && !errorManager.hasStatSpec() &&
478478
!alloc.type.IsPolymorphic() &&
@@ -501,7 +501,8 @@ class AllocateStmtHelper {
501501
stat = genRuntimeAllocate(builder, loc, box, errorManager);
502502
setPinnedToFalse();
503503
} else {
504-
stat = genCudaAllocate(builder, loc, box, errorManager, alloc.getSymbol());
504+
stat =
505+
genCudaAllocate(builder, loc, box, errorManager, alloc.getSymbol());
505506
}
506507
fir::factory::syncMutableBoxFromIRBox(builder, loc, box);
507508
postAllocationAction(alloc);
@@ -866,21 +867,21 @@ genDeallocate(fir::FirOpBuilder &builder,
866867
if (!isCudaSymbol) {
867868
// For non-CUDA symbols, always use runtime deallocation.
868869
errorManager.genStatCheck(builder, loc);
869-
stat = genRuntimeDeallocate(builder, loc, box, errorManager, declaredTypeDesc);
870-
}
871-
else {
870+
stat =
871+
genRuntimeDeallocate(builder, loc, box, errorManager, declaredTypeDesc);
872+
} else {
872873
bool inlineDeallocation =
873-
!box.isDerived() && !box.isPolymorphic() && !box.hasAssumedRank() &&
874-
!box.isUnlimitedPolymorphic() && !errorManager.hasStatSpec() &&
875-
!useAllocateRuntime && !box.isPointer();
876-
877-
if (inlineDeallocation && isCudaDeviceContext) {
878-
// Inline deallocation for CUDA when conditions hold.
879-
stat = fir::factory::genFreemem(builder, loc, box);
880-
} else {
881-
// Otherwise, use the CUDA-specific runtime deallocation.
882-
errorManager.genStatCheck(builder, loc);
883-
stat = genCudaDeallocate(builder, loc, box, errorManager, *symbol);
874+
!box.isDerived() && !box.isPolymorphic() && !box.hasAssumedRank() &&
875+
!box.isUnlimitedPolymorphic() && !errorManager.hasStatSpec() &&
876+
!useAllocateRuntime && !box.isPointer();
877+
878+
if (inlineDeallocation && isCudaDeviceContext) {
879+
// Inline deallocation for CUDA when conditions hold.
880+
stat = fir::factory::genFreemem(builder, loc, box);
881+
} else {
882+
// Otherwise, use the CUDA-specific runtime deallocation.
883+
errorManager.genStatCheck(builder, loc);
884+
stat = genCudaDeallocate(builder, loc, box, errorManager, *symbol);
884885
}
885886
}
886887
fir::factory::syncMutableBoxFromIRBox(builder, loc, box);

0 commit comments

Comments
 (0)