Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Side by Side Diff: src/IceBuildDefs.h

Issue 1197863003: Subzero: Reduce the amount of #ifdef'd code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceAssemblerX8632.cpp ('k') | src/IceCfg.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « src/IceAssemblerX8632.cpp ('k') | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698