1 //===-- int_util.h - internal utility functions ---------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is not part of the interface of this library.
11 // This file defines non-inline utilities which are available for use in the
12 // library. The function definitions themselves are all contained in int_util.c
13 // which will always be compiled into any compiler-rt library.
15 //===----------------------------------------------------------------------===//
20 /// \brief Trigger a program abort (or panic for kernel code).
21 #define compilerrt_abort() __compilerrt_abort_impl(__FILE__, __LINE__, __func__)
23 NORETURN void __compilerrt_abort_impl(const char *file, int line,
24 const char *function);
26 #define COMPILE_TIME_ASSERT(expr) COMPILE_TIME_ASSERT1(expr, __COUNTER__)
27 #define COMPILE_TIME_ASSERT1(expr, cnt) COMPILE_TIME_ASSERT2(expr, cnt)
28 #define COMPILE_TIME_ASSERT2(expr, cnt) \
29 typedef char ct_assert_##cnt[(expr) ? 1 : -1] UNUSED