1 //===- debug.h - Debugging output 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 is a part of the ORC runtime support library.
11 //===----------------------------------------------------------------------===//
13 #ifndef ORC_RT_DEBUG_H
14 #define ORC_RT_DEBUG_H
22 extern std::atomic
<const char *> DebugTypes
;
23 extern char DebugTypesAll
;
24 extern char DebugTypesNone
;
26 const char *initializeDebug();
27 bool debugTypeEnabled(const char *Type
, const char *Types
);
28 void printdbg(const char *format
, ...);
32 #define ORC_RT_DEBUG_WITH_TYPE(TYPE, X) \
34 const char *Types = ::orc_rt::DebugTypes.load(std::memory_order_relaxed); \
36 Types = initializeDebug(); \
37 if (Types == &DebugTypesNone) \
39 if (Types == &DebugTypesAll || ::orc_rt::debugTypeEnabled(TYPE, Types)) { \
46 #define ORC_RT_DEBUG_WITH_TYPE(TYPE, X) \
52 #define ORC_RT_DEBUG(X) ORC_RT_DEBUG_WITH_TYPE(DEBUG_TYPE, X)
54 #endif // ORC_RT_DEBUG_H