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

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 02:26:33 PST 2022


awarzynski added inline comments.


================
Comment at: flang/include/flang/Optimizer/Dialect/FIROpsSupport.h:20
 inline bool nonVolatileLoad(mlir::Operation *op) {
-  if (auto load = dyn_cast<fir::LoadOp>(op))
+  if (auto load = llvm::dyn_cast<fir::LoadOp>(op))
     return !load->getAttr("volatile");
----------------
clementval wrote:
> it's probably `mlir::dyn_cast` here. 
`mlir::dyn_cast` is in fact `llvm::dyn_cast`. See https://github.com/llvm/llvm-project/blob/1e082a4a9c2d5b3dba06561bc3a3764c4cdc0d25/mlir/include/mlir/Support/LLVM.h#L82


================
Comment at: flang/lib/Lower/Bridge.cpp:42
 
+using namespace mlir;
+
----------------
clementval wrote:
> Wouldn't it make more sense to just get rid of it since we want fully qualified names? Same for other places.
That would be a much more intrusive patch. I wanted to avoid that while the upstreaming is in progress. 


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