[Mlir-commits] [mlir] [MLIR] Fix TypeID anonymous namespace check to handle GCC's __PRETTY_FUNCTION__ format (PR #199634)

Mehdi Amini llvmlistbot at llvm.org
Tue May 26 03:20:03 PDT 2026


================
@@ -30,12 +30,14 @@ struct ImplicitTypeIDRegistry {
     // Perform a heuristic check to see if this type is in an anonymous
     // namespace. String equality is not valid for anonymous types, so we try to
     // abort whenever we see them.
+    // Check all known anonymous-namespace markers unconditionally:
+    //   Clang : "(anonymous namespace)"
+    //   GCC   : "{anonymous}"
+    //   MSVC  : "anonymous-namespace"
 #ifndef NDEBUG
-#if defined(_MSC_VER)
-    if (typeName.contains("anonymous-namespace")) {
-#else
-    if (typeName.contains("anonymous namespace")) {
-#endif
+    if (typeName.contains("anonymous namespace") ||
+        typeName.contains("{anonymous}") ||
+        typeName.contains("anonymous-namespace")) {
----------------
joker-eph wrote:

Why not keeping the per-compiler macro?

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


More information about the Mlir-commits mailing list