Bug 1508067 - Use clang-format off in vm/Opcodes.h instead of file ignore. r=sylvestre,jandem
authorTed Campbell <tcampbell@mozilla.com>
Mon, 19 Nov 2018 09:27:17 +0000
changeset 447071 e92a6ab741287f97ba8dd35f631e1a4c37097160
parent 447070 0c683a3e80d8b437e3bf9d4b81a84458465d74a3
child 447072 c376952fc91969b904b31cc0da568bb716cc17df
push id109977
push userrmaries@mozilla.com
push dateMon, 19 Nov 2018 22:37:16 +0000
treeherdermozilla-inbound@81b77c4f014e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre, jandem
bugs1508067
milestone65.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 1508067 - Use clang-format off in vm/Opcodes.h instead of file ignore. r=sylvestre,jandem Differential Revision: https://phabricator.services.mozilla.com/D12240
.clang-format-ignore
js/src/vm/Opcodes.h
--- a/.clang-format-ignore
+++ b/.clang-format-ignore
@@ -9,18 +9,16 @@ dom/media/gtest/.*
 gfx/testsd/.*
 .*/gtest/ExampleStylesheet.h
 image/test/.*
 ipc/ipdl/test/.*
 ipc/testshell/.*
 # Generated code
 js/src/builtin/intl/TimeZoneDataGenerated.h
 js/src/jsapi-tests/.*
-# See bug 1395584
-js/src/vm/Opcodes.h
 
 # Ignored because of bug 1506117 & 1342657
 layout/style/nsCSSAnonBoxList.h
 layout/style/nsCSSCounterDescList.h
 layout/style/nsCSSFontDescList.h
 layout/style/nsCSSKeywordList.h
 layout/style/nsCSSPseudoElementList.h
 layout/style/nsCSSVisitedDependentPropList.h
--- a/js/src/vm/Opcodes.h
+++ b/js/src/vm/Opcodes.h
@@ -34,16 +34,17 @@
  * token        Pretty-printer string, or null if ugly
  * length       Number of bytes including any immediate operands
  * nuses        Number of stack slots consumed by bytecode, -1 if variadic
  * ndefs        Number of stack slots produced by bytecode, -1 if variadic
  * format       Bytecode plus immediate operand encoding format
  *
  */
 
+// clang-format off
 /*
  * SpiderMonkey bytecode categorization (as used in generated documentation):
  *
  * [Index]
  *   [Statements]
  *     Jumps
  *     Switch Statement
  *     For-In Statement
@@ -76,17 +77,19 @@
  *   [Literals]
  *     Constants
  *     Object
  *     Array
  *     RegExp
  *     Class
  *   [Other]
  */
+// clang-format on
 
+// clang-format off
 #define FOR_EACH_OPCODE(MACRO) \
     /*
      * No operation is performed.
      *
      *   Category: Other
      *   Operands:
      *   Stack: =>
      */ \
@@ -2502,16 +2505,17 @@
     /*
      * Pushes a BigInt constant onto the stack.
      *   Category: Literals
      *   Type: Constants
      *   Operands: uint32_t constIndex
      *   Stack: => val
      */ \
     IF_BIGINT(MACRO(JSOP_BIGINT, 234, "bigint", NULL, 5, 0, 1, JOF_BIGINT),)
+// clang-format on
 
 /*
  * In certain circumstances it may be useful to "pad out" the opcode space to
  * a power of two.  Use this macro to do so.
  */
 #define FOR_EACH_TRAILING_UNUSED_OPCODE(MACRO) \
     IF_BIGINT(,MACRO(234)) \
     MACRO(235) \
@@ -2537,28 +2541,30 @@
     MACRO(255)
 
 namespace js {
 
 // Sanity check that opcode values and trailing unused opcodes completely cover
 // the [0, 256) range.  Avert your eyes!  You don't want to know how the
 // sausage gets made.
 
+// clang-format off
 #define VALUE_AND_VALUE_PLUS_ONE(op, val, ...) \
     val) && (val + 1 ==
 #define TRAILING_VALUE_AND_VALUE_PLUS_ONE(val) \
     val) && (val + 1 ==
 static_assert((0 ==
                FOR_EACH_OPCODE(VALUE_AND_VALUE_PLUS_ONE)
                FOR_EACH_TRAILING_UNUSED_OPCODE(TRAILING_VALUE_AND_VALUE_PLUS_ONE)
                256),
               "opcode values and trailing unused opcode values monotonically "
               "increase from zero to 255");
 #undef TRAILING_VALUE_AND_VALUE_PLUS_ONE
 #undef VALUE_AND_VALUE_PLUS_ONE
+// clang-format on
 
 // Define JSOP_*_LENGTH constants for all ops.
 #define DEFINE_LENGTH_CONSTANT(op, val, name, image, len, ...) \
     constexpr size_t op##_LENGTH = len;
 FOR_EACH_OPCODE(DEFINE_LENGTH_CONSTANT)
 #undef DEFINE_LENGTH_CONSTANT
 
 } // namespace js