Fix interface trait declaration in SymbolInterfaces.td
authorAlex Zinenko <zinenko@google.com>
Mon, 30 Aug 2021 09:13:19 +0000 (11:13 +0200)
committerAlex Zinenko <zinenko@google.com>
Mon, 30 Aug 2021 09:15:05 +0000 (11:15 +0200)
41d4aa7de68ed551010f27ff04ffc54e7616292a introduced incorrect code in
extraTraitClassDeclaration: `this` refers to the trait class and not the
operation class so `->getContext()` is not valid. Use `$_op` instead.

mlir/include/mlir/IR/SymbolInterfaces.td

index 97bda0e..e332bb6 100644 (file)
@@ -205,7 +205,7 @@ def Symbol : OpInterface<"SymbolOpInterface"> {
 
     /// Convenience version of `setName` that take a StringRef.
     void setName(StringRef name) {
-      setName(StringAttr::get(this->getContext(), name));
+      setName(StringAttr::get($_op->getContext(), name));
     }
   }];
 }