Skip to content

Commit 42d030b

Browse files
Add some helpful comments
1 parent 5e859ff commit 42d030b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,16 @@ class MapsForPrivatizedSymbolsPass
6565
auto declOp = llvm::dyn_cast_or_null<hlfir::DeclareOp>(definingOp);
6666
assert(declOp &&
6767
"Expected defining Op of privatized var to be hlfir.declare");
68+
69+
// We want the first result of the hlfir.declare op because our goal
70+
// is to map the descriptor (fir.box or fir.boxchar) and the first
71+
// result for hlfir.declare is the descriptor if a the symbol being
72+
// decalred needs a descriptor.
6873
Value varPtr = declOp.getBase();
6974

75+
// If we do not have a reference to descritor, but the descriptor itself
76+
// then we need to store that on the stack so that we can map the
77+
// address of the descriptor.
7078
if (mlir::isa<fir::BaseBoxType>(varPtr.getType()) ||
7179
mlir::isa<fir::BoxCharType>(varPtr.getType())) {
7280
OpBuilder::InsertPoint savedInsPoint = builder.saveInsertionPoint();

0 commit comments

Comments
 (0)