OLD | NEW |
(Empty) | |
| 1 //===- subzero/src/IceBuildDefs.h - Translator build defines ----*- C++ -*-===// |
| 2 // |
| 3 // The Subzero Code Generator |
| 4 // |
| 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. |
| 7 // |
| 8 //===----------------------------------------------------------------------===// |
| 9 // |
| 10 // This file defines constexpr functions to query various #define values. |
| 11 // |
| 12 //===----------------------------------------------------------------------===// |
| 13 |
| 14 #ifndef SUBZERO_SRC_ICEBUILDDEFS_H |
| 15 #define SUBZERO_SRC_ICEBUILDDEFS_H |
| 16 |
| 17 namespace Ice { |
| 18 namespace BuildDefs { |
| 19 |
| 20 // The ALLOW_* etc. symbols must be #defined to zero or non-zero. |
| 21 constexpr bool disableIrGen() { return ALLOW_DISABLE_IR_GEN; } |
| 22 constexpr bool dump() { return ALLOW_DUMP; } |
| 23 constexpr bool llvmCl() { return ALLOW_LLVM_CL; } |
| 24 constexpr bool llvmIr() { return ALLOW_LLVM_IR; } |
| 25 constexpr bool llvmIrAsInput() { return ALLOW_LLVM_IR_AS_INPUT; } |
| 26 constexpr bool minimal() { return ALLOW_MINIMAL_BUILD; } |
| 27 constexpr bool textualBitcode() { return INPUT_IS_TEXTUAL_BITCODE; } |
| 28 |
| 29 // NDEBUG can be undefined, or defined to something arbitrary. |
| 30 constexpr bool asserts() { |
| 31 #ifdef NDEBUG |
| 32 return false; |
| 33 #else // !NDEBUG |
| 34 return true; |
| 35 #endif // !NDEBUG |
| 36 } |
| 37 |
| 38 // ALLOW_EXTRA_VALIDATION can be undefined, or defined to something non-zero. |
| 39 constexpr bool extraValidation() { |
| 40 #if ALLOW_EXTRA_VALIDATION |
| 41 return true; |
| 42 #else // !ALLOW_EXTRA_VALIDATION |
| 43 return false; |
| 44 #endif // !ALLOW_EXTRA_VALIDATION |
| 45 } |
| 46 |
| 47 } // end of namespace BuildDefs |
| 48 } // end of namespace Ice |
| 49 |
| 50 #endif // SUBZERO_SRC_ICEBUILDDEFS_H |
OLD | NEW |