================
@@ -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);
+}
+
+cir::FuncOp cir::CallOp::resolveCallee() {
+  return resolveCalleeImpl(*this, /*symbolTable=*/nullptr);
----------------
SharmaRithik wrote:

Removed the form. `resolveCalleeInTable` is the only way in now, and it takes a 
reference, so every caller goes through the cache.

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