summaryrefslogtreecommitdiffstats
path: root/runtime/utils.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2014-06-11 12:12:07 +0100
committerVladimir Marko <vmarko@google.com>2014-06-11 14:07:28 +0100
commit836424805dd48af67088d30992a3f2e6841ca047 (patch)
tree7ef4b2fbe4ec82f3845f201f1a3befe70571739d /runtime/utils.h
parent3283ade469f515f89d70cf47b6ac6fe1814147f2 (diff)
downloadart-836424805dd48af67088d30992a3f2e6841ca047.tar.gz
art-836424805dd48af67088d30992a3f2e6841ca047.tar.bz2
art-836424805dd48af67088d30992a3f2e6841ca047.zip
Add D/CHECK_CONSTEXPR macros for use in constexpr context.
Make most RegStorage methods constexpr, make StorageSize() const. Change-Id: Ie63faa3b081094b3dd30352c6240fdf10ef8b87e
Diffstat (limited to 'runtime/utils.h')
-rw-r--r--runtime/utils.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/utils.h b/runtime/utils.h
index 6a4198fcfc..6d52459ec8 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -140,9 +140,8 @@ struct TypeIdentity {
template<typename T>
static constexpr T RoundDown(T x, typename TypeIdentity<T>::type n) {
return
- // DCHECK(IsPowerOfTwo(n)) in a form acceptable in a constexpr function:
- (kIsDebugBuild && !IsPowerOfTwo(n)) ? (LOG(FATAL) << n << " isn't a power of 2", T(0))
- : (x & -n);
+ DCHECK_CONSTEXPR(IsPowerOfTwo(n), , T(0))
+ (x & -n);
}
template<typename T>