Skip to content

[libcxx] Rename __libcpp_launder to __launder_function_pointer - #209320

Merged
petrhosek merged 1 commit into
llvm:mainfrom
petrhosek:libcxx-overriden-function-detection-launder
Jul 14, 2026
Merged

petrhosek merged 1 commit into
llvm:mainfrom
petrhosek:libcxx-overriden-function-detection-launder

Conversation

@petrhosek

Copy link
Copy Markdown
Member

This addresses post-commit feedback raised in #208330.

This addresses post-commit feedback raised in llvm#208330.
@petrhosek
petrhosek requested review from ldionne and philnik777 July 13, 2026 22:12
@petrhosek
petrhosek requested a review from a team as a code owner July 13, 2026 22:12
@petrhosek petrhosek added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 13, 2026
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-libcxx

Author: Petr Hosek (petrhosek)

Changes

This addresses post-commit feedback raised in #208330.


Full diff: https://github.com/llvm/llvm-project/pull/209320.diff

1 Files Affected:

  • (modified) libcxx/src/include/overridable_function.h (+2-2)
diff --git a/libcxx/src/include/overridable_function.h b/libcxx/src/include/overridable_function.h
index bd55c4bb6d8bc..4892393ad64f9 100644
--- a/libcxx/src/include/overridable_function.h
+++ b/libcxx/src/include/overridable_function.h
@@ -62,7 +62,7 @@ namespace {
 
 // This is used to prevent TBAA from optimizing away the function pointer comparison.
 template <typename T>
-[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI T* __libcpp_launder(T* __ptr) noexcept {
+[[nodiscard]] inline _LIBCPP_HIDE_FROM_ABI T* __launder_function_pointer(T* __ptr) noexcept {
   __asm__ volatile("" : "+r"(__ptr));
   return __ptr;
 }
@@ -96,7 +96,7 @@ _LIBCPP_HIDE_FROM_ABI inline bool __is_function_overridden() noexcept {
   // the _Func symbol. The compiler thinks __impl_ref<...>::__impl_ is defined elsewhere
   // at link time and will be an undefined symbol. It doesn't know that the __asm__ tells
   // the assembler to define it as a local symbol.
-  return __libcpp_launder(_Func) != __impl_ref<_Func>::__impl_;
+  return __launder_function_pointer(_Func) != __impl_ref<_Func>::__impl_;
 }
 
 _LIBCPP_END_NAMESPACE_STD

@philnik777 philnik777 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@petrhosek
petrhosek merged commit aae0191 into llvm:main Jul 14, 2026
81 of 82 checks passed
@petrhosek
petrhosek deleted the libcxx-overriden-function-detection-launder branch July 14, 2026 07:13
pedroMVicente pushed a commit to pedroMVicente/llvm-project that referenced this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants