Rename llvm checkers to llvm-project, and namespace from llvm to llvm_project.
Includes renaming llvm directory, many files with llvm- in the name, and updating code and docs.
Paths
| Differential D60151
[clang-tidy] Rename llvm checkers to llvm-project AbandonedPublic Authored by hintonda on Apr 2 2019, 2:07 PM.
Details
Summary Rename llvm checkers to llvm-project, and namespace from llvm to llvm_project. Includes renaming llvm directory, many files with llvm- in the name, and updating code and docs.
Diff Detail
Event TimelineComment Actions The change looks fine, but I don't understand the description of this revision. Could you clarify which checkers you're talking about and which bug you observe? This revision is now accepted and ready to land.Apr 3 2019, 6:20 AM aaron.ballman added inline comments.
This revision now requires changes to proceed.Apr 3 2019, 6:28 AM Comment Actions
Sorry for not being clearer in my original description. The error can be triggered by opening up a new llvm namespace under clang::tidy prior to referencing llvm::SmallSet, which would happened if a new llvm checker that gets included in LLVMTidyModule.cpp before HeaderGuardCheck.h -- HeaderGuardCheck.h includes HeaderFileExternsions.h prior to opening the new llvm namespace. Here's the error message you'd get: llvm-project/clang-tools-extra/clang-tidy/llvm/../utils/../utils/HeaderFileExtensionsUtils.h:24:9: error: no template named 'SmallSet' in namespace 'clang::tidy::llvm'; did you mean '::llvm::SmallSet'? typedef llvm::SmallSet<llvm::StringRef, 5> HeaderFileExtensionsSet; ^~~~~~~~~~~~~~ ::llvm::SmallSet llvm-project/llvm/include/llvm/ADT/SmallSet.h:134:7: note: '::llvm::SmallSet' declared here class SmallSet { ^ llvm-project/clang-tools-extra/clang-tidy/llvm/../utils/../utils/HeaderFileExtensionsUtils.h:24:30: error: no member named 'StringRef' in namespace 'clang::tidy::llvm' typedef llvm::SmallSet<llvm::StringRef, 5> HeaderFileExtensionsSet; ~~~~~~^ 2 errors generated. Here's the one line contrived change needed to demonstrate the error produced above, which is the same effect of including an llvm checker header before including this file: --- a/clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h +++ b/clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h @@ -16,6 +16,7 @@ namespace clang { namespace tidy { +namespace llvm {} namespace utils { typedef llvm::SmallSet<llvm::StringRef, 5> HeaderFileExtensionsSet; hintonda added inline comments.
hintonda added inline comments.
hintonda retitled this revision from [clang-tidy] Add using SmallSet to LLVM.h to fix bug in typedef in llvm checkers. to [clang-tidy] Rename llvm checkers to llvm-project .Apr 3 2019, 3:03 PM Comment Actions
Awesome! Thanks for doing this. Could you ensure that the add_new_check.py script still works? Comment Actions
Thanks for mentioning this. Found a missing rename discovered by add_new_check.py which I'll checkin shortly. However, I'm not sure how best to solve a rename issue. In rename_check.py, module names can't be hyphenated, e.g.: 190: old_module = args.old_check_name.split('-')[0] 191: new_module = args.new_check_name.split('-')[0] If we keep this pattern, then "llvm-project" won't work. It would need to be something like "llvmproject" or something else. Please let me know your preference. Comment Actions
Hmm, that's unfortunate behavior. I guess my preference would be to go with llvm_project, but it's not a strong preference. Comment Actions are we supporting "-llvm-*" in existing .clang-tidy files? If people selectively turn checkers off, won't all of a sudden everyone start getting llvm-project checks and fixes turned back on? https://github.com/search?q=-llvm-%2A&type=Code maybe we need to add something like: llvm-header-guard (redirects to llvm-project-header-guard) <llvm-header-guard> llvm-header-include-order (redirects to llvm-project-include-order) <llvm-include-order> llvm-header-namespace-comment(redirects to llvm-project-namespace-comment) <llvm-namespace-comment> llvm-header-twine-local(redirects to llvm-project-twine-local) <llvm-twine-local> Comment Actions
I suppose we could keep the names and directory structure and just change the namespace. That would just be a special case in the scripts. Haven't looked into it yet, but will do so as soon as I can. Comment Actions
Isn't that matching done on strings? I.e. is there difference between -llvm-* and -ll* ? Comment Actions
it would be if they only do it to -llm-* (which could possibly catch most cases) but what if someone is doing -llvm-header-guard We wouldn't catch those.. This is a snippet of a .clang-tidy file from a project I work on, we turn off specific checks by fully qualifying the checker .... llvm-*, -llvm-header-guard, -llvm-include-order, misc-*, modernize-*, ... Comment Actions
You make a great point. I'll look into just changing the namespace name. I wasn't really comfortable with all the code churn it involved anyway, but once I got started, I figured I'd finish it. The duplicate llvm namespace is the issue, not other names. Thanks for the feedback...
Revision Contents
Diff 193604 clang-tools-extra/clang-tidy/CMakeLists.txt
clang-tools-extra/clang-tidy/llvm/CMakeLists.txt
clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h
clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.cpp
clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.h
clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp
clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.h
clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp
clang-tools-extra/clang-tidy/llvm_project/CMakeLists.txt
clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.h
clang-tools-extra/clang-tidy/llvm_project/HeaderGuardCheck.cpp
clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.h
clang-tools-extra/clang-tidy/llvm_project/IncludeOrderCheck.cpp
clang-tools-extra/clang-tidy/llvm_project/LLVMProjectTidyModule.cpp
clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.h
clang-tools-extra/clang-tidy/llvm_project/TwineLocalCheck.cpp
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
clang-tools-extra/docs/clang-tidy/checks/google-readability-namespace-comments.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-header-guard.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-include-order.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-namespace-comment.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-project-header-guard.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-project-include-order.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-project-namespace-comment.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-project-twine-local.rst
clang-tools-extra/docs/clang-tidy/checks/llvm-twine-local.rst
clang-tools-extra/docs/clang-tidy/index.rst
clang-tools-extra/test/clang-tidy/Inputs/Headers/cross-file-c.h
clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h
clang-tools-extra/test/clang-tidy/basic.cpp
clang-tools-extra/test/clang-tidy/check_clang_tidy.py
clang-tools-extra/test/clang-tidy/export-relpath.cpp
clang-tools-extra/test/clang-tidy/fix.cpp
clang-tools-extra/test/clang-tidy/llvm-include-order.cpp
clang-tools-extra/test/clang-tidy/llvm-project-include-order.cpp
clang-tools-extra/test/clang-tidy/llvm-project-twine-local.cpp
clang-tools-extra/test/clang-tidy/llvm-twine-local.cpp
clang-tools-extra/test/clang-tidy/overlapping.cpp
clang-tools-extra/test/clang-tidy/select-checks.cpp
clang-tools-extra/test/clang-tidy/serialize-diagnostics.cpp
clang-tools-extra/test/clang-tidy/warnings-as-errors-diagnostics.cpp
clang-tools-extra/test/clang-tidy/warnings-as-errors-plural.cpp
clang-tools-extra/test/clang-tidy/warnings-as-errors.cpp
clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
clang-tools-extra/unittests/clang-tidy/LLVMProjectModuleTest.cpp
|