diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-08-12 17:41:54 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-08-13 14:21:12 -0700 |
commit | 9b3c3cdb62f7142384e6bf2c0cb6e3a76b16f0e3 (patch) | |
tree | ee468053902f5d58bd0037000bc7031ea77175b2 /runtime/base | |
parent | 7b67bee4f6ca4e634f35f63d1e08e1b05f138e01 (diff) | |
download | art-9b3c3cdb62f7142384e6bf2c0cb6e3a76b16f0e3.zip art-9b3c3cdb62f7142384e6bf2c0cb6e3a76b16f0e3.tar.gz art-9b3c3cdb62f7142384e6bf2c0cb6e3a76b16f0e3.tar.bz2 |
C++11 support for ART.
We can now use auto, ranged based loops, etc..
This compiles, the phone boots, and the tests pass.
Depends on:
https://googleplex-android-review.googlesource.com/#/c/342487/
Change-Id: I8ba8ed47d2118e4711668c9c8f973a67beb261b2
Diffstat (limited to 'runtime/base')
-rw-r--r-- | runtime/base/logging.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/base/logging.h b/runtime/base/logging.h index eafa050..ade8d34 100644 --- a/runtime/base/logging.h +++ b/runtime/base/logging.h @@ -32,7 +32,7 @@ << "Check failed: " #x << " " #define CHECK_OP(LHS, RHS, OP) \ - for (::art::EagerEvaluator<typeof(LHS), typeof(RHS)> _values(LHS, RHS); \ + for (auto _values = ::art::MakeEagerEvaluator(LHS, RHS); \ UNLIKELY(!(_values.lhs OP _values.rhs)); /* empty */) \ ::art::LogMessage(__FILE__, __LINE__, FATAL, -1).stream() \ << "Check failed: " << #LHS << " " << #OP << " " << #RHS \ @@ -165,6 +165,11 @@ EAGER_PTR_EVALUATOR(const signed char*, signed char*); EAGER_PTR_EVALUATOR(signed char*, const signed char*); EAGER_PTR_EVALUATOR(signed char*, signed char*); +template <typename LHS, typename RHS> +EagerEvaluator<LHS, RHS> MakeEagerEvaluator(LHS lhs, RHS rhs) { + return EagerEvaluator<LHS, RHS>(lhs, rhs); +} + // This indirection greatly reduces the stack impact of having // lots of checks/logging in a function. struct LogMessageData { |