Commit Graph

884 Commits

Author SHA1 Message Date
Alexander Kornienko 1b677dbd44 [clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions
Classes are named WhateverCheck, files are WhateverCheck.cpp and`
WhateverCheck.h`

http://reviews.llvm.org/D8144

Patch by Richard Thomson!

llvm-svn: 231650
2015-03-09 12:18:39 +00:00
Alexander Kornienko 5b982e539d [clang-tidy] Refactor: Rename clang-tidy misc check files and classes to follow naming conventions
Classes are named WhateverCheck, files are named WhateverCheck.cpp and
WhateverCheck.h.

http://reviews.llvm.org/D8145

Patch by Richard Thomson!

llvm-svn: 231648
2015-03-09 11:48:54 +00:00
Alexander Kornienko b2ddb8ac4d [clang-tidy] Fix assertion when a dependent expression is used in an assert.
llvm-svn: 231620
2015-03-09 02:27:57 +00:00
John Thompson 84ced5c1af Renamed function to avoid confusion about purpose.
llvm-svn: 231440
2015-03-06 00:39:42 +00:00
Daniel Jasper 08201e394e Use std::string instead of StringRef to prevent use-after-free.
Discovered by asan.

llvm-svn: 231421
2015-03-05 23:17:32 +00:00
Alexander Kornienko 333d81121d [clang-tidy] Slighly clarified a comment.
llvm-svn: 231370
2015-03-05 14:58:03 +00:00
Alexander Kornienko da4ebb219b [clang-tidy] Replace unrecognized namespace ending comments.
Summary:
Replace unrecognized namespace ending comments. This will help in particular when a namespace ending comment is mistyped or doesn't fit the regexp for other reason, e.g.:

  namespace a {
  namespace b {
  namespace {
  } // anoynmous namespace
  } // b
  } // namesapce a

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D8078

llvm-svn: 231369
2015-03-05 14:56:11 +00:00
Alexander Kornienko ed07a255da [clang-tidy] Fix diag message in clang-tidy misc-uniqueptr-reset-release if right side is rvalue
http://reviews.llvm.org/D8071

Patch by Alexey Sokolov!

llvm-svn: 231365
2015-03-05 13:53:21 +00:00
Alexander Kornienko ed824e0e4b [clang-tidy] Refactor: Move google clang-tidy checks to namespace clang::tidy::google
http://reviews.llvm.org/D7994

Patch by Richard Thomson!

llvm-svn: 231364
2015-03-05 13:46:14 +00:00
Alexander Kornienko df0ab6acdf [clang-tidy] Fix namespace comments. NFC.
llvm-svn: 231267
2015-03-04 18:01:10 +00:00
Alexander Kornienko ad53695a09 [clang-tidy] Output more diagnostics in check_clang_tidy.sh
Print clang-tidy output and fixes applied.

llvm-svn: 231236
2015-03-04 12:07:50 +00:00
Filipe Cabecinhas 3be5b7fb43 Add -fexceptions for targets which need it
llvm-svn: 230994
2015-03-02 19:12:51 +00:00
Daniel Jasper 136f4b3439 clang-tidy: Update test as underlying problem apparently was fixed.
llvm-svn: 230982
2015-03-02 18:07:00 +00:00
Alexander Kornienko 0a6ce9f4e1 [clang-tidy] Refactor: Move llvm clang-tidy checks to namespace clang::tidy::llvm
clang-tidy checks are organized into modules. This refactoring moves the llvm
module checks to clang::tidy::llvm

http://reviews.llvm.org/D7995

Patch by Richard Thomson!

llvm-svn: 230952
2015-03-02 12:39:18 +00:00
Alexander Kornienko 2b312420aa [clang-tidy] Refactor: Move misc clang-tidy checks to namespace clang::tidy::misc
clang-tidy checks are organized into modules. This refactoring moves the misc
module checks into the namespace clang::tidy::misc

http://reviews.llvm.org/D7996

Patch by Richard Thomson!

llvm-svn: 230950
2015-03-02 12:25:03 +00:00
Alexander Kornienko 37f80456ce [clang-tidy] Organized clang-tidy unit tests. NFC.
* Moved unit tests for BracesAroundStatementsCheck to
    ReadabilityModuleTest.cpp.
  * Moved EXPECT_NO_CHANGES macro to ClangTidyTest.h to avoid defining it three
    times.

llvm-svn: 230947
2015-03-02 11:55:04 +00:00
Alexander Kornienko 8384d491d8 [clang-tidy] Refactor: Move readability checks to namespace clang::tidy::readability
clang-tidy checks are organized into modules. This refactoring moves the
readability module checks into the namespace clang::tidy::readability

http://reviews.llvm.org/D7997

Patch by Richard Thomson!

llvm-svn: 230946
2015-03-02 11:43:00 +00:00
Alexander Kornienko 1ca3b83255 [clang-tidy] Assert related checkers
This patch contains two assert related checkers. These checkers are the part of
those that is being open sourced by Ericsson
(http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-December/040520.html).

The checkers:

AssertSideEffect:
/// \brief Finds \c assert() with side effect.
///
/// The conition of \c assert() is evaluated only in debug builds so a condition
/// with side effect can cause different behaviour in debug / relesase builds.

StaticAssert:
/// \brief Replaces \c assert() with \c static_assert() if the condition is 
/// evaluatable at compile time.
///
/// The condition of \c static_assert() is evaluated at compile time which is
/// safer and more efficient.

http://reviews.llvm.org/D7375

Patch by Szabolcs Sipos!

llvm-svn: 230943
2015-03-02 10:46:43 +00:00
Samuel Benzaquen e39269e790 Add 'let' to the help message.
Summary: Add 'let' to the help message.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7940

llvm-svn: 230768
2015-02-27 17:53:23 +00:00
Alexander Kornienko dd836f238d [clang-tidy] Various improvements in misc-use-override
* Better error message when more than one of 'virtual', 'override' and 'final'
    is present ("X is/are redundant since the function is already declared Y").
  * Convert the messages to the style used in Clang diagnostics: lower case
    initial letter, no trailing period.
  * Don't run the check for files compiled in pre-C++11 mode
    (http://llvm.org/PR22638).

llvm-svn: 230765
2015-02-27 16:50:32 +00:00
John Thompson b70ecf6eef Fixed canonical path function.
llvm-svn: 230665
2015-02-26 19:31:10 +00:00
David Majnemer d264827229 Update for clang r230512
llvm-svn: 230513
2015-02-25 17:36:49 +00:00
Alexander Kornienko 4c0e4a12bd [clang-tidy] Use the new ArrayRef<FixItHint> inserter.
llvm-svn: 230497
2015-02-25 14:42:02 +00:00
Alexander Kornienko 6d02cc8d65 [clang-tidy] Correct spelling error in test file name. NFC.
Patch by Richard Thomson!
http://reviews.llvm.org/D7603

llvm-svn: 230491
2015-02-25 13:17:14 +00:00
Alexander Kornienko 8cef0752f5 [clang-tidy] Correct confusion between overwrite and override. NFC.
Patch by Richard Thomson!
http://reviews.llvm.org/D7604

llvm-svn: 230490
2015-02-25 13:05:33 +00:00
Gabor Horvath ca0bbff3a7 [clang-tidy] Fixed a false positive case in misc-inaccurate-erase checker.
llvm-svn: 230483
2015-02-25 12:17:03 +00:00
Adrian Prantl b97f5c1eb2 Revert "Adapt clang-tools-extra to clang module format changes."
This reverts commit 230424.

llvm-svn: 230456
2015-02-25 02:46:37 +00:00
Adrian Prantl 2be16291ff Revert "Add a missing target requirement."
This reverts commit 230430.

llvm-svn: 230455
2015-02-25 02:46:29 +00:00
Adrian Prantl beb52cfea0 Add a missing target requirement.
llvm-svn: 230430
2015-02-25 01:52:10 +00:00
Adrian Prantl e95edbf5a9 Adapt clang-tools-extra to clang module format changes.
- add clangCodeGen.a to the tools that need it
- tweak pp-trace command line handling to not conflict with clang's.

llvm-svn: 230424
2015-02-25 01:32:04 +00:00
Adrian Prantl 77553c72dc Revert "Add clangCodeGen.a to the tools that need it after the clang module"
llvm-svn: 230310
2015-02-24 05:14:37 +00:00
Adrian Prantl d0a19981c4 Fix typo s/bitcodewriter/bitwriter
llvm-svn: 230307
2015-02-24 04:49:13 +00:00
Adrian Prantl 54e9d64533 Add clangCodeGen.a to the tools that need it after the clang module
format change.

llvm-svn: 230306
2015-02-24 04:26:29 +00:00
Alexander Kornienko 01c2da1e09 Fixed script name in the clang-tidy documentation.
llvm-svn: 230198
2015-02-23 01:12:41 +00:00
Adrian Prantl a22fd38174 Revert "Adapt Makefile dependencies for the clang module format change in r230089."
llvm-svn: 230104
2015-02-21 00:29:43 +00:00
Adrian Prantl 6897e3e456 Adapt Makefile dependencies for the clang module format change in r230089.
llvm-svn: 230090
2015-02-20 23:35:07 +00:00
John Thompson a5666cadbb Deleted module-map-checker, as it's been folded into modularize.
llvm-svn: 230014
2015-02-20 14:28:10 +00:00
Nick Lewycky d07cfbdaa7 Remove carriage returns.
llvm-svn: 229975
2015-02-20 07:05:56 +00:00
John Thompson 8eb8d93672 Added module map coverage support, extracted from module-map-checker.
llvm-svn: 229869
2015-02-19 16:47:27 +00:00
John Thompson 3c9fb52218 Pruned some unneeded code and comments.
llvm-svn: 229855
2015-02-19 14:31:48 +00:00
John Thompson 41ede8e507 Fixed missing checkins.
llvm-svn: 229699
2015-02-18 17:08:00 +00:00
John Thompson 9cb7964641 Added support for extracting headers from module maps as a source for the header list.
llvm-svn: 229692
2015-02-18 16:14:32 +00:00
John Thompson b87fd7db7c Temporary hack to avoid false errors. Real fix comming.
llvm-svn: 229690
2015-02-18 16:12:26 +00:00
John Thompson eaa4c73d62 Updated file comment on modularize usage, as it was out-of-date.
llvm-svn: 229677
2015-02-18 15:11:12 +00:00
Gabor Horvath 21b76badeb [clang-tidy] Fixed two wrong fix-it cases in misc-inefficient-algorithm checker.
llvm-svn: 229552
2015-02-17 21:45:38 +00:00
John Thompson 3dcb3934c6 Add canonical path conversion function and use it so paths are consistent.
llvm-svn: 229540
2015-02-17 20:43:47 +00:00
John Thompson 9ea81b0041 Fix broken logic for include in block check.
llvm-svn: 229187
2015-02-13 23:32:08 +00:00
John Thompson d845baecb4 Moved header list loading to new class. This is staging for adding module map loading and checking support.
llvm-svn: 229108
2015-02-13 14:29:22 +00:00
Chandler Carruth f766278204 Re-sort includes using the LLVM utils/sort_includes.py script.
llvm-svn: 229087
2015-02-13 09:07:58 +00:00
NAKAMURA Takumi 24fbdf124b Modularize.cpp: Simplify. Vector may be aware of ranged-for.
llvm-svn: 228993
2015-02-13 00:28:32 +00:00