[Mlir-commits] [mlir] Switch member calls to `isa/dyn_cast/cast/...` to free function calls. (PR #89356)

Christian Sigg llvmlistbot at llvm.org
Fri Apr 19 03:50:34 PDT 2024


chsigg wrote:

> Thanks for the cleanup. LGTM assuming that the usages of `mlir::` and `llvm::` are only done in places where both namespaces have a corresponding `using` directive.

The change was auto-generated to change Attribute, Location, Type, and Value member function calls to free function calls without explicit `mlir::` qualification. This works pre-C++20 because the code is in the mlir namespace (see comment at https://discourse.llvm.org/t/preferred-casting-style-going-forward), except for call sites in (class) scopes which themselves provide a `cast` etc. member (e.g. inside member functions of classes deriving from `Type`). In those cases, I qualified the call with `mlir::`.

The `using llvm::cast;` etc directives in the mlir namespace import all overload of these functions.

https://github.com/llvm/llvm-project/pull/89356


More information about the Mlir-commits mailing list