From 9199ae69517a4c78a304902a0a7b0045628c20d0 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Mon, 17 Sep 2012 18:02:29 -0700 Subject: [PATCH] Fix all clang warnings introduced by the Ionmonkey landing (and one or two predating it). No bug, r=dvander over IRC --HG-- extra : rebase_source : 60d83d511c3e1cb7c1673f5c5e7800996716fcc1 --- js/src/ion/MIR.h | 6 +----- js/src/ion/MIRGraph.cpp | 2 +- js/src/ion/shared/IonFrames-x86-shared.h | 3 +++ js/src/ion/shared/MacroAssembler-x86-shared.h | 2 -- js/src/jsutil.h | 9 +++++---- js/src/jsworkers.h | 8 ++++++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index cf36b2e74cd..feb59aeba85 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -4641,7 +4641,6 @@ class MDeleteProperty public BoxInputsPolicy { CompilerRootPropertyName name_; - bool needsBarrier_; protected: MDeleteProperty(MDefinition *val, HandlePropertyName name) @@ -5434,12 +5433,9 @@ class FlattenedMResumePointIter MResumePoint *newest; size_t numOperands_; - size_t resumePointIndex; - size_t operand; - public: explicit FlattenedMResumePointIter(MResumePoint *newest) - : newest(newest), numOperands_(0), resumePointIndex(0), operand(0) + : newest(newest), numOperands_(0) {} bool init() { diff --git a/js/src/ion/MIRGraph.cpp b/js/src/ion/MIRGraph.cpp index 04237f2e9d5..0e2465980ce 100644 --- a/js/src/ion/MIRGraph.cpp +++ b/js/src/ion/MIRGraph.cpp @@ -185,7 +185,7 @@ MBasicBlock::inherit(MBasicBlock *pred) for (size_t i = 0; i < stackDepth(); i++) { MPhi *phi = MPhi::New(i); if (!phi->addInput(pred->getSlot(i))) - return NULL; + return false; addPhi(phi); setSlot(i, phi); entryResumePoint()->initOperand(i, phi); diff --git a/js/src/ion/shared/IonFrames-x86-shared.h b/js/src/ion/shared/IonFrames-x86-shared.h index d543381b4f8..9f63adf7ae5 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.h +++ b/js/src/ion/shared/IonFrames-x86-shared.h @@ -197,6 +197,7 @@ class IonExitFrameLayout : public IonCommonFrameLayout class IonNativeExitFrameLayout { + protected: // only to silence a clang warning about unused private fields IonExitFooterFrame footer_; IonExitFrameLayout exit_; uintptr_t argc_; @@ -224,6 +225,7 @@ class IonNativeExitFrameLayout class IonDOMExitFrameLayout { + protected: // only to silence a clang warning about unused private fields IonExitFooterFrame footer_; IonExitFrameLayout exit_; JSObject *thisObj; @@ -257,6 +259,7 @@ class IonDOMExitFrameLayout class IonDOMMethodExitFrameLayout { + protected: // only to silence a clang warning about unused private fields IonExitFooterFrame footer_; IonExitFrameLayout exit_; // This must be the last thing pushed, so as to stay common with diff --git a/js/src/ion/shared/MacroAssembler-x86-shared.h b/js/src/ion/shared/MacroAssembler-x86-shared.h index bd006f058db..7e7a2df969e 100644 --- a/js/src/ion/shared/MacroAssembler-x86-shared.h +++ b/js/src/ion/shared/MacroAssembler-x86-shared.h @@ -21,8 +21,6 @@ namespace js { namespace ion { -static Register CallReg = ReturnReg; - class MacroAssemblerX86Shared : public Assembler { protected: diff --git a/js/src/jsutil.h b/js/src/jsutil.h index e6e28f30214..9f0c922a231 100644 --- a/js/src/jsutil.h +++ b/js/src/jsutil.h @@ -454,10 +454,11 @@ typedef size_t jsbitmap; #if defined(__clang__) # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ JS_BEGIN_MACRO \ - _Pragma("(clang diagnostic push)") \ - _Pragma("(clang diagnostic ignored \"-Wunused-value\")") \ - {expr;} \ - _Pragma("(clang diagnostic pop)") \ + _Pragma("clang diagnostic push") \ + /* If these _Pragmas cause warnings for you, try disabling ccache. */ \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + { expr; } \ + _Pragma("clang diagnostic pop") \ JS_END_MACRO #elif (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \ diff --git a/js/src/jsworkers.h b/js/src/jsworkers.h index 9effe64201c..54c492fa05f 100644 --- a/js/src/jsworkers.h +++ b/js/src/jsworkers.h @@ -121,10 +121,12 @@ class AutoLockWorkerThreadState AutoLockWorkerThreadState(JSRuntime *rt JS_GUARD_OBJECT_NOTIFIER_PARAM) : rt(rt) { + JS_GUARD_OBJECT_NOTIFIER_INIT; #ifdef JS_PARALLEL_COMPILATION rt->workerThreadState->lock(); +#else + (void)this->rt; #endif - JS_GUARD_OBJECT_NOTIFIER_INIT; } ~AutoLockWorkerThreadState() @@ -145,10 +147,12 @@ class AutoUnlockWorkerThreadState AutoUnlockWorkerThreadState(JSRuntime *rt JS_GUARD_OBJECT_NOTIFIER_PARAM) : rt(rt) { + JS_GUARD_OBJECT_NOTIFIER_INIT; #ifdef JS_PARALLEL_COMPILATION rt->workerThreadState->unlock(); +#else + (void)this->rt; #endif - JS_GUARD_OBJECT_NOTIFIER_INIT; } ~AutoUnlockWorkerThreadState()