================
@@ -0,0 +1,51 @@
+#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRVISITOR_H
+#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRVISITOR_H
+
+#include "clang/CIR/Dialect/IR/CIRAttrs.h"
+
+namespace cir {
+
+template <typename ImplClass, typename RetTy> class CirAttrVisitor {
+public:
+ // FIXME: Create a TableGen list to automatically handle new attributes
+ template <typename... Args>
+ RetTy visit(mlir::Attribute attr, Args &&...args) {
+ if (const auto intAttr = mlir::dyn_cast<cir::IntAttr>(attr))
+ return static_cast<ImplClass *>(this)->visitCirIntAttr(
----------------
erichkeane wrote:
I suggest a `getDerived` instead of the `static_cast` everywhere.
https://github.com/llvm/llvm-project/pull/125619
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits