From: danno@chromium.org Date: Wed, 17 Oct 2012 14:20:43 +0000 (+0000) Subject: MIPS: Fix compilation under clang. X-Git-Tag: upstream/4.7.83~15836 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=966b08440c8aa9f7b215ba148e37a6d1e6397a8a;p=platform%2Fupstream%2Fv8.git 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 . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/assembler-mips.h b/src/mips/assembler-mips.h index ee4daad..6ee21c2 100644 --- a/src/mips/assembler-mips.h +++ b/src/mips/assembler-mips.h @@ -318,12 +318,15 @@ const FPURegister f31 = { 31 }; // 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. diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 4015bff..4a6a1fd 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -1829,12 +1829,11 @@ LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( 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::DoStoreKeyedFastDoubleElement( 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());