[clang] [CIR] Add support for the IdiomRecognizer pass (PR #208854)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 13 07:19:17 PDT 2026


================
@@ -3537,6 +3540,23 @@ void CIRGenModule::setCXXSpecialMemberAttr(
   }
 }
 
+void CIRGenModule::setFuncIdentityAttr(cir::FuncOp funcOp,
+                                       const clang::FunctionDecl *funcDecl) {
+  // Only a free std function with a plain identifier can match a known
+  // entity, so members, static members, and operators never take a tag.
+  // Inline namespaces, like the versioning namespace of libc++, count as
+  // part of std.
+  if (!funcDecl || !funcDecl->getIdentifier() || isa<CXXMethodDecl>(funcDecl) ||
+      !funcDecl->isInStdNamespace())
----------------
erichkeane wrote:

Hmm... it seems we're overly limiting ourselves here.  For example, we'd like to some day recognize `std::vector::push_back` for example.


https://github.com/llvm/llvm-project/pull/208854


More information about the cfe-commits mailing list