Skip to content

Commit da1f1b2

Browse files
committed
Prevent extraneous copy in f752265
Commit f752265 uses extraneous copy to the loop variable. Fixing the same
1 parent 5ea647d commit da1f1b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void DataSharingProcessor::privatize() {
415415
for (const Fortran::semantics::Symbol *sym : privatizedSymbols) {
416416
if (const auto *commonDet =
417417
sym->detailsIf<Fortran::semantics::CommonBlockDetails>()) {
418-
for (const auto mem : commonDet->objects()) {
418+
for (const auto &mem : commonDet->objects()) {
419419
cloneSymbol(&*mem);
420420
copyFirstPrivateSymbol(&*mem);
421421
}
@@ -431,7 +431,7 @@ void DataSharingProcessor::copyLastPrivatize(mlir::Operation *op) {
431431
for (const Fortran::semantics::Symbol *sym : privatizedSymbols)
432432
if (const auto *commonDet =
433433
sym->detailsIf<Fortran::semantics::CommonBlockDetails>()) {
434-
for (const auto mem : commonDet->objects()) {
434+
for (const auto &mem : commonDet->objects()) {
435435
copyLastPrivateSymbol(&*mem, &lastPrivIP);
436436
}
437437
} else {

0 commit comments

Comments
 (0)