Skip to content

Commit cb9b9ec

Browse files
committed
Handle review comments (3).
Add a check to ensure we do have `DIGlobalVariableExpressionAttr` in the `ArrayAttr`.
1 parent 1660a41 commit cb9b9ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2999,7 +2999,10 @@ struct GlobalOpConversion : public fir::FIROpConversion<fir::GlobalOp> {
29992999
if (auto gvExprAttr = mlir::dyn_cast_if_present<mlir::ArrayAttr>(
30003000
fusedLoc.getMetadata())) {
30013001
for (auto attr : gvExprAttr.getAsRange<mlir::Attribute>())
3002-
dbgExprs.push_back(attr);
3002+
if (auto dbgAttr =
3003+
mlir::dyn_cast<mlir::LLVM::DIGlobalVariableExpressionAttr>(
3004+
attr))
3005+
dbgExprs.push_back(dbgAttr);
30033006
}
30043007
}
30053008

0 commit comments

Comments
 (0)