Improve CHECK_<op> logging.
This patch lets us show the lhs and rhs when a relational check fails. (I show
both, even though that looks silly in cases like CHECK_EQ(rc, 0) where we'll
say "rc=-1, 0=0", because it's helpful in cases like CHECK_LT(i, size()) where
we want "i=4, size=2".)
I had to add a few operator<<s for enums, and fix a bunch of signed/unsigned
mismatches, and put the StringPiece operator<< in the right namespace.
Change-Id: I390f38bd97b3f50e12182f36ff027ca067c48d69
diff --git a/src/constants_arm.h b/src/constants_arm.h
index 0849a09..bb693d3 100644
--- a/src/constants_arm.h
+++ b/src/constants_arm.h
@@ -3,6 +3,7 @@
#ifndef ART_SRC_CONSTANTS_ARM_H_
#define ART_SRC_CONSTANTS_ARM_H_
+#include <iosfwd>
#include <stdint.h>
#include "src/casts.h"
#include "src/logging.h"
@@ -54,6 +55,7 @@
kNumberOfCoreRegisters = 16,
kNoRegister = -1,
};
+std::ostream& operator<<(std::ostream& os, const Register& rhs);
enum ScaleFactor {
@@ -101,6 +103,7 @@
kNumberOfSRegisters = 32,
kNoSRegister = -1,
};
+std::ostream& operator<<(std::ostream& os, const SRegister& rhs);
// Values for double-precision floating point registers.
@@ -145,6 +148,7 @@
kNumberOfOverlappingDRegisters = 16,
kNoDRegister = -1,
};
+std::ostream& operator<<(std::ostream& os, const DRegister& rhs);
// Values for the condition field as defined in section A3.2.
@@ -168,6 +172,7 @@
kSpecialCondition = 15, // special condition (refer to section A3.2.1)
kMaxCondition = 16,
};
+std::ostream& operator<<(std::ostream& os, const Condition& rhs);
// Opcodes for Data-processing instructions (instructions with a type 0 and 1)