1 //===--- Debug.cpp -------- Debug utilities ----------------------- C++ -*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file contains debug utilities 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "Debug.h" 14 #include "Configuration.h" 15 16 using namespace _OMP; 17 18 #pragma omp declare target 19 20 extern "C" { 21 void __assert_assume(bool cond, const char *exp, const char *file, int line) { 22 if (!cond && config::isDebugMode(config::DebugLevel::Assertion)) { 23 PRINTF("ASSERTION failed: %s at %s, line %d\n", exp, file, line); 24 __builtin_trap(); 25 } 26 27 __builtin_assume(cond); 28 } 29 } 30 31 #pragma omp end declare target 32