From b369aa91bc9764f441685eb2d000471c801ed2ce Mon Sep 17 00:00:00 2001 From: Paul Tarjan Date: Mon, 3 Jun 2013 19:50:24 -0700 Subject: [PATCH] compile with -Wunused-but-set-variable Our open-source build compiles with these warnings, so they cause spew when building from github. And I think they are good to catch programmer error. --- hphp/runtime/vm/jit/codegen.cpp | 4 +++- hphp/runtime/vm/jit/linearscan.cpp | 2 +- hphp/runtime/vm/jit/translator.cpp | 4 ---- hphp/runtime/vm/jit/vectortranslator.cpp | 8 -------- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/hphp/runtime/vm/jit/codegen.cpp b/hphp/runtime/vm/jit/codegen.cpp index 8cf5443e2..3e4b2a321 100644 --- a/hphp/runtime/vm/jit/codegen.cpp +++ b/hphp/runtime/vm/jit/codegen.cpp @@ -5419,7 +5419,9 @@ void genCodeForTrace(Trace* trace, CodegenState state(irFactory, regs, live_regs, lifetime, asmInfo); // Returns: whether a block has already been emitted. - auto isEmitted = [&](Block* block) { return state.addresses[block]; }; + DEBUG_ONLY auto isEmitted = [&](Block* block) { + return state.addresses[block]; + }; /* * Emit the given block on the supplied assembler. The `nextBlock' diff --git a/hphp/runtime/vm/jit/linearscan.cpp b/hphp/runtime/vm/jit/linearscan.cpp index 45ca5eefa..e48d7ac7e 100644 --- a/hphp/runtime/vm/jit/linearscan.cpp +++ b/hphp/runtime/vm/jit/linearscan.cpp @@ -321,7 +321,7 @@ PhysReg::Type LinearScan::getRegType(const SSATmp* tmp, int locIdx) const { if (packed_tv) return PhysReg::GP; - Type tmpType = tmp->type(); + DEBUG_ONLY Type tmpType = tmp->type(); uint32_t tmpId = tmp->id(); diff --git a/hphp/runtime/vm/jit/translator.cpp b/hphp/runtime/vm/jit/translator.cpp index deb402c7e..ce3e60fa9 100644 --- a/hphp/runtime/vm/jit/translator.cpp +++ b/hphp/runtime/vm/jit/translator.cpp @@ -943,10 +943,6 @@ getDynLocType(const vector& inputs, } const bool setElem = mcodeMaybeArrayKey(ni->immVecM[0]); - const bool setNewElem = ni->immVecM[0] == MW; - const Type keyType = - setNewElem ? Type::None - : Type::fromRuntimeType(inputs[2]->rtt); const Type valType = Type::fromRuntimeType(inputs[0]->rtt); if (setElem && baseType.maybe(Type::Str)) { if (baseType.isString()) { diff --git a/hphp/runtime/vm/jit/vectortranslator.cpp b/hphp/runtime/vm/jit/vectortranslator.cpp index d45b75c64..8e6464742 100644 --- a/hphp/runtime/vm/jit/vectortranslator.cpp +++ b/hphp/runtime/vm/jit/vectortranslator.cpp @@ -182,14 +182,6 @@ void VectorEffects::init(Opcode op, const Type origBase, } } - // Setting an element with a base of one of these types will either succeed - // (with possible promotion) or fatal - const Type okBase = Type::Str | Type::Arr | Type::Obj; - - // Setting an element with one of these types as the key will fail, issue a - // warning, and evaulate to null. - const Type badArrKey = Type::Arr | Type::Obj; - // The final baseType should be a pointer/box iff the input was baseType = baseBoxed ? baseType.box() : baseType; baseType = basePtr ? baseType.ptr() : baseType;