================
@@ -1051,6 +1051,27 @@ unsigned cir::CallOp::getNumArgOperands() {
   return this->getOperation()->getNumOperands();
 }
 
+static cir::FuncOp resolveCalleeImpl(mlir::Operation *op,
+                                     mlir::SymbolTableCollection *symbolTable) 
{
+  auto callee = op->getAttrOfType<mlir::FlatSymbolRefAttr>(
+      CIRDialect::getCalleeAttrName());
+  if (!callee)
+    return {};
+
+  if (symbolTable)
+    return symbolTable->lookupNearestSymbolFrom<cir::FuncOp>(op, callee);
+  return mlir::SymbolTable::lookupNearestSymbolFrom<cir::FuncOp>(op, callee);
----------------
SharmaRithik wrote:

It works. `lookupNearestSymbolFrom` takes any op and walks up to the nearest 
symbol table by itself, so the call op is enough. `verifyCallCommInSymbolUses` 
in this file does the same thing, and the unit test covers it.

https://github.com/llvm/llvm-project/pull/207261
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to