[PATCH] D120897: [flang] Remove 'using namespace mlir;` from header files

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 16:50:30 PST 2022


bondhugula accepted this revision.
bondhugula added a comment.
This revision is now accepted and ready to land.

This is a welcome change in the right direction!



================
Comment at: flang/include/flang/Optimizer/Dialect/FIROpsSupport.h:27
 inline bool isaCall(mlir::Operation *op) {
-  return isa<fir::CallOp>(op) || isa<fir::DispatchOp>(op) ||
-         isa<mlir::func::CallOp>(op) || isa<mlir::func::CallIndirectOp>(op);
+  return llvm::isa<fir::CallOp>(op) || llvm::isa<fir::DispatchOp>(op) ||
+         llvm::isa<mlir::func::CallOp>(op) ||
----------------
clementval wrote:
> `mlir::isa`
isa, dyn_cast are re-exported into the MLIR namespace. Given how commonly they are used, you may want to just use them import them into your namespace and use them without the namespace qualifier, or have a `using mlir::isa` above.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120897/new/

https://reviews.llvm.org/D120897



More information about the llvm-commits mailing list