[libcxx-commits] [PATCH] D143443: [libc++] Use __builtin_FILE and __builtin_LINE in _LIBCPP_ASSERT

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 7 07:36:07 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
ldionne marked 2 inline comments as done.
Closed by commit rGc5c329b75287: [libc++] Use __builtin_FILE and __builtin_LINE in _LIBCPP_ASSERT (authored by ldionne).

Changed prior to commit:
  https://reviews.llvm.org/D143443?vs=495363&id=495535#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143443

Files:
  libcxx/include/__assert


Index: libcxx/include/__assert
===================================================================
--- libcxx/include/__assert
+++ libcxx/include/__assert
@@ -41,7 +41,8 @@
 #  define _LIBCPP_ASSERT(expression, message)                                                                          \
     (__builtin_expect(static_cast<bool>(expression), 1)                                                                \
          ? (void)0                                                                                                     \
-         : _LIBCPP_VERBOSE_ABORT("%s:%d: assertion %s failed: %s", __FILE__, __LINE__, #expression, message))
+         : _LIBCPP_VERBOSE_ABORT(                                                                                      \
+               "%s:%d: assertion %s failed: %s", __builtin_FILE(), __builtin_LINE(), #expression, message))
 #elif !defined(_LIBCPP_ASSERTIONS_DISABLE_ASSUME) && __has_builtin(__builtin_assume)
 #  define _LIBCPP_ASSERT(expression, message)                                                                          \
     (_LIBCPP_DIAGNOSTIC_PUSH _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wassume")                                              \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143443.495535.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230207/3c4282a9/attachment.bin>


More information about the libcxx-commits mailing list