Support type casting Type to itself
authorLei Zhang <antiagainst@google.com>
Mon, 3 Jun 2019 19:38:22 +0000 (12:38 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Tue, 4 Jun 2019 02:26:54 +0000 (19:26 -0700)
PiperOrigin-RevId: 251287045

mlir/include/mlir/IR/Types.h

index 7f70ec2..de29bb4 100644 (file)
@@ -137,6 +137,9 @@ public:
   template <typename U> U dyn_cast_or_null() const;
   template <typename U> U cast() const;
 
+  // Support type casting Type to itself.
+  static bool classof(Type) { return true; }
+
   /// Return the classification for this type.
   unsigned getKind() const;