[PATCH] D109252: Add extra check for llvm::Any::TypeId visibility

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 11:48:21 PDT 2021


MaskRay added inline comments.


================
Comment at: llvm/tools/llvm-shlib/CMakeLists.txt:84
+        check-typeid-visibility
+        COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvm-nm -C ${LIB_NAME}-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX} | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FileCheck ${CMAKE_CURRENT_SOURCE_DIR}/typeid.pattern
+        DEPENDS LLVM llvm-nm FileCheck
----------------
Use `RUN:` in lit instead of the cmake magic.


================
Comment at: llvm/tools/llvm-shlib/typeid.pattern:2
+# Make sure there's no llvm::Any::TypeId symbol local to the shared library.
+# That would cause non-unicity of the adresses used as unique identifier for
+# each type when another library is linked in with default visibility (weak)
----------------
I haven't heard of non-unicity.

breaking pointer equality is more common.


================
Comment at: llvm/tools/llvm-shlib/typeid.pattern:8
+
+# CHECK-NOT: b llvm::Any::TypeId
+# CHECK-NOT: r llvm::Any::TypeId
----------------
Make `[br]` stronger: `{{[[^V]]}}`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109252/new/

https://reviews.llvm.org/D109252



More information about the llvm-commits mailing list