================
@@ -64,16 +96,32 @@ template <typename TargetOp> class StdRecognizer {
!signatureMatches<TargetOp>(call))
return false;
- // Only a free std function with the right name carries the tag, so
- // members, static members, and operators never match. The shape of the
- // call is checked here, so a variadic callee never matches.
- cir::FuncOp callee = call.resolveCalleeInTable(symbolTables);
- if (!callee || callee.getFunctionType().isVarArg())
- return false;
- auto funcIdentity = mlir::dyn_cast_if_present<cir::FuncIdentityAttr>(
- callee.getFuncInfoAttr());
- if (!funcIdentity || funcIdentity.getKind() != TargetOp::getFuncKind())
- return false;
+ if constexpr (MatchByTag) {
----------------
erichkeane wrote:
This feels like this is getting messy REALLY fast. we should step back and
find a way to abstract away a lot of the call-matching to the Op itself
(perhaps have a way of table-genning our recognized ops based on the attributes
of it, rather than hard-code in all the below/overly 'share').
For example, matching name + signature is really what we want (plus a bit of a
"also allow in the global NS kinda thing"), so we should be able to extract
that sort of thing.
https://github.com/llvm/llvm-project/pull/210400
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits