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
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(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 {
diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc
index 089e306..073d67b 100644
--- a/runtime/check_jni.cc
+++ b/runtime/check_jni.cc
@@ -912,7 +912,7 @@
sc.Check(true, types, ##args)
#define CHECK_JNI_EXIT(type, exp) ({ \
- typeof(exp) _rc = (exp); \
+ auto _rc = (exp); \
sc.Check(false, type, _rc); \
_rc; })
#define CHECK_JNI_EXIT_VOID() \
diff --git a/runtime/gc/accounting/card_table.h b/runtime/gc/accounting/card_table.h
index f030626..a1936de 100644
--- a/runtime/gc/accounting/card_table.h
+++ b/runtime/gc/accounting/card_table.h
@@ -47,7 +47,7 @@
public:
static const size_t kCardShift = 7;
static const size_t kCardSize = (1 << kCardShift);
- static const uint8_t kCardClean = 0x0;
+ static const uint8_t kCardClean = 0x0;
static const uint8_t kCardDirty = 0x70;
static CardTable* Create(const byte* heap_begin, size_t heap_capacity);