37 lines · plain
1// -*- C++ -*-2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCPP___VERBOSE_TRAP11#define _LIBCPP___VERBOSE_TRAP12 13#include <__config>14 15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16# pragma GCC system_header17#endif18 19_LIBCPP_BEGIN_NAMESPACE_STD20 21#if __has_builtin(__builtin_verbose_trap)22// AppleClang shipped a slightly different version of __builtin_verbose_trap from the upstream23// version before upstream Clang actually got the builtin.24// TODO: Remove once AppleClang supports the two-arguments version of the builtin.25# if defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 170026# define _LIBCPP_VERBOSE_TRAP(message) __builtin_verbose_trap(message)27# else28# define _LIBCPP_VERBOSE_TRAP(message) __builtin_verbose_trap("libc++", message)29# endif30#else31# define _LIBCPP_VERBOSE_TRAP(message) ((void)message, __builtin_trap())32#endif33 34_LIBCPP_END_NAMESPACE_STD35 36#endif // _LIBCPP___VERBOSE_TRAP37