Revision: 12748
Author: [email protected]
Date: Wed Oct 17 07:20:43 2012
Log: MIPS: Fix compilation under clang.
Clang is a little more picky than gcc on unused variable
warnings, which become errors with -Werror. Clean up
these cases for mips.
BUG=
TEST=
Review URL: https://codereview.chromium.org/11175005
Patch from Akos Palfi <[email protected]>.
http://code.google.com/p/v8/source/detail?r=12748
Modified:
/branches/bleeding_edge/src/mips/assembler-mips.h
/branches/bleeding_edge/src/mips/lithium-mips.cc
=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.h Thu Oct 4 02:46:50
2012
+++ /branches/bleeding_edge/src/mips/assembler-mips.h Wed Oct 17 07:20:43
2012
@@ -318,12 +318,15 @@
// Register aliases.
// cp is assumed to be a callee saved register.
-static const Register& kLithiumScratchReg = s3; // Scratch register.
-static const Register& kLithiumScratchReg2 = s4; // Scratch register.
-static const Register& kRootRegister = s6; // Roots array pointer.
-static const Register& cp = s7; // JavaScript context pointer.
-static const DoubleRegister& kLithiumScratchDouble = f30;
-static const FPURegister& kDoubleRegZero = f28;
+// Defined using #define instead of "static const Register&" because Clang
+// complains otherwise when a compilation unit that includes this header
+// doesn't use the variables.
+#define kRootRegister s6
+#define cp s7
+#define kLithiumScratchReg s3
+#define kLithiumScratchReg2 s4
+#define kLithiumScratchDouble f30
+#define kDoubleRegZero f28
// FPU (coprocessor 1) control registers.
// Currently only FCSR (#31) is implemented.
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Oct 15 00:25:20
2012
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Wed Oct 17 07:20:43
2012
@@ -1829,12 +1829,11 @@
LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement(
HLoadKeyedSpecializedArrayElement* instr) {
ElementsKind elements_kind = instr->elements_kind();
- Representation representation(instr->representation());
ASSERT(
- (representation.IsInteger32() &&
+ (instr->representation().IsInteger32() &&
(elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
(elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
- (representation.IsDouble() &&
+ (instr->representation().IsDouble() &&
((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
(elements_kind == EXTERNAL_DOUBLE_ELEMENTS))));
ASSERT(instr->key()->representation().IsInteger32() ||
@@ -1897,13 +1896,12 @@
LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement(
HStoreKeyedSpecializedArrayElement* instr) {
- Representation representation(instr->value()->representation());
ElementsKind elements_kind = instr->elements_kind();
ASSERT(
- (representation.IsInteger32() &&
+ (instr->value()->representation().IsInteger32() &&
(elements_kind != EXTERNAL_FLOAT_ELEMENTS) &&
(elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
- (representation.IsDouble() &&
+ (instr->value()->representation().IsDouble() &&
((elements_kind == EXTERNAL_FLOAT_ELEMENTS) ||
(elements_kind == EXTERNAL_DOUBLE_ELEMENTS))));
ASSERT(instr->external_pointer()->representation().IsExternal());
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev