2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 // debug.h: Debugging utilities.
9 #ifndef COMPILER_DEBUG_H_
10 #define COMPILER_DEBUG_H_
15 #define TRACE_ENABLED // define to enable debug message tracing
18 // Outputs text to the debug log
24 void Trace(const char* format, ...);
29 #else // TRACE_ENABLED
31 #define Trace(...) ((void)0)
33 #endif // TRACE_ENABLED
35 // A macro asserting a condition and outputting failures to the debug log
36 #define ASSERT(expression) do { \
38 Trace("Assert failed: %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \
42 #define UNIMPLEMENTED() do { \
43 Trace("Unimplemented invoked: %s(%d)\n", __FUNCTION__, __LINE__); \
47 #define UNREACHABLE() do { \
48 Trace("Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__); \
52 #endif // COMPILER_DEBUG_H_