1 //===--- Debug.cpp -------- Debug utilities ----------------------- C++ -*-===//
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 contains debug utilities
11 //===----------------------------------------------------------------------===//
13 #include "Shared/Environment.h"
15 #include "Configuration.h"
17 #include "Interface.h"
24 #pragma omp begin declare target device_type(nohost)
27 void __assert_assume(bool condition
) { __builtin_assume(condition
); }
29 [[gnu::weak
]] void __assert_fail(const char *expr
, const char *file
,
30 unsigned line
, const char *function
) {
31 __assert_fail_internal(expr
, nullptr, file
, line
, function
);
33 void __assert_fail_internal(const char *expr
, const char *msg
, const char *file
,
34 unsigned line
, const char *function
) {
36 PRINTF("%s:%u: %s: Assertion %s (`%s`) failed.\n", file
, line
, function
,
39 PRINTF("%s:%u: %s: Assertion `%s` failed.\n", file
, line
, function
, expr
);
45 #pragma omp end declare target