diff --git a/build/autoconf/clang-plugin.m4 b/build/autoconf/clang-plugin.m4 index a3618189189e..08d6329bf02e 100644 --- a/build/autoconf/clang-plugin.m4 +++ b/build/autoconf/clang-plugin.m4 @@ -133,7 +133,6 @@ AC_SUBST_LIST(LLVM_LDFLAGS) AC_SUBST_LIST(CLANG_LDFLAGS) AC_SUBST(ENABLE_CLANG_PLUGIN) -AC_SUBST(ENABLE_CLANG_PLUGIN_ALPHA) AC_SUBST(ENABLE_MOZSEARCH_PLUGIN) ]) diff --git a/build/clang-plugin/DiagnosticsMatcher.cpp b/build/clang-plugin/DiagnosticsMatcher.cpp index 96d2f60440b7..d6841eab6a31 100644 --- a/build/clang-plugin/DiagnosticsMatcher.cpp +++ b/build/clang-plugin/DiagnosticsMatcher.cpp @@ -10,8 +10,5 @@ DiagnosticsMatcher::DiagnosticsMatcher(CompilerInstance &CI) { cls##_.registerPPCallbacks(CI); #include "Checks.inc" #include "external/ExternalChecks.inc" -#ifdef MOZ_CLANG_PLUGIN_ALPHA -#include "alpha/AlphaChecks.inc" -#endif #undef CHECK } diff --git a/build/clang-plugin/DiagnosticsMatcher.h b/build/clang-plugin/DiagnosticsMatcher.h index 2738541f62c6..b93aa5333f5d 100644 --- a/build/clang-plugin/DiagnosticsMatcher.h +++ b/build/clang-plugin/DiagnosticsMatcher.h @@ -7,9 +7,6 @@ #include "ChecksIncludes.inc" #include "external/ExternalIncludes.inc" -#ifdef MOZ_CLANG_PLUGIN_ALPHA -#include "alpha/AlphaIncludes.inc" -#endif class DiagnosticsMatcher { public: @@ -21,9 +18,6 @@ private: #define CHECK(cls, name) cls cls##_{name}; #include "Checks.inc" #include "external/ExternalChecks.inc" -#ifdef MOZ_CLANG_PLUGIN_ALPHA -#include "alpha/AlphaChecks.inc" -#endif #undef CHECK MatchFinder AstMatcher; }; diff --git a/build/clang-plugin/MozillaTidyModule.cpp b/build/clang-plugin/MozillaTidyModule.cpp index c78d4dc87d7b..aacb3e933585 100644 --- a/build/clang-plugin/MozillaTidyModule.cpp +++ b/build/clang-plugin/MozillaTidyModule.cpp @@ -20,9 +20,6 @@ public: #define CHECK(cls, name) CheckFactories.registerCheck("mozilla-" name); #include "Checks.inc" #include "external/ExternalChecks.inc" -#ifdef MOZ_CLANG_PLUGIN_ALPHA -#include "alpha/AlphaChecks.inc" -#endif #undef CHECK } }; diff --git a/build/clang-plugin/alpha/AlphaChecks.inc b/build/clang-plugin/alpha/AlphaChecks.inc deleted file mode 100644 index 33abe694da24..000000000000 --- a/build/clang-plugin/alpha/AlphaChecks.inc +++ /dev/null @@ -1,8 +0,0 @@ -/* 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/. */ - -// The list of checker classes that are compatible with clang-tidy and are considered -// to be in alpha stage development. - -// CHECK(AlphaChecker, "alpha-checker") diff --git a/build/clang-plugin/alpha/AlphaIncludes.inc b/build/clang-plugin/alpha/AlphaIncludes.inc deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/build/clang-plugin/alpha/sources.mozbuild b/build/clang-plugin/alpha/sources.mozbuild deleted file mode 100644 index a49622b0df86..000000000000 --- a/build/clang-plugin/alpha/sources.mozbuild +++ /dev/null @@ -1,9 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -HOST_SOURCES += [ - # 'AlphaChecker.cpp', -] \ No newline at end of file diff --git a/build/clang-plugin/alpha/tests/sources.mozbuild b/build/clang-plugin/alpha/tests/sources.mozbuild deleted file mode 100644 index feb0bbcf33b5..000000000000 --- a/build/clang-plugin/alpha/tests/sources.mozbuild +++ /dev/null @@ -1,9 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -SOURCES += [ - # 'AlphaTest.cpp', -] \ No newline at end of file diff --git a/build/clang-plugin/import_mozilla_checks.py b/build/clang-plugin/import_mozilla_checks.py index cf6c3679b1ab..b556054d4138 100755 --- a/build/clang-plugin/import_mozilla_checks.py +++ b/build/clang-plugin/import_mozilla_checks.py @@ -34,13 +34,9 @@ def copy_dir_contents(src, dest): raise Exception('Directory not copied. Error: %s' % e) -def write_cmake(module_path, import_alpha): +def write_cmake(module_path): names = [' ' + os.path.basename(f) for f in glob.glob("%s/*.cpp" % module_path)] names += [' ' + os.path.basename(f) for f in glob.glob("%s/external/*.cpp" % module_path)] - if import_alpha: - alpha_names = [' ' + os.path.join("alpha", os.path.basename(f)) - for f in glob.glob("%s/alpha/*.cpp" % module_path)] - names += alpha_names with open(os.path.join(module_path, 'CMakeLists.txt'), 'w') as f: f.write("""set(LLVM_LINK_COMPONENTS support) @@ -118,7 +114,7 @@ def generate_thread_allows(mozilla_path, module_path): f.write(ThreadAllows.generate_allows({files, names})) -def do_import(mozilla_path, clang_tidy_path, import_alpha): +def do_import(mozilla_path, clang_tidy_path): module = 'mozilla' module_path = os.path.join(clang_tidy_path, module) try: @@ -130,7 +126,7 @@ def do_import(mozilla_path, clang_tidy_path, import_alpha): copy_dir_contents(mozilla_path, module_path) write_third_party_paths(mozilla_path, module_path) generate_thread_allows(mozilla_path, module_path) - write_cmake(module_path, import_alpha) + write_cmake(module_path) add_item_to_cmake_section(os.path.join(module_path, '..', 'plugin', 'CMakeLists.txt'), 'LINK_LIBS', 'clangTidyMozillaModule') @@ -149,11 +145,10 @@ static int LLVM_ATTRIBUTE_UNUSED MozillaModuleAnchorDestination = def main(): - if len(sys.argv) < 3 or len(sys.argv) > 4: + if len(sys.argv) != 3: print("""\ -Usage: import_mozilla_checks.py [import_alpha] +Usage: import_mozilla_checks.py Imports the Mozilla static analysis checks into a clang-tidy source tree. -If `import_alpha` is specified then in-tree alpha checkers will be also imported. """) return @@ -166,12 +161,7 @@ If `import_alpha` is specified then in-tree alpha checkers will be also imported if not os.path.isdir(mozilla_path): print("Invalid path to clang-tidy source directory") - import_alpha = False - - if len(sys.argv) == 4 and sys.argv[3] == 'import_alpha': - import_alpha = True - - do_import(mozilla_path, clang_tidy_path, import_alpha) + do_import(mozilla_path, clang_tidy_path) if __name__ == '__main__': diff --git a/build/clang-plugin/moz.build b/build/clang-plugin/moz.build index 5abbf93ee405..1854d989a4ce 100644 --- a/build/clang-plugin/moz.build +++ b/build/clang-plugin/moz.build @@ -95,10 +95,6 @@ DIRS += [ include('external/sources.mozbuild') -if CONFIG['ENABLE_CLANG_PLUGIN_ALPHA']: - HOST_DEFINES["MOZ_CLANG_PLUGIN_ALPHA"] = "1" - include('alpha/sources.mozbuild') - # In the current moz.build world, we need to override essentially every # variable to limit ourselves to what we need to build the clang plugin. if CONFIG['HOST_OS_ARCH'] == 'WINNT': diff --git a/build/clang-plugin/tests/moz.build b/build/clang-plugin/tests/moz.build index 04ae2cabd3de..75a58d0e429f 100644 --- a/build/clang-plugin/tests/moz.build +++ b/build/clang-plugin/tests/moz.build @@ -62,10 +62,6 @@ if CONFIG['OS_ARCH'] == 'WINNT': include('../external/tests/sources.mozbuild') -if CONFIG['ENABLE_CLANG_PLUGIN_ALPHA']: - DEFINES["MOZ_CLANG_PLUGIN_ALPHA"] = "1" - include('../alpha/tests/sources.mozbuild') - DisableStlWrapping() NoVisibilityFlags() diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index bf225cce7bda..627596b951d2 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -2249,20 +2249,6 @@ js_option('--enable-clang-plugin', env='ENABLE_CLANG_PLUGIN', add_old_configure_assignment('ENABLE_CLANG_PLUGIN', depends_if('--enable-clang-plugin')(lambda _: True)) -js_option('--enable-clang-plugin-alpha', env='ENABLE_CLANG_PLUGIN_ALPHA', - help='Enable static analysis with clang-plugin alpha checks.') - -@depends('--enable-clang-plugin', '--enable-clang-plugin-alpha') -def check_clang_plugin_alpha(enable_clang_plugin, enable_clang_plugin_alpha): - if enable_clang_plugin_alpha: - if enable_clang_plugin: - return True - die("Cannot enable clang-plugin alpha checkers without --enable-clang-plugin.") - return False - -add_old_configure_assignment('ENABLE_CLANG_PLUGIN_ALPHA', check_clang_plugin_alpha) -set_define('MOZ_CLANG_PLUGIN_ALPHA', check_clang_plugin_alpha) - js_option('--enable-mozsearch-plugin', env='ENABLE_MOZSEARCH_PLUGIN', help="Enable building with the mozsearch indexer plugin") diff --git a/docs/code-quality/static-analysis.rst b/docs/code-quality/static-analysis.rst index f46016b7efe4..4c3523d9fead 100644 --- a/docs/code-quality/static-analysis.rst +++ b/docs/code-quality/static-analysis.rst @@ -146,8 +146,6 @@ If you want to build with the Firefox Clang plug-in (located in ``/build/clang-plugin`` and associated with ``MOZ_CLANG_PLUGIN`` and the attributes in ``/mfbt/Attributes.h``) just add ``--enable-clang-plugin`` to your mozconfig! -If you want to also have our experimental checkers that will produce ``warnings`` as -diagnostic messages also add ``--enable-clang-plugin-alpha``. This requires to build Firefox using Clang. Configuring the build environment