Bug 1466427 - Migrate clang-tidy package from 5.0.1 to 7.0.0-rc2. r=glandium,janx

Differential Revision: https://phabricator.services.mozilla.com/D3980

--HG--
rename : tools/clang-tidy/test/misc-bool-pointer-implicit-conversion.cpp => tools/clang-tidy/test/bugprone-bool-pointer-implicit-conversion.cpp
rename : tools/clang-tidy/test/misc-forward-declaration-namespace.cpp => tools/clang-tidy/test/bugprone-forward-declaration-namespace.cpp
rename : tools/clang-tidy/test/misc-macro-repeated-side-effects.cpp => tools/clang-tidy/test/bugprone-macro-repeated-side-effects.cpp
rename : tools/clang-tidy/test/misc-string-constructor.cpp => tools/clang-tidy/test/bugprone-string-constructor.cpp
rename : tools/clang-tidy/test/misc-string-integer-assignment.cpp => tools/clang-tidy/test/bugprone-string-integer-assignment.cpp
rename : tools/clang-tidy/test/misc-suspicious-missing-comma.cpp => tools/clang-tidy/test/bugprone-suspicious-missing-comma.cpp
rename : tools/clang-tidy/test/misc-swapped-arguments.cpp => tools/clang-tidy/test/bugprone-swapped-arguments.cpp
rename : tools/clang-tidy/test/misc-unused-raii.cpp => tools/clang-tidy/test/bugprone-unused-raii.cpp
extra : moz-landing-system : lando
This commit is contained in:
Andi-Bogdan Postelnicu 2018-08-24 12:39:58 +00:00
parent f1b6a1e14b
commit 34a6c4ff8f
40 changed files with 65 additions and 112 deletions

View File

@ -474,7 +474,8 @@ if __name__ == "__main__":
clang_repo = config["clang_repo"]
extra_repo = config.get("extra_repo")
lld_repo = config.get("lld_repo")
compiler_repo = config["compiler_repo"]
# On some packages we don't use compiler_repo
compiler_repo = config.get("compiler_repo")
libcxx_repo = config["libcxx_repo"]
libcxxabi_repo = config.get("libcxxabi_repo")
stages = 3
@ -543,7 +544,8 @@ if __name__ == "__main__":
if not args.skip_checkout:
checkout_or_update(llvm_repo, llvm_source_dir)
checkout_or_update(clang_repo, clang_source_dir)
checkout_or_update(compiler_repo, compiler_rt_source_dir)
if compiler_repo is not None:
checkout_or_update(compiler_repo, compiler_rt_source_dir)
checkout_or_update(libcxx_repo, libcxx_source_dir)
if lld_repo:
checkout_or_update(lld_repo, lld_source_dir)

View File

@ -1,23 +0,0 @@
Backport cxx14 default dialect flag from clang 6.0.0 trunk to 5.0.1
Index: lib/Frontend/CompilerInvocation.cpp
===================================================================
--- a/clang/lib/Frontend/CompilerInvocation.cpp (revision 320871)
+++ b/clang/lib/Frontend/CompilerInvocation.cpp (working copy)
@@ -1690,11 +1690,11 @@
break;
case InputKind::CXX:
case InputKind::ObjCXX:
- // The PS4 uses C++11 as the default C++ standard.
- if (T.isPS4())
- LangStd = LangStandard::lang_gnucxx11;
- else
- LangStd = LangStandard::lang_gnucxx98;
+#if defined(CLANG_DEFAULT_STD_CXX)
+ LangStd = CLANG_DEFAULT_STD_CXX;
+#else
+ LangStd = LangStandard::lang_gnucxx14;
+#endif
break;
case InputKind::RenderScript:
LangStd = LangStandard::lang_c99;

View File

@ -1,22 +1,20 @@
{
"llvm_revision": "320871",
"llvm_revision": "340491",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_501/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_501/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_501/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_501/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_501/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_501/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc2/",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc2/",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/rc2/",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/rc2/",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/rc2/",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
"cxx": "/builds/worker/workspace/build/src/gcc/bin/g++",
"as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
"patches": [
"clang-tidy-cxx14.patch"
]
}
}

View File

@ -1,17 +1,16 @@
{
"llvm_revision": "320871",
"llvm_revision": "340491",
"stages": "1",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"osx_cross_compile": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_501/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_501/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_501/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_501/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_501/final",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_501/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc2",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc2",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/rc2",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_700/rc2",
"libcxxabi_repo": "https://llvm.org/svn/llvm-project/libcxxabi/tags/RELEASE_700/rc2",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/builds/worker/workspace/build/src/gcc",
"cc": "/builds/worker/workspace/build/src/clang/bin/clang",
@ -19,11 +18,8 @@
"as": "/builds/worker/workspace/build/src/clang/bin/clang",
"ar": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ar",
"ranlib": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-ranlib",
"libtool": "/builds/worker/workspace/build/src/cctools/bin/x86_64-apple-darwin11-libtool",
"ld": "/builds/worker/workspace/build/src/clang/bin/clang",
"patches": [
"llvm-debug-frame-for-5.patch",
"compiler-rt-cross-compile.patch",
"compiler-rt-no-codesign.patch",
"clang-tidy-cxx14.patch"
]
}

View File

@ -1,19 +1,18 @@
{
"llvm_revision": "320871",
"llvm_revision": "340491",
"stages": "1",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_501/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_501/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_501/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_501/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc2",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc2",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/rc2",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/rc2",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",
"patches": [
"clang-tidy-cxx14.patch"
]
}

View File

@ -1,20 +1,19 @@
{
"llvm_revision": "320871",
"llvm_revision": "340491",
"stages": "1",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"build_clang_tidy": true,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_501/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_501/final",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_501/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_501/final",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_700/rc2",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_700/rc2",
"extra_repo": "https://llvm.org/svn/llvm-project/clang-tools-extra/tags/RELEASE_700/rc2",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_700/rc2",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
"python_path": "c:/mozilla-build/python/python.exe",
"cc": "cl.exe",
"cxx": "cl.exe",
"ml": "ml64.exe",
"patches": [
"clang-tidy-cxx14.patch"
]
}

View File

@ -1,13 +0,0 @@
Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp
===================================================================
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (revision 226419)
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (working copy)
@@ -210,6 +210,8 @@
OutStreamer->EmitFileDirective(M.getSourceFileName());
}
+ OutStreamer->EmitCFISections(true, true);
+
GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();
assert(MI && "AsmPrinter didn't require GCModuleInfo?");
for (auto &I : *MI)

View File

@ -114,7 +114,7 @@ def do_import(mozilla_path, clang_tidy_path):
'LINK_LIBS', 'clangTidyMozillaModule')
add_item_to_cmake_section(os.path.join(module_path, '..', 'tool',
'CMakeLists.txt'),
'target_link_libraries', 'clangTidyMozillaModule')
'PRIVATE', 'clangTidyMozillaModule')
with open(os.path.join(module_path, '..', 'CMakeLists.txt'), 'a') as f:
f.write('add_subdirectory(%s)\n' % module)
with open(os.path.join(module_path, '..', 'tool', 'ClangTidyMain.cpp'), 'a') as f:

View File

@ -11,8 +11,30 @@ platforms:
clang_checkers:
- name: -*
publish: !!bool no
- name: bugprone-argument-comment
publish: !!bool yes
- name: bugprone-assert-side-effect
publish: !!bool yes
- name: bugprone-bool-pointer-implicit-conversion
publish: !!bool yes
- name: bugprone-forward-declaration-namespace
publish: !!bool yes
- name: bugprone-macro-repeated-side-effects
publish: !!bool yes
- name: bugprone-string-constructor
publish: !!bool yes
- name: bugprone-string-integer-assignment
publish: !!bool yes
- name: bugprone-suspicious-memset-usage
publish: !!bool yes
- name: bugprone-suspicious-missing-comma
publish: !!bool yes
- name: bugprone-suspicious-semicolon
publish: !!bool yes
- name: bugprone-swapped-arguments
publish: !!bool yes
- name: bugprone-unused-raii
publish: !!bool yes
- name: clang-analyzer-cplusplus.NewDelete
publish: !!bool yes
- name: clang-analyzer-cplusplus.NewDeleteLeaks
@ -42,34 +64,8 @@ clang_checkers:
publish: !!bool yes
- name: clang-analyzer-unix.cstring.NullArg
publish: !!bool yes
- name: misc-argument-comment
# Name with clang tidy 6.0
# - name: bugprone-argument-comment
publish: !!bool yes
- name: misc-assert-side-effect
publish: !!bool yes
- name: misc-bool-pointer-implicit-conversion
publish: !!bool yes
- name: misc-forward-declaration-namespace
# Name with clang tidy 6.0. We are currently using 5.0
# - name: bugprone-forward-declaration-namespace
publish: !!bool yes
- name: misc-macro-repeated-side-effects
publish: !!bool yes
- name: misc-string-constructor
publish: !!bool yes
- name: misc-string-integer-assignment
publish: !!bool yes
- name: misc-suspicious-missing-comma
publish: !!bool yes
- name: misc-suspicious-semicolon
publish: !!bool yes
- name: misc-swapped-arguments
publish: !!bool yes
- name: misc-unused-alias-decls
publish: !!bool yes
- name: misc-unused-raii
publish: !!bool yes
- name: misc-unused-using-decls
publish: !!bool yes
- name: modernize-avoid-bind

View File

@ -1,5 +1,5 @@
// bugprone-argument-comment
// misc-argument-comment
void f(int x, int y);
void g() {
f(/*y=*/0, /*z=*/0);

View File

@ -0,0 +1 @@
"[[\"warning\", \"argument name 'y' in comment does not match parameter name 'x'\", \"bugprone-argument-comment\"], [\"warning\", \"argument name 'z' in comment does not match parameter name 'y'\", \"bugprone-argument-comment\"]]"

View File

@ -1,7 +1,6 @@
#include "structures.h"
// misc-assert-side-effect
// bugprone-assert-side-effect
void misc_assert_side_effect() {
int X = 0;
assert(X == 1);

View File

@ -0,0 +1 @@
"[[\"warning\", \"found assert() with side effect\", \"bugprone-assert-side-effect\"]]"

View File

@ -0,0 +1 @@
"[[\"warning\", \"dubious check of 'bool *' against 'nullptr', did you mean to dereference it?\", \"bugprone-bool-pointer-implicit-conversion\"]]"

View File

@ -0,0 +1 @@
"[[\"warning\", \"no definition found for 'A', but a definition with the same name 'A' found in another namespace 'nb'\", \"bugprone-forward-declaration-namespace\"]]"

View File

@ -0,0 +1 @@
"[[\"warning\", \"side effects in the 1st macro argument 'x' are repeated in macro expansion\", \"bugprone-macro-repeated-side-effects\"]]"

View File

@ -0,0 +1 @@
"[[\"warning\", \"string constructor parameters are probably swapped; expecting string(count, character)\", \"bugprone-string-constructor\"], [\"warning\", \"length is bigger then string literal size\", \"bugprone-string-constructor\"], [\"warning\", \"constructor creating an empty string\", \"bugprone-string-constructor\"]]"

View File

@ -0,0 +1 @@
"[[\"warning\", \"an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility\", \"bugprone-string-integer-assignment\"], [\"warning\", \"an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility\", \"bugprone-string-integer-assignment\"]]"

View File

@ -1 +1 @@
"[[\"warning\", \"suspicious string literal, probably missing a comma\", \"misc-suspicious-missing-comma\"]]"
"[[\"warning\", \"suspicious string literal, probably missing a comma\", \"bugprone-suspicious-missing-comma\"]]"

View File

@ -1,5 +1,5 @@
// misc-suspicious-semicolon
// bugprone-suspicious-semicolon
void nop();
void fail1()
{

View File

@ -0,0 +1 @@
"[[\"warning\", \"potentially unintended semicolon\", \"bugprone-suspicious-semicolon\"]]"

View File

@ -0,0 +1 @@
"[[\"warning\", \"argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.\", \"bugprone-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.\", \"bugprone-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.\", \"bugprone-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.\", \"bugprone-swapped-arguments\"]]"

View File

@ -1 +1 @@
"[[\"warning\", \"object destroyed immediately after creation; did you mean to name the object?\", \"misc-unused-raii\"]]"
"[[\"warning\", \"object destroyed immediately after creation; did you mean to name the object?\", \"bugprone-unused-raii\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"argument name 'y' in comment does not match parameter name 'x'\", \"misc-argument-comment\"], [\"warning\", \"argument name 'z' in comment does not match parameter name 'y'\", \"misc-argument-comment\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"found assert() with side effect\", \"misc-assert-side-effect\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"dubious check of 'bool *' against 'nullptr', did you mean to dereference it?\", \"misc-bool-pointer-implicit-conversion\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"no definition found for 'A', but a definition with the same name 'A' found in another namespace 'nb'\", \"misc-forward-declaration-namespace\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"side effects in the 1st macro argument 'x' are repeated in macro expansion\", \"misc-macro-repeated-side-effects\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"string constructor parameters are probably swapped; expecting string(count, character)\", \"misc-string-constructor\"], [\"warning\", \"length is bigger then string literal size\", \"misc-string-constructor\"], [\"warning\", \"constructor creating an empty string\", \"misc-string-constructor\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility\", \"misc-string-integer-assignment\"], [\"warning\", \"an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility\", \"misc-string-integer-assignment\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"potentially unintended semicolon\", \"misc-suspicious-semicolon\"]]"

View File

@ -1 +0,0 @@
"[[\"warning\", \"argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.\", \"misc-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.\", \"misc-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.\", \"misc-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.\", \"misc-swapped-arguments\"]]"