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

Unified Diff: src/IceDefs.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: Use constexpr inline functions instead of macros Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: src/IceDefs.h
diff --git a/src/IceDefs.h b/src/IceDefs.h
index 453127523a4a3c460f13fe3c2e1224220bfdb57f..37fa2847ca4560ed3258c1897ab36b8ea448665f 100644
--- a/src/IceDefs.h
+++ b/src/IceDefs.h
@@ -45,6 +45,30 @@
namespace Ice {
+constexpr bool buildAllowsAsserts() {
John 2015/06/23 22:28:30 optional: As we spoke during our walk back, it see
Jim Stichnoth 2015/06/24 21:27:27 Done. I went with BuildDefs::asserts(), and simil
+#ifdef NDEBUG
John 2015/06/23 22:28:30 This is a bit surprising to me. I always though -
Jim Stichnoth 2015/06/24 21:27:27 Yep, NDEBUG is either defined or not, and its valu
+ return false;
+#else // !NDEBUG
+ return true;
+#endif // !NDEBUG
+}
+
+constexpr bool buildAllowsExtraValidation() {
+#ifdef ALLOW_EXTRA_VALIDATION
John 2015/06/23 22:28:30 probably just #if ALLOW_EXTRA_VALIDATION ? Othe
Jim Stichnoth 2015/06/24 21:27:27 Done.
+ return true;
+#else // !ALLOW_EXTRA_VALIDATION
+ return false;
+#endif // !ALLOW_EXTRA_VALIDATION
+}
+
+constexpr bool buildAllowsDump() {
+#if defined(ALLOW_DUMP) && ALLOW_DUMP
John 2015/06/23 22:28:30 this can be simply #if ALLOW_DUMP (see https://
Jim Stichnoth 2015/06/24 21:27:27 Done.
+ return true;
+#else // !ALLOW_DUMP
+ return false;
+#endif // !ALLOW_DUMP
+}
+
class Assembler;
class Cfg;
class CfgNode;
« src/IceAssemblerX8632.cpp ('K') | « src/IceConverter.cpp ('k') | src/IceFixups.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698