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 //===----------------------------------------------------------------------===//
14 #include "Configuration.h"
15 #include "Environment.h"
16 #include "Interface.h"
23 #pragma omp begin declare target device_type(nohost)
26 void __assert_assume(bool condition
) { __builtin_assume(condition
); }
28 void __assert_fail(const char *expr
, const char *file
, unsigned line
,
29 const char *function
) {
30 __assert_fail_internal(expr
, nullptr, file
, line
, function
);
32 void __assert_fail_internal(const char *expr
, const char *msg
, const char *file
,
33 unsigned line
, const char *function
) {
35 PRINTF("%s:%u: %s: Assertion %s (`%s') failed.\n", file
, line
, function
,
38 PRINTF("%s:%u: %s: Assertion `%s' failed.\n", file
, line
, function
, expr
);
44 #pragma omp end declare target