@@ -281,13 +281,14 @@ class DeclareOpConversion : public mlir::OpRewritePattern<fir::DeclareOp> {
281281 matchAndRewrite (fir::DeclareOp declareOp,
282282 mlir::PatternRewriter &rewriter) const override {
283283 if (!preserveDeclare) {
284- auto memrefOp = declareOp.getMemref ().getDefiningOp ();
285- if (!memrefOp){
286- rewriter.replaceOp (declareOp, declareOp.getMemref ());
287- return mlir::success ();
284+ auto memrefOp = declareOp.getMemref ().getDefiningOp ();
285+ if (!memrefOp) {
286+ rewriter.replaceOp (declareOp, declareOp.getMemref ());
287+ return mlir::success ();
288288 }
289-
290- // attach metadatas from the fir.declare to its memref (if it's an operation)
289+
290+ // attach metadatas from the fir.declare to its memref (if it's an
291+ // operation)
291292 mlir::NamedAttrList elidedAttrs =
292293 mlir::NamedAttrList{memrefOp->getAttrs ()};
293294 for (const mlir::NamedAttribute &attr : declareOp->getAttrs ())
@@ -319,8 +320,8 @@ class DeclareOpConversion : public mlir::OpRewritePattern<fir::DeclareOp> {
319320 declareOp.getUniqName ());
320321
321322 // attach metadatas from fir.declare to fircg.ext_declare
322- for (const mlir::NamedAttribute &attr : declareOp->getAttrs ())
323- xDeclOp->setAttr (attr.getName (), attr.getValue ());
323+ for (const mlir::NamedAttribute &attr : declareOp->getAttrs ())
324+ xDeclOp->setAttr (attr.getName (), attr.getValue ());
324325
325326 LLVM_DEBUG (llvm::dbgs ()
326327 << " rewriting " << declareOp << " to " << xDeclOp << ' \n ' );
0 commit comments