Bug 1510586 - Integrate clang-format into BinAST code generator. r=Yoric
authorTooru Fujisawa <arai_a@mac.com>
Thu, 10 Jan 2019 02:53:50 +0000
changeset 510303 0d7629792afb8a8d932c4bef3359f39d83af13a5
parent 510302 efed3e60a2494a67deaabebcf71c9af24f3ddad2
child 510304 e676737b9689ff7e95741e6f4a67baf3abf8c7ee
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1510586
milestone66.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 1510586 - Integrate clang-format into BinAST code generator. r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D15059
js/src/frontend/BinSource.yaml
js/src/frontend/binsource/build.sh
--- a/js/src/frontend/BinSource.yaml
+++ b/js/src/frontend/BinSource.yaml
@@ -13,18 +13,18 @@ parser:
         nullptr
     list:
         append: |
             result->appendWithoutOrderAssumption(item);
 
 # Rules for generating BinASTParser.cpp
 cpp:
     header: |
-        /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-        * vim: set ts=8 sts=4 et sw=4 tw=99:
+        /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+        * vim: set ts=8 sts=2 et sw=2 tw=80:
         * 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/. */
 
         // To generate this file, see the documentation in
         // js/src/frontend/binsource/README.md.
 
         #include "frontend/BinASTParser.h"
@@ -68,18 +68,18 @@ cpp:
         } // namespace js
 
 
 
 hpp:
     # Rules for generating BinASTParser.h
     class:
         header: |
-            /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-            * vim: set ts=8 sts=4 et sw=4 tw=99:
+            /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+            * vim: set ts=8 sts=2 et sw=2 tw=80:
             * 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/. */
 
             // To generate this file, see the documentation in
             // js/src/frontend/binsource/README.md.
 
             #ifndef frontend_BinASTParser_h
@@ -198,18 +198,18 @@ hpp:
 
             } // namespace frontend
             } // namespace js
 
             #endif // frontend_BinASTParser_h
 
     enums:
         header: |
-            /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-            * vim: set ts=8 sts=4 et sw=4 tw=99:
+            /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+            * vim: set ts=8 sts=2 et sw=2 tw=80:
             * 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/. */
 
             // To generate this file, see the documentation in
             // js/src/frontend/binsource/README.md.
 
             #ifndef frontend_BinASTEnum_h
@@ -275,18 +275,18 @@ hpp:
                  * #define WITH_VARIANT(CPP_NAME, SPEC_NAME) ...
                  * FOR_EACH_BIN_VARIANT(WITH_VARIANT)
                  * ```
                  *
                  * (sorted by alphabetical order)
                  */
 
         header: |
-            /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-             * vim: set ts=8 sts=4 et sw=4 tw=99:
+            /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+             * vim: set ts=8 sts=2 et sw=2 tw=80:
              * 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/. */
 
 
             // To generate this file, see the documentation in
             // js/src/frontend/binsource/README.md.
 
--- a/js/src/frontend/binsource/build.sh
+++ b/js/src/frontend/binsource/build.sh
@@ -2,8 +2,16 @@
 
 cargo run -- \
       ../BinSource.webidl_ \
       ../BinSource.yaml \
       --out-class ../BinASTParser.h    \
       --out-impl ../BinASTParser.cpp   \
       --out-enum ../BinASTEnum.h    \
       --out-token ../BinToken.h
+
+MACH=../../../../mach
+
+${MACH} clang-format --path \
+        ../BinASTParser.h \
+        ../BinASTParser.cpp \
+        ../BinASTEnum.h \
+        ../BinToken.h