[mlir] Drop `const` from `SymbolTableCollection::lookupSymbolIn`
authorJeff Niu <jeff@modular.com>
Fri, 4 Nov 2022 01:40:28 +0000 (18:40 -0700)
committerJeff Niu <jeff@modular.com>
Sat, 5 Nov 2022 23:28:30 +0000 (16:28 -0700)
This function didn't work because it was marked const but both functions
it could dispatch to are not.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D137380

mlir/include/mlir/IR/SymbolTable.h

index 3cc4800..a246935 100644 (file)
@@ -249,7 +249,7 @@ public:
   Operation *lookupSymbolIn(Operation *symbolTableOp, StringAttr symbol);
   Operation *lookupSymbolIn(Operation *symbolTableOp, SymbolRefAttr name);
   template <typename T, typename NameT>
-  T lookupSymbolIn(Operation *symbolTableOp, NameT &&name) const {
+  T lookupSymbolIn(Operation *symbolTableOp, NameT &&name) {
     return dyn_cast_or_null<T>(
         lookupSymbolIn(symbolTableOp, std::forward<NameT>(name)));
   }