diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt b/clang-tools-extra/clang-tidy/CMakeLists.txt --- a/clang-tools-extra/clang-tidy/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/CMakeLists.txt @@ -44,7 +44,7 @@ add_subdirectory(fuchsia) add_subdirectory(google) add_subdirectory(hicpp) -add_subdirectory(llvm) +add_subdirectory(llvm_project) add_subdirectory(misc) add_subdirectory(modernize) if(CLANG_ENABLE_STATIC_ANALYZER) diff --git a/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt b/clang-tools-extra/clang-tidy/llvm_project/CMakeLists.txt rename from clang-tools-extra/clang-tidy/llvm/CMakeLists.txt rename to clang-tools-extra/clang-tidy/llvm_project/CMakeLists.txt --- a/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/llvm_project/CMakeLists.txt @@ -3,7 +3,7 @@ add_clang_library(clangTidyLLVMModule HeaderGuardCheck.cpp IncludeOrderCheck.cpp - LLVMTidyModule.cpp + LLVMProjectTidyModule.cpp TwineLocalCheck.cpp LINK_LIBS diff --git a/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h b/clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.h rename from clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h rename to clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.h --- a/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h +++ b/clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.h @@ -6,18 +6,18 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADER_GUARD_CHECK_H -#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADER_GUARD_CHECK_H +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_HEADER_GUARD_CHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_HEADER_GUARD_CHECK_H #include "../utils/HeaderGuard.h" namespace clang { namespace tidy { -namespace llvm { +namespace llvm_project { /// Finds and fixes header guards that do not adhere to LLVM style. /// For the user-facing documentation see: -/// http://clang.llvm.org/extra/clang-tidy/checks/llvm-header-guard.html +/// http://clang.llvm.org/extra/clang-tidy/checks/llvm-project-header-guard.html /// The check supports these options: /// - `HeaderFileExtensions`: a comma-separated list of filename extensions of /// header files (The filename extension should not contain "." prefix). @@ -32,8 +32,8 @@ std::string getHeaderGuard(StringRef Filename, StringRef OldGuard) override; }; -} // namespace llvm +} // namespace llvm_project } // namespace tidy } // namespace clang -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADER_GUARD_CHECK_H +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_HEADER_GUARD_CHECK_H diff --git a/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp b/clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.cpp rename from clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp rename to clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.cpp --- a/clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.cpp @@ -10,7 +10,7 @@ namespace clang { namespace tidy { -namespace llvm { +namespace llvm_project { LLVMHeaderGuardCheck::LLVMHeaderGuardCheck(StringRef Name, ClangTidyContext *Context) @@ -49,6 +49,6 @@ return StringRef(Guard).upper(); } -} // namespace llvm +} // namespace llvm_project } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.h b/clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.h rename from clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.h rename to clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.h --- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.h +++ b/clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.h @@ -6,14 +6,14 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_INCLUDE_ORDER_CHECK_H -#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_INCLUDE_ORDER_CHECK_H +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_INCLUDE_ORDER_CHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_INCLUDE_ORDER_CHECK_H #include "../ClangTidyCheck.h" namespace clang { namespace tidy { -namespace llvm { +namespace llvm_project { /// Checks the correct order of `#includes`. /// @@ -26,8 +26,8 @@ Preprocessor *ModuleExpanderPP) override; }; -} // namespace llvm +} // namespace llvm_project } // namespace tidy } // namespace clang -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_INCLUDE_ORDER_CHECK_H +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_INCLUDE_ORDER_CHECK_H diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.cpp rename from clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp rename to clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.cpp --- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.cpp @@ -15,7 +15,7 @@ namespace clang { namespace tidy { -namespace llvm { +namespace llvm_project { namespace { class IncludeOrderPPCallbacks : public PPCallbacks { @@ -176,6 +176,6 @@ IncludeDirectives.clear(); } -} // namespace llvm +} // namespace llvm_project } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp b/clang-tools-extra/clang-tidy/llvm_project/LLVMProjectTidyModule.cpp rename from clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp rename to clang-tools-extra/clang-tidy/llvm_project/LLVMProjectTidyModule.cpp --- a/clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/llvm_project/LLVMProjectTidyModule.cpp @@ -16,24 +16,24 @@ namespace clang { namespace tidy { -namespace llvm { +namespace llvm_project { class LLVMModule : public ClangTidyModule { public: void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { - CheckFactories.registerCheck("llvm-header-guard"); - CheckFactories.registerCheck("llvm-include-order"); + CheckFactories.registerCheck("llvm-project-header-guard"); + CheckFactories.registerCheck("llvm-project-include-order"); CheckFactories.registerCheck( - "llvm-namespace-comment"); - CheckFactories.registerCheck("llvm-twine-local"); + "llvm-project-namespace-comment"); + CheckFactories.registerCheck("llvm-project-twine-local"); } }; // Register the LLVMTidyModule using this statically initialized variable. -static ClangTidyModuleRegistry::Add X("llvm-module", +static ClangTidyModuleRegistry::Add X("llvm-project-module", "Adds LLVM lint checks."); -} // namespace llvm +} // namespace llvm_project // This anchor is used to force the linker to link in the generated object file // and thus register the LLVMModule. diff --git a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.h b/clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.h rename from clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.h rename to clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.h --- a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.h +++ b/clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.h @@ -6,14 +6,14 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TWINE_LOCAL_CHECK_H -#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TWINE_LOCAL_CHECK_H +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_TWINE_LOCAL_CHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_TWINE_LOCAL_CHECK_H #include "../ClangTidyCheck.h" namespace clang { namespace tidy { -namespace llvm { +namespace llvm_project { /// Looks for local `Twine` variables which are prone to use after frees and /// should be generally avoided. @@ -25,8 +25,8 @@ void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; -} // namespace llvm +} // namespace llvm_project } // namespace tidy } // namespace clang -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_TWINE_LOCAL_CHECK_H +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_PROJECT_TWINE_LOCAL_CHECK_H diff --git a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp b/clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.cpp rename from clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp rename to clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.cpp --- a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.cpp @@ -15,7 +15,7 @@ namespace clang { namespace tidy { -namespace llvm { +namespace llvm_project { void TwineLocalCheck::registerMatchers(MatchFinder *Finder) { auto TwineType = @@ -60,6 +60,6 @@ } } -} // namespace llvm +} // namespace llvm_project } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py --- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py @@ -22,11 +22,11 @@ run-clang-tidy.py $PWD - Fix all header guards. - run-clang-tidy.py -fix -checks=-*,llvm-header-guard + run-clang-tidy.py -fix -checks=-*,llvm-project-header-guard - Fix all header guards included from clang-tidy and header guards for clang-tidy headers. - run-clang-tidy.py -fix -checks=-*,llvm-header-guard extra/clang-tidy \ + run-clang-tidy.py -fix -checks=-*,llvm-project-header-guard extra/clang-tidy \ -header-filter=extra/clang-tidy Compilation database setup: diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-readability-namespace-comments.rst b/clang-tools-extra/docs/clang-tidy/checks/google-readability-namespace-comments.rst --- a/clang-tools-extra/docs/clang-tidy/checks/google-readability-namespace-comments.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-readability-namespace-comments.rst @@ -1,9 +1,9 @@ .. title:: clang-tidy - google-readability-namespace-comments .. meta:: - :http-equiv=refresh: 5;URL=llvm-namespace-comment.html + :http-equiv=refresh: 5;URL=llvm-project-namespace-comment.html google-readability-namespace-comments ===================================== The google-readability-namespace-comments check is an alias, please see -`llvm-namespace-comment `_ for more information. +`llvm-project-namespace-comment `_ for more information. diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -140,7 +140,7 @@ google-readability-braces-around-statements (redirects to readability-braces-around-statements) google-readability-casting google-readability-function-size (redirects to readability-function-size) - google-readability-namespace-comments (redirects to llvm-namespace-comment) + google-readability-namespace-comments (redirects to llvm-project-namespace-comment) google-readability-todo google-runtime-int google-runtime-operator @@ -175,10 +175,10 @@ hicpp-use-nullptr (redirects to modernize-use-nullptr) hicpp-use-override (redirects to modernize-use-override) hicpp-vararg (redirects to cppcoreguidelines-pro-type-vararg) - llvm-header-guard - llvm-include-order - llvm-namespace-comment - llvm-twine-local + llvm-project-header-guard + llvm-project-include-order + llvm-project-namespace-comment + llvm-project-twine-local misc-definitions-in-headers misc-misplaced-const misc-new-delete-overloads diff --git a/clang-tools-extra/docs/clang-tidy/checks/llvm-header-guard.rst b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-header-guard.rst rename from clang-tools-extra/docs/clang-tidy/checks/llvm-header-guard.rst rename to clang-tools-extra/docs/clang-tidy/checks/llvm-project-header-guard.rst --- a/clang-tools-extra/docs/clang-tidy/checks/llvm-header-guard.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-header-guard.rst @@ -1,6 +1,6 @@ -.. title:: clang-tidy - llvm-header-guard +.. title:: clang-tidy - llvm-project-header-guard -llvm-header-guard +llvm-project-header-guard ================= Finds and fixes header guards that do not adhere to LLVM style. diff --git a/clang-tools-extra/docs/clang-tidy/checks/llvm-include-order.rst b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-include-order.rst rename from clang-tools-extra/docs/clang-tidy/checks/llvm-include-order.rst rename to clang-tools-extra/docs/clang-tidy/checks/llvm-project-include-order.rst --- a/clang-tools-extra/docs/clang-tidy/checks/llvm-include-order.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-include-order.rst @@ -1,6 +1,6 @@ -.. title:: clang-tidy - llvm-include-order +.. title:: clang-tidy - llvm-project-include-order -llvm-include-order +llvm-project-include-order ================== diff --git a/clang-tools-extra/docs/clang-tidy/checks/llvm-namespace-comment.rst b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-namespace-comment.rst rename from clang-tools-extra/docs/clang-tidy/checks/llvm-namespace-comment.rst rename to clang-tools-extra/docs/clang-tidy/checks/llvm-project-namespace-comment.rst --- a/clang-tools-extra/docs/clang-tidy/checks/llvm-namespace-comment.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-namespace-comment.rst @@ -1,6 +1,6 @@ -.. title:: clang-tidy - llvm-namespace-comment +.. title:: clang-tidy - llvm-project-namespace-comment -llvm-namespace-comment +llvm-project-namespace-comment ====================== `google-readability-namespace-comments` redirects here as an alias for this diff --git a/clang-tools-extra/docs/clang-tidy/checks/llvm-twine-local.rst b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-twine-local.rst rename from clang-tools-extra/docs/clang-tidy/checks/llvm-twine-local.rst rename to clang-tools-extra/docs/clang-tidy/checks/llvm-project-twine-local.rst --- a/clang-tools-extra/docs/clang-tidy/checks/llvm-twine-local.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/llvm-project-twine-local.rst @@ -1,6 +1,6 @@ -.. title:: clang-tidy - llvm-twine-local +.. title:: clang-tidy - llvm-project-twine-local -llvm-twine-local +llvm-project-twine-local ================ diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst --- a/clang-tools-extra/docs/clang-tidy/index.rst +++ b/clang-tools-extra/docs/clang-tidy/index.rst @@ -67,7 +67,7 @@ ``fuchsia-`` Checks related to Fuchsia coding conventions. ``google-`` Checks related to Google coding conventions. ``hicpp-`` Checks related to High Integrity C++ Coding Standard. -``llvm-`` Checks related to the LLVM coding conventions. +``llvm-project-`` Checks related to the LLVM coding conventions. ``misc-`` Checks that we didn't have a better category for. ``modernize-`` Checks that advocate usage of modern (currently "modern" means "C++11") language constructs. diff --git a/clang-tools-extra/test/clang-tidy/Inputs/Headers/cross-file-c.h b/clang-tools-extra/test/clang-tidy/Inputs/Headers/cross-file-c.h --- a/clang-tools-extra/test/clang-tidy/Inputs/Headers/cross-file-c.h +++ b/clang-tools-extra/test/clang-tidy/Inputs/Headers/cross-file-c.h @@ -37,5 +37,5 @@ // The line number of the following include should match the location of the -// corresponding comment in llvm-include-order.cpp +// corresponding comment in llvm-project-include-order.cpp #include "cross-file-b.h" diff --git a/clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h b/clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h --- a/clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h +++ b/clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h @@ -1,4 +1,4 @@ -// run: clang-tidy -checks=-*,llvm-include-order -header-filter=.* %s \ +// run: clang-tidy -checks=-*,llvm-project-include-order -header-filter=.* %s \ // run: -- -isystem %S/Inputs/Headers -I %S/Inputs/overlapping | \ // run: not grep "note: this fix will not be applied because it overlaps with another fix" diff --git a/clang-tools-extra/test/clang-tidy/basic.cpp b/clang-tools-extra/test/clang-tidy/basic.cpp --- a/clang-tools-extra/test/clang-tidy/basic.cpp +++ b/clang-tools-extra/test/clang-tidy/basic.cpp @@ -1,5 +1,5 @@ -// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- | FileCheck %s +// RUN: clang-tidy %s -checks='-*,llvm-project-namespace-comment' -- | FileCheck %s namespace i { } -// CHECK: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment] +// CHECK: warning: namespace 'i' not terminated with a closing comment [llvm-project-namespace-comment] diff --git a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py --- a/clang-tools-extra/test/clang-tidy/check_clang_tidy.py +++ b/clang-tools-extra/test/clang-tidy/check_clang_tidy.py @@ -23,7 +23,7 @@ -- [optional clang-tidy arguments] Example: - // RUN: %check_clang_tidy %s llvm-include-order %t -- -- -isystem %S/Inputs + // RUN: %check_clang_tidy %s llvm-project-include-order %t -- -- -isystem %S/Inputs """ import argparse diff --git a/clang-tools-extra/test/clang-tidy/export-relpath.cpp b/clang-tools-extra/test/clang-tidy/export-relpath.cpp --- a/clang-tools-extra/test/clang-tidy/export-relpath.cpp +++ b/clang-tools-extra/test/clang-tidy/export-relpath.cpp @@ -7,7 +7,7 @@ // in './fixes.yaml' works as expected. // // RUN: cd %T/clang-tidy/export-relpath -// RUN: clang-tidy -p subdir subdir/source.cpp -checks='-*,google-explicit-constructor,llvm-namespace-comment' -export-fixes=./fixes.yaml +// RUN: clang-tidy -p subdir subdir/source.cpp -checks='-*,google-explicit-constructor,llvm-project-namespace-comment' -export-fixes=./fixes.yaml // RUN: FileCheck -input-file=%T/clang-tidy/export-relpath/fixes.yaml -check-prefix=CHECK-YAML %s namespace i { diff --git a/clang-tools-extra/test/clang-tidy/fix.cpp b/clang-tools-extra/test/clang-tidy/fix.cpp --- a/clang-tools-extra/test/clang-tidy/fix.cpp +++ b/clang-tools-extra/test/clang-tidy/fix.cpp @@ -1,5 +1,5 @@ // RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp -// RUN: clang-tidy %t.cpp -checks='-*,google-explicit-constructor,llvm-namespace-comment' -fix -export-fixes=%t.yaml -- > %t.msg 2>&1 +// RUN: clang-tidy %t.cpp -checks='-*,google-explicit-constructor,llvm-project-namespace-comment' -fix -export-fixes=%t.yaml -- > %t.msg 2>&1 // RUN: FileCheck -input-file=%t.cpp %s // RUN: FileCheck -input-file=%t.msg -check-prefix=CHECK-MESSAGES %s // RUN: FileCheck -input-file=%t.yaml -check-prefix=CHECK-YAML %s diff --git a/clang-tools-extra/test/clang-tidy/llvm-include-order.cpp b/clang-tools-extra/test/clang-tidy/llvm-project-include-order.cpp rename from clang-tools-extra/test/clang-tidy/llvm-include-order.cpp rename to clang-tools-extra/test/clang-tidy/llvm-project-include-order.cpp --- a/clang-tools-extra/test/clang-tidy/llvm-include-order.cpp +++ b/clang-tools-extra/test/clang-tidy/llvm-project-include-order.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s llvm-include-order %t -- -- -isystem %S/Inputs/Headers +// RUN: %check_clang_tidy %s llvm-project-include-order %t -- -- -isystem %S/Inputs/Headers // CHECK-MESSAGES: [[@LINE+2]]:1: warning: #includes are not sorted properly #include "j.h" diff --git a/clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp b/clang-tools-extra/test/clang-tidy/llvm-project-twine-local.cpp rename from clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp rename to clang-tools-extra/test/clang-tidy/llvm-project-twine-local.cpp --- a/clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp +++ b/clang-tools-extra/test/clang-tidy/llvm-project-twine-local.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s llvm-twine-local %t +// RUN: %check_clang_tidy %s llvm-project-twine-local %t namespace llvm { class Twine { diff --git a/clang-tools-extra/test/clang-tidy/overlapping.cpp b/clang-tools-extra/test/clang-tidy/overlapping.cpp --- a/clang-tools-extra/test/clang-tidy/overlapping.cpp +++ b/clang-tools-extra/test/clang-tidy/overlapping.cpp @@ -1,4 +1,4 @@ -// RUN: clang-tidy -checks=-*,llvm-include-order -header-filter=.* %s \ +// RUN: clang-tidy -checks=-*,llvm-project-include-order -header-filter=.* %s \ // RUN: -- -isystem %S/Inputs/Headers -I %S/Inputs/overlapping | \ // RUN: not grep "note: this fix will not be applied because it overlaps with another fix" diff --git a/clang-tools-extra/test/clang-tidy/select-checks.cpp b/clang-tools-extra/test/clang-tidy/select-checks.cpp --- a/clang-tools-extra/test/clang-tidy/select-checks.cpp +++ b/clang-tools-extra/test/clang-tidy/select-checks.cpp @@ -1,11 +1,11 @@ -// RUN: clang-tidy %s -checks='-*,llvm-namespace-*' -- 2>&1 | FileCheck -implicit-check-not='{{warning:|error:}}' %s +// RUN: clang-tidy %s -checks='-*,llvm-project-namespace-*' -- 2>&1 | FileCheck -implicit-check-not='{{warning:|error:}}' %s // RUN: not clang-tidy %s -checks='-*,an-unknown-check' -- 2>&1 | FileCheck -implicit-check-not='{{warning:|error:}}' -check-prefix=CHECK2 %s // CHECK2: Error: no checks enabled. namespace i { } -// CHECK: :[[@LINE-1]]:2: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment] +// CHECK: :[[@LINE-1]]:2: warning: namespace 'i' not terminated with a closing comment [llvm-project-namespace-comment] // Expect no warnings from the google-explicit-constructor check: class A { A(int i); }; diff --git a/clang-tools-extra/test/clang-tidy/serialize-diagnostics.cpp b/clang-tools-extra/test/clang-tidy/serialize-diagnostics.cpp --- a/clang-tools-extra/test/clang-tidy/serialize-diagnostics.cpp +++ b/clang-tools-extra/test/clang-tidy/serialize-diagnostics.cpp @@ -1,3 +1,3 @@ -// RUN: not clang-tidy -checks=-*,llvm-namespace-comment %s -- -serialize-diagnostics %t | FileCheck %s +// RUN: not clang-tidy -checks=-*,llvm-project-namespace-comment %s -- -serialize-diagnostics %t | FileCheck %s // CHECK: :[[@LINE+1]]:12: error: expected ';' after struct [clang-diagnostic-error] struct A {} diff --git a/clang-tools-extra/test/clang-tidy/warnings-as-errors-diagnostics.cpp b/clang-tools-extra/test/clang-tidy/warnings-as-errors-diagnostics.cpp --- a/clang-tools-extra/test/clang-tidy/warnings-as-errors-diagnostics.cpp +++ b/clang-tools-extra/test/clang-tidy/warnings-as-errors-diagnostics.cpp @@ -1,10 +1,10 @@ -// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \ +// RUN: clang-tidy %s -checks='-*,llvm-project-namespace-comment,clang-diagnostic*' \ // RUN: -- -Wunused-variable 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:' -// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \ +// RUN: not clang-tidy %s -checks='-*,llvm-project-namespace-comment,clang-diagnostic*' \ // RUN: -warnings-as-errors='clang-diagnostic*' -- -Wunused-variable 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:' -// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \ +// RUN: not clang-tidy %s -checks='-*,llvm-project-namespace-comment,clang-diagnostic*' \ // RUN: -warnings-as-errors='clang-diagnostic*' -quiet -- -Wunused-variable 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-WERR-QUIET -implicit-check-not='{{warning|error}}:' diff --git a/clang-tools-extra/test/clang-tidy/warnings-as-errors-plural.cpp b/clang-tools-extra/test/clang-tidy/warnings-as-errors-plural.cpp --- a/clang-tools-extra/test/clang-tidy/warnings-as-errors-plural.cpp +++ b/clang-tools-extra/test/clang-tidy/warnings-as-errors-plural.cpp @@ -1,23 +1,23 @@ -// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' -- 2>&1 \ +// RUN: clang-tidy %s -checks='-*,llvm-project-namespace-comment,clang-diagnostic*' -- 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:' -// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \ -// RUN: -warnings-as-errors='llvm-namespace-comment' -- 2>&1 \ +// RUN: not clang-tidy %s -checks='-*,llvm-project-namespace-comment,clang-diagnostic*' \ +// RUN: -warnings-as-errors='llvm-project-namespace-comment' -- 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:' -// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \ -// RUN: -warnings-as-errors='llvm-namespace-comment' -quiet -- 2>&1 \ +// RUN: not clang-tidy %s -checks='-*,llvm-project-namespace-comment,clang-diagnostic*' \ +// RUN: -warnings-as-errors='llvm-project-namespace-comment' -quiet -- 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-WERR-QUIET -implicit-check-not='{{warning|error}}:' namespace j { } -// CHECK-WARN: warning: namespace 'j' not terminated with a closing comment [llvm-namespace-comment] -// CHECK-WERR: error: namespace 'j' not terminated with a closing comment [llvm-namespace-comment,-warnings-as-errors] -// CHECK-WERR-QUIET: error: namespace 'j' not terminated with a closing comment [llvm-namespace-comment,-warnings-as-errors] +// CHECK-WARN: warning: namespace 'j' not terminated with a closing comment [llvm-project-namespace-comment] +// CHECK-WERR: error: namespace 'j' not terminated with a closing comment [llvm-project-namespace-comment,-warnings-as-errors] +// CHECK-WERR-QUIET: error: namespace 'j' not terminated with a closing comment [llvm-project-namespace-comment,-warnings-as-errors] namespace k { } -// CHECK-WARN: warning: namespace 'k' not terminated with a closing comment [llvm-namespace-comment] -// CHECK-WERR: error: namespace 'k' not terminated with a closing comment [llvm-namespace-comment,-warnings-as-errors] -// CHECK-WERR-QUIET: error: namespace 'k' not terminated with a closing comment [llvm-namespace-comment,-warnings-as-errors] +// CHECK-WARN: warning: namespace 'k' not terminated with a closing comment [llvm-project-namespace-comment] +// CHECK-WERR: error: namespace 'k' not terminated with a closing comment [llvm-project-namespace-comment,-warnings-as-errors] +// CHECK-WERR-QUIET: error: namespace 'k' not terminated with a closing comment [llvm-project-namespace-comment,-warnings-as-errors] // CHECK-WARN-NOT: treated as // CHECK-WERR: 2 warnings treated as errors diff --git a/clang-tools-extra/test/clang-tidy/warnings-as-errors.cpp b/clang-tools-extra/test/clang-tidy/warnings-as-errors.cpp --- a/clang-tools-extra/test/clang-tidy/warnings-as-errors.cpp +++ b/clang-tools-extra/test/clang-tidy/warnings-as-errors.cpp @@ -1,12 +1,12 @@ -// RUN: clang-tidy %s -checks='-*,llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:' -// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment' -warnings-as-errors='llvm-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:' -// RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment' -warnings-as-errors='llvm-namespace-comment' -quiet -- 2>&1 | FileCheck %s --check-prefix=CHECK-WERR-QUIET -implicit-check-not='{{warning|error}}:' +// RUN: clang-tidy %s -checks='-*,llvm-project-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:' +// RUN: not clang-tidy %s -checks='-*,llvm-project-namespace-comment' -warnings-as-errors='llvm-project-namespace-comment' -- 2>&1 | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:' +// RUN: not clang-tidy %s -checks='-*,llvm-project-namespace-comment' -warnings-as-errors='llvm-project-namespace-comment' -quiet -- 2>&1 | FileCheck %s --check-prefix=CHECK-WERR-QUIET -implicit-check-not='{{warning|error}}:' namespace i { } -// CHECK-WARN: warning: namespace 'i' not terminated with a closing comment [llvm-namespace-comment] -// CHECK-WERR: error: namespace 'i' not terminated with a closing comment [llvm-namespace-comment,-warnings-as-errors] -// CHECK-WERR-QUIET: error: namespace 'i' not terminated with a closing comment [llvm-namespace-comment,-warnings-as-errors] +// CHECK-WARN: warning: namespace 'i' not terminated with a closing comment [llvm-project-namespace-comment] +// CHECK-WERR: error: namespace 'i' not terminated with a closing comment [llvm-project-namespace-comment,-warnings-as-errors] +// CHECK-WERR-QUIET: error: namespace 'i' not terminated with a closing comment [llvm-project-namespace-comment,-warnings-as-errors] // CHECK-WARN-NOT: treated as // CHECK-WERR: 1 warning treated as error diff --git a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt --- a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt +++ b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt @@ -11,7 +11,7 @@ ClangTidyOptionsTest.cpp IncludeInserterTest.cpp GoogleModuleTest.cpp - LLVMModuleTest.cpp + LLVMProjectModuleTest.cpp NamespaceAliaserTest.cpp ObjCModuleTest.cpp OverlappingReplacementsTest.cpp @@ -30,7 +30,7 @@ clangTidy clangTidyAndroidModule clangTidyGoogleModule - clangTidyLLVMModule + clangTidyLLVMProjectModule clangTidyObjCModule clangTidyReadabilityModule clangTidyUtils diff --git a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/LLVMProjectModuleTest.cpp rename from clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp rename to clang-tools-extra/unittests/clang-tidy/LLVMProjectModuleTest.cpp --- a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/LLVMProjectModuleTest.cpp @@ -1,10 +1,8 @@ #include "ClangTidyTest.h" -#include "llvm/HeaderGuardCheck.h" -#include "llvm/IncludeOrderCheck.h" +#include "llvm_project/HeaderGuardCheck.h" +#include "llvm_project/IncludeOrderCheck.h" #include "gtest/gtest.h" -using namespace clang::tidy::llvm; - namespace clang { namespace tidy { namespace test { @@ -14,7 +12,7 @@ static std::string runHeaderGuardCheck(StringRef Code, const Twine &Filename, Optional ExpectedWarning) { std::vector Errors; - std::string Result = test::runCheckOnCode( + std::string Result = test::runCheckOnCode( Code, &Errors, Filename, std::string("-xc++-header")); if (Errors.size() != (size_t)ExpectedWarning.hasValue()) return "invalid error count"; @@ -25,7 +23,7 @@ } namespace { -struct WithEndifComment : public LLVMHeaderGuardCheck { +struct WithEndifComment : public llvm_project::LLVMHeaderGuardCheck { WithEndifComment(StringRef Name, ClangTidyContext *Context) : LLVMHeaderGuardCheck(Name, Context) {} bool shouldSuggestEndifComment(StringRef Filename) override { return true; }