Skip to content

Commit

Permalink
Prevent extraneous copy in f752265
Browse files Browse the repository at this point in the history
Commit f752265 uses
extraneous copy to the loop variable. Fixing the same
  • Loading branch information
NimishMishra committed Jul 31, 2023
1 parent 5ea647d commit da1f1b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flang/lib/Lower/OpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ void DataSharingProcessor::privatize() {
for (const Fortran::semantics::Symbol *sym : privatizedSymbols) {
if (const auto *commonDet =
sym->detailsIf<Fortran::semantics::CommonBlockDetails>()) {
for (const auto mem : commonDet->objects()) {
for (const auto &mem : commonDet->objects()) {
cloneSymbol(&*mem);
copyFirstPrivateSymbol(&*mem);
}
Expand All @@ -431,7 +431,7 @@ void DataSharingProcessor::copyLastPrivatize(mlir::Operation *op) {
for (const Fortran::semantics::Symbol *sym : privatizedSymbols)
if (const auto *commonDet =
sym->detailsIf<Fortran::semantics::CommonBlockDetails>()) {
for (const auto mem : commonDet->objects()) {
for (const auto &mem : commonDet->objects()) {
copyLastPrivateSymbol(&*mem, &lastPrivIP);
}
} else {
Expand Down

0 comments on commit da1f1b2

Please sign in to comment.