forked from OSchip/llvm-project
4babd689f9
We are porting some of the checkers at a company we developed to the Clang Tidy infrastructure. We would like to open source the checkers that may be useful for the community as well. This patch is the first checker that is being ported to Clang Tidy. We also added fix-it hints, and applied them to LLVM: http://reviews.llvm.org/D6924 The code compiled and the unit tests are passed after the fixits was applied. The documentation of the checker: /// The emptiness of a container should be checked using the empty method /// instead of the size method. It is not guaranteed that size is a /// constant-time function, and it is generally more efficient and also shows /// clearer intent to use empty. Furthermore some containers may implement the /// empty method but not implement the size method. Using empty whenever /// possible makes it easier to switch to another container in the future. It also uses some custom ASTMatchers. In case you find them useful I can submit them as separate patches to clang. I will apply your suggestions to this patch. http://reviews.llvm.org/D6925 Patch by Gábor Horváth! llvm-svn: 226172 |
||
---|---|---|
.. | ||
clang-apply-replacements | ||
clang-modernize | ||
clang-query | ||
clang-rename | ||
clang-tidy | ||
docs | ||
modularize | ||
module-map-checker | ||
pp-trace | ||
remove-cstr-calls | ||
test | ||
tool-template | ||
unittests | ||
.arcconfig | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.TXT | ||
LICENSE.TXT | ||
Makefile | ||
README.txt |
README.txt
//===----------------------------------------------------------------------===// // Clang Tools repository //===----------------------------------------------------------------------===// Welcome to the repository of extra Clang Tools. This repository holds tools that are developed as part of the LLVM compiler infrastructure project and the Clang frontend. These tools are kept in a separate "extra" repository to allow lighter weight checkouts of the core Clang codebase. This repository is only intended to be checked out inside of a full LLVM+Clang tree, and in the 'tools/extra' subdirectory of the Clang checkout. All discussion regarding Clang, Clang-based tools, and code in this repository should be held using the standard Clang mailing lists: http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev Code review for this tree should take place on the standard Clang patch and commit lists: http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits If you find a bug in these tools, please file it in the LLVM bug tracker: http://llvm.org/bugs/