File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
flang/lib/Optimizer/OpenMP Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments