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

Unified Diff: src/IceBuildDefs.h

Issue 1522433004: eliminate code related to --no-ir-gen (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changes suggested by stichnot Created 5 years 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
« no previous file with comments | « Makefile.standalone ('k') | src/IceClFlags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceBuildDefs.h
diff --git a/src/IceBuildDefs.h b/src/IceBuildDefs.h
index 5dabd9ae86edf3325f2600ece9e60fda0e803283..fc06f65cd8c8c8acb7718c02993e3444ffc71adf 100644
--- a/src/IceBuildDefs.h
+++ b/src/IceBuildDefs.h
@@ -15,70 +15,66 @@
#define SUBZERO_SRC_ICEBUILDDEFS_H
namespace Ice {
- /// \brief Defines constexpr functions that express various Subzero build
- /// system defined values.
- ///
- /// These resulting constexpr functions allow code to in effect be
- /// conditionally compiled without having to do this using the older C++
- /// preprocessor solution.
-
- /** \verbatim
+/// \brief Defines constexpr functions that express various Subzero build
+/// system defined values.
+///
+/// These resulting constexpr functions allow code to in effect be
+/// conditionally compiled without having to do this using the older C++
+/// preprocessor solution.
- For example whenever the value of FEATURE_SUPPORTED is needed, instead
- of (except in these constexpr functions):
+/** \verbatim
- #if FEATURE_SUPPORTED ...
- ...
- #endif
+ For example whenever the value of FEATURE_SUPPORTED is needed, instead
+ of (except in these constexpr functions):
- We can have:
+ #if FEATURE_SUPPORTED ...
+ ...
+ #endif
- namespace Ice {
- namespace BuildDefs {
+ We can have:
- // Use this form when FEATURE_SUPPORTED is guaranteed to be defined on the
- // C++ compiler command line as 0 or 1.
- constexpr bool hasFeature() { return FEATURE_SUPPORTED; }
+ namespace Ice {
+ namespace BuildDefs {
- or
+ // Use this form when FEATURE_SUPPORTED is guaranteed to be defined on the
+ // C++ compiler command line as 0 or 1.
+ constexpr bool hasFeature() { return FEATURE_SUPPORTED; }
- // Use this form when FEATURE_SUPPORTED may not necessarily be defined on
- // the C++ compiler command line.
- constexpr bool hasFeature() {
- #if FEATURE_SUPPORTED
- return true;
- #else // !FEATURE_SUPPORTED
- return false;
- #endif // !FEATURE_SUPPORTED
- }
+ or
- ...} // end of namespace BuildDefs
- } // end of namespace Ice
+ // Use this form when FEATURE_SUPPORTED may not necessarily be defined on
+ // the C++ compiler command line.
+ constexpr bool hasFeature() {
+ #if FEATURE_SUPPORTED
+ return true;
+ #else // !FEATURE_SUPPORTED
+ return false;
+ #endif // !FEATURE_SUPPORTED
+ }
+ ...} // end of namespace BuildDefs
+ } // end of namespace Ice
- And later in the code:
- if (Ice::BuildDefs::hasFeature() {
- ...
- }
+ And later in the code:
- \endverbatim
+ if (Ice::BuildDefs::hasFeature() {
+ ...
+ }
- Since hasFeature() returns a constexpr, an optimizing compiler will know to
- keep or discard the above fragment. In addition, the code will always be
- looked at by the compiler which eliminates the problem with defines in that
- if you don't build that variant, you don't even know if the code would
- compile unless you build with that variant.
+ \endverbatim
- **/
+ Since hasFeature() returns a constexpr, an optimizing compiler will know to
+ keep or discard the above fragment. In addition, the code will always be
+ looked at by the compiler which eliminates the problem with defines in that
+ if you don't build that variant, you don't even know if the code would
+ compile unless you build with that variant.
+ **/
namespace BuildDefs {
// The ALLOW_* etc. symbols must be #defined to zero or non-zero.
-/// Return true if ALLOW_DISABLE_IR_GEN is defined as a non-zero value
-constexpr bool disableIrGen() { return ALLOW_DISABLE_IR_GEN; }
-/// Return true if ALLOW_DUMP is defined as a non-zero value
constexpr bool dump() { return ALLOW_DUMP; }
/// Return true if ALLOW_LLVM_CL is defined as a non-zero value
constexpr bool llvmCl() { return ALLOW_LLVM_CL; }
« no previous file with comments | « Makefile.standalone ('k') | src/IceClFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698