Bug 1442599 - Part 3: Move JS_SILENCE_UNUSED_VALUE_IN_EXPR macro to last remaining call site. r=jorendorff
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 15 Mar 2018 03:41:33 -0700
changeset 408311 12150eddce352b3cdc6473114e52035025cfa3ce
parent 408310 593825fbb67430a901d6bdf0f6ec3e8f1264fe43
child 408312 2269c7ed37ff9f28bf8bbd4c97b886e52fadaf2c
push id33634
push usercbrindusan@mozilla.com
push dateThu, 15 Mar 2018 23:37:18 +0000
treeherdermozilla-central@16e69d4df5dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1442599
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1442599 - Part 3: Move JS_SILENCE_UNUSED_VALUE_IN_EXPR macro to last remaining call site. r=jorendorff
js/src/builtin/Profilers.cpp
js/src/jsutil.h
--- a/js/src/builtin/Profilers.cpp
+++ b/js/src/builtin/Profilers.cpp
@@ -3,16 +3,17 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Profiling-related API */
 
 #include "builtin/Profilers.h"
 
+#include "mozilla/Compiler.h"
 #include "mozilla/Sprintf.h"
 
 #include <stdarg.h>
 
 #ifdef MOZ_CALLGRIND
 # include <valgrind/callgrind.h>
 #endif
 
@@ -408,16 +409,44 @@ JS_DefineProfilingFunctions(JSContext* c
     return JS_DefineFunctions(cx, obj, profiling_functions);
 #else
     return true;
 #endif
 }
 
 #ifdef MOZ_CALLGRIND
 
+/* Wrapper for various macros to stop warnings coming from their expansions. */
+#if defined(__clang__)
+# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \
+    JS_BEGIN_MACRO                                                            \
+        _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 MOZ_IS_GCC
+
+# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \
+    JS_BEGIN_MACRO                                                            \
+        _Pragma("GCC diagnostic push")                                        \
+        _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"")       \
+        expr;                                                                 \
+        _Pragma("GCC diagnostic pop")                                         \
+    JS_END_MACRO
+#endif
+
+#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)
+# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \
+    JS_BEGIN_MACRO                                                            \
+        expr;                                                                 \
+    JS_END_MACRO
+#endif
+
 JS_FRIEND_API(bool)
 js_StartCallgrind()
 {
     JS_SILENCE_UNUSED_VALUE_IN_EXPR(CALLGRIND_START_INSTRUMENTATION);
     JS_SILENCE_UNUSED_VALUE_IN_EXPR(CALLGRIND_ZERO_STATS);
     return true;
 }
 
--- a/js/src/jsutil.h
+++ b/js/src/jsutil.h
@@ -7,17 +7,16 @@
 /*
  * PR assertion checker.
  */
 
 #ifndef jsutil_h
 #define jsutil_h
 
 #include "mozilla/Assertions.h"
-#include "mozilla/Compiler.h"
 #include "mozilla/HashFunctions.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/PodOperations.h"
 
 #include <limits.h>
 
 #include "js/Initialization.h"
 #include "js/Utility.h"
@@ -367,37 +366,9 @@ JS_MeanAndStdDev(uint32_t num, double su
 extern void
 JS_DumpBasicStats(JSBasicStats* bs, const char* title, FILE* fp);
 extern void
 JS_DumpHistogram(JSBasicStats* bs, FILE* fp);
 #else
 # define JS_BASIC_STATS_ACCUM(bs,val)
 #endif
 
-/* Wrapper for various macros to stop warnings coming from their expansions. */
-#if defined(__clang__)
-# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \
-    JS_BEGIN_MACRO                                                            \
-        _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 MOZ_IS_GCC
-
-# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \
-    JS_BEGIN_MACRO                                                            \
-        _Pragma("GCC diagnostic push")                                        \
-        _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"")       \
-        expr;                                                                 \
-        _Pragma("GCC diagnostic pop")                                         \
-    JS_END_MACRO
-#endif
-
-#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)
-# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \
-    JS_BEGIN_MACRO                                                            \
-        expr;                                                                 \
-    JS_END_MACRO
-#endif
-
 #endif /* jsutil_h */