[libcxx-commits] [libcxx] aeb1c98 - [libc++][AIX] Use non-unique implementation for typeinfo comparison

Xing Xue via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 28 10:18:49 PDT 2022


Author: Xing Xue
Date: 2022-07-28T13:17:12-04:00
New Revision: aeb1c98f4c1095f0ad2b59f3cc13c0b5b74f807a

URL: https://github.com/llvm/llvm-project/commit/aeb1c98f4c1095f0ad2b59f3cc13c0b5b74f807a
DIFF: https://github.com/llvm/llvm-project/commit/aeb1c98f4c1095f0ad2b59f3cc13c0b5b74f807a.diff

LOG: [libc++][AIX] Use non-unique implementation for typeinfo comparison

Summary:
The AIX linker does not merge typeinfos when shared libraries are involved, which causes address comparison to fail although the types are the same. This patch changes to use the non-unique implementation for typeinfo comparison for AIX.

Reviewed by: hubert.reinterpretcast, philnik, libc++

Differential Revision: https://reviews.llvm.org/D130715

Added: 
    

Modified: 
    libcxx/include/typeinfo

Removed: 
    


################################################################################
diff  --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo
index a0ac527db7823..1f316086c6f0a 100644
--- a/libcxx/include/typeinfo
+++ b/libcxx/include/typeinfo
@@ -174,8 +174,8 @@ public:
 // we pick a default implementation based on the platform here.
 #ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION
 
-  // Windows binaries can't merge typeinfos, so use the NonUnique implementation.
-# ifdef _LIBCPP_OBJECT_FORMAT_COFF
+  // Windows and AIX binaries can't merge typeinfos, so use the NonUnique implementation.
+# if defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF)
 #   define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 2
 
   // On arm64 on Apple platforms, use the special NonUniqueARMRTTIBit implementation.


        


More information about the libcxx-commits mailing list