[libcxx-commits] [libcxx] e829963 - [libc++][NFC] Update the documentation for _LIBCPP_OVERRIDABLE_FUNCTION (#140121)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 16 04:29:50 PDT 2025


Author: Louis Dionne
Date: 2025-05-16T07:29:46-04:00
New Revision: e829963a4fefa1b9540647799800b16d88bf0412

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

LOG: [libc++][NFC] Update the documentation for _LIBCPP_OVERRIDABLE_FUNCTION (#140121)

Added: 
    

Modified: 
    libcxx/src/include/overridable_function.h

Removed: 
    


################################################################################
diff  --git a/libcxx/src/include/overridable_function.h b/libcxx/src/include/overridable_function.h
index 6978a4fd59e5e..0b43f271486c1 100644
--- a/libcxx/src/include/overridable_function.h
+++ b/libcxx/src/include/overridable_function.h
@@ -29,14 +29,14 @@
 // This is a low-level utility which does not work on all platforms, since it needs
 // to make assumptions about the object file format in use. Furthermore, it requires
 // the "base definition" of the function (the one we want to check whether it has been
-// overridden) to be annotated with the _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE macro.
+// overridden) to be defined using the _LIBCPP_OVERRIDABLE_FUNCTION macro.
 //
 // This currently works with Mach-O files (used on Darwin) and with ELF files (used on Linux
 // and others). On platforms where we know how to implement this detection, the macro
 // _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION is defined to 1, and it is defined to 0 on
-// other platforms. The _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE macro is defined to
-// nothing on unsupported platforms so that it can be used to decorate functions regardless
-// of whether detection is actually supported.
+// other platforms. The _LIBCPP_OVERRIDABLE_FUNCTION macro is defined to perform a normal
+// function definition on unsupported platforms so that it can be used to define functions
+// regardless of whether detection is actually supported.
 //
 // How does this work?
 // -------------------
@@ -44,7 +44,7 @@
 // Let's say we want to check whether a weak function `f` has been overridden by the user.
 // The general mechanism works by placing `f`'s definition (in the libc++ built library)
 // inside a special section, which we do using the `__section__` attribute via the
-// _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE macro.
+// _LIBCPP_OVERRIDABLE_FUNCTION macro.
 //
 // Then, when comes the time to check whether the function has been overridden, we take
 // the address of the function and we check whether it falls inside the special function


        


More information about the libcxx-commits mailing list