[flang][fir][NFC] Removes deprecated messages in builds.

GitOrigin-RevId: 5077d42cfa427598826eb7b69ad805bad8f4ec9d
diff --git a/include/flang/Optimizer/Dialect/FIROps.td b/include/flang/Optimizer/Dialect/FIROps.td
index 32b9d34..6500ab2 100644
--- a/include/flang/Optimizer/Dialect/FIROps.td
+++ b/include/flang/Optimizer/Dialect/FIROps.td
@@ -668,7 +668,7 @@
       printSuccessorAtIndex(p, i);
     }
     p << ']';
-    p.printOptionalAttrDict(getAttrs(), {getCasesAttr(), getCompareOffsetAttr(),
+    p.printOptionalAttrDict((*this)->getAttrs(), {getCasesAttr(), getCompareOffsetAttr(),
         getTargetOffsetAttr(), getOperandSegmentSizeAttr()});
   }];
 
@@ -796,7 +796,7 @@
       printSuccessorAtIndex(p, i);
     }
     p << ']';
-    p.printOptionalAttrDict(getAttrs(), {getCasesAttr(), getCompareOffsetAttr(),
+    p.printOptionalAttrDict((*this)->getAttrs(), {getCasesAttr(), getCompareOffsetAttr(),
         getTargetOffsetAttr(), getOperandSegmentSizeAttr()});
   }];
 
@@ -903,7 +903,7 @@
       printSuccessorAtIndex(p, i);
     }
     p << ']';
-    p.printOptionalAttrDict(getAttrs(), {getCasesAttr(), getCompareOffsetAttr(),
+    p.printOptionalAttrDict((*this)->getAttrs(), {getCasesAttr(), getCompareOffsetAttr(),
         getTargetOffsetAttr(), getOperandSegmentSizeAttr()});
   }];
 
@@ -1028,7 +1028,7 @@
     } else if (auto map = (*this)->getAttr(layoutName())) {
       p << " [" << map << ']';
     }
-    p.printOptionalAttrDict(getAttrs(), {layoutName(), lenpName()});
+    p.printOptionalAttrDict((*this)->getAttrs(), {layoutName(), lenpName()});
     p << " : ";
     p.printFunctionalType(getOperation());
   }];
@@ -1782,7 +1782,7 @@
 
   let printer = [{
     p << getOperationName() << ' ' << (*this)->getOperands();
-    p.printOptionalAttrDict(getAttrs(), /*elidedAttrs=*/{baseType()});
+    p.printOptionalAttrDict((*this)->getAttrs(), /*elidedAttrs=*/{baseType()});
     p << " : ";
     p.printFunctionalType((*this)->getOperandTypes(),
         (*this)->getResultTypes());
@@ -2557,7 +2557,7 @@
       p.printOperands(args());
     }
     p << ')';
-    p.printOptionalAttrDict(getAttrs(), {"fn_type", "method"});
+    p.printOptionalAttrDict((*this)->getAttrs(), {"fn_type", "method"});
     auto resTy{getResultTypes()};
     llvm::SmallVector<mlir::Type, 8> argTy(getOperandTypes());
     p << " : " << mlir::FunctionType::get(getContext(), argTy, resTy);
@@ -2986,7 +2986,7 @@
 
   let printer = [{
     p << getOperationName() << ' ' << (*this)->getAttr("in_type");
-    p.printOptionalAttrDict(getAttrs(), {"in_type"});
+    p.printOptionalAttrDict((*this)->getAttrs(), {"in_type"});
   }];
 
   let builders = [
diff --git a/lib/Optimizer/Dialect/FIROps.cpp b/lib/Optimizer/Dialect/FIROps.cpp
index 80f1a1d..47211e2 100644
--- a/lib/Optimizer/Dialect/FIROps.cpp
+++ b/lib/Optimizer/Dialect/FIROps.cpp
@@ -255,7 +255,7 @@
   else
     p << op.getOperand(0);
   p << '(' << op->getOperands().drop_front(isDirect ? 0 : 1) << ')';
-  p.printOptionalAttrDict(op.getAttrs(), {fir::CallOp::calleeAttrName()});
+  p.printOptionalAttrDict(op->getAttrs(), {fir::CallOp::calleeAttrName()});
   auto resultTypes{op.getResultTypes()};
   llvm::SmallVector<Type, 8> argTypes(
       llvm::drop_begin(op.getOperandTypes(), isDirect ? 0 : 1));
@@ -336,7 +336,7 @@
   p.printOperand(op.lhs());
   p << ", ";
   p.printOperand(op.rhs());
-  p.printOptionalAttrDict(op.getAttrs(),
+  p.printOptionalAttrDict(op->getAttrs(),
                           /*elidedAttrs=*/{OPTY::getPredicateAttrName()});
   p << " : " << op.lhs().getType();
 }