History log of /llvm-project/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp (Results 76 – 100 of 102)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1
# 71c9257f 17-Jun-2015 Daniel Marjamaki <daniel.marjamaki@evidente.se>

clang-tidy: Add checker that warn when macro argument with side effects is repeated in the macro

llvm-svn: 239909


# 302275a9 16-Jun-2015 Daniel Marjamaki <daniel.marjamaki@evidente.se>

clang-tidy: Add checker that warns about missing parentheses in macros

* calculations in the replacement list should be inside parentheses
* macro arguments should be inside parentheses

llvm-svn: 2

clang-tidy: Add checker that warns about missing parentheses in macros

* calculations in the replacement list should be inside parentheses
* macro arguments should be inside parentheses

llvm-svn: 239820

show more ...


# 7ed89bcd 27-May-2015 Alexander Kornienko <alexfh@google.com>

[clang-tidy] Renamed misc-noexcept-move-ctors to misc-noexcept-move-constructor

llvm-svn: 238326


# 3396a8b8 22-May-2015 Alexander Kornienko <alexfh@google.com>

Add a clang-tidy check for move constructors/assignment ops without noexcept.

Summary:
Add a clang-tidy check (misc-noexcept-move-ctors) for move constructors
and assignment operators not using noex

Add a clang-tidy check for move constructors/assignment ops without noexcept.

Summary:
Add a clang-tidy check (misc-noexcept-move-ctors) for move constructors
and assignment operators not using noexcept.

http://llvm.org/PR23519

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 238013

show more ...


Revision tags: llvmorg-3.6.1, llvmorg-3.6.1-rc1, llvmorg-3.5.2, llvmorg-3.5.2-rc1
# 5b982e53 09-Mar-2015 Alexander Kornienko <alexfh@google.com>

[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://rev

[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

show more ...


# 2b312420 02-Mar-2015 Alexander Kornienko <alexfh@google.com>

[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

[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

show more ...


# 1ca3b832 02-Mar-2015 Alexander Kornienko <alexfh@google.com>

[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/

[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

show more ...


Revision tags: llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3
# d4637fb4 10-Feb-2015 Gabor Horvath <xazax.hun@gmail.com>

[clang-tidy] Checker for inaccurate use of erase() method.

Algorithms like remove() does not actually remove any element from the
container but returns an iterator to the first redundant element at

[clang-tidy] Checker for inaccurate use of erase() method.

Algorithms like remove() does not actually remove any element from the
container but returns an iterator to the first redundant element at the end
of the container. These redundant elements must be removed using the
erase() method. This check warns when not all of the elements will be
removed due to using an inappropriate overload.

Reviewer: alexfh

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

llvm-svn: 228679

show more ...


# b5cbe010 09-Feb-2015 Samuel Benzaquen <sbenza@google.com>

Verify assign operator signatures.

Summary: Warn when the return type of assign operators is not Class&.

Reviewers: alexfh

Subscribers: cfe-commits

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

Verify assign operator signatures.

Summary: Warn when the return type of assign operators is not Class&.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 228583

show more ...


# 3880bee0 07-Feb-2015 Gabor Horvath <xazax.hun@gmail.com>

[clang-tidy] Checker for inefficient use of algorithms on associative containers

Summary:
Associative containers implements some of the algorithms as methods which
should be preferred to the algorit

[clang-tidy] Checker for inefficient use of algorithms on associative containers

Summary:
Associative containers implements some of the algorithms as methods which
should be preferred to the algorithms in the algorithm header. The methods
can take advantage of the order of the elements.

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: cfe-commits

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

llvm-svn: 228505

show more ...


Revision tags: llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1
# 3cbd71c0 14-Jan-2015 Chandler Carruth <chandlerc@gmail.com>

[cleanup] Re-sort the #include lines with llvm/utils/sort_includes.py

No functionality changed, this is just a mechanical cleanup to keep the
order of #include lines consistent across the project.

[cleanup] Re-sort the #include lines with llvm/utils/sort_includes.py

No functionality changed, this is just a mechanical cleanup to keep the
order of #include lines consistent across the project.

llvm-svn: 225976

show more ...


Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1
# bc0c423a 05-Dec-2014 Alexander Kornienko <alexfh@google.com>

[clang-tidy] Add clang-tidy check for unique_ptr's reset+release -> move

Replace x.reset(y.release()); with x = std::move(y);
If y is rvalue, replace with x = y; instead.

http://reviews.llvm.org/D6

[clang-tidy] Add clang-tidy check for unique_ptr's reset+release -> move

Replace x.reset(y.release()); with x = std::move(y);
If y is rvalue, replace with x = y; instead.

http://reviews.llvm.org/D6485

Patch by Alexey Sokolov!

llvm-svn: 223460

show more ...


# 2192a8e5 26-Oct-2014 Alexander Kornienko <alexfh@google.com>

[clang-tidy] Bring order to check registration.

Summary:
Register readability checks in a separate module. Renamed the checks
and test file names accordingly.

Reviewers: djasper, klimek

Reviewed B

[clang-tidy] Bring order to check registration.

Summary:
Register readability checks in a separate module. Renamed the checks
and test file names accordingly.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 220631

show more ...


# 35ddae4a 15-Oct-2014 Alexander Kornienko <alexfh@google.com>

[clang-tidy] Move some of the misc checks to readability/

Summary:
Some of the misc checks belong to readability/. I'm moving them there
without changing check names for now. As the next step, I wan

[clang-tidy] Move some of the misc checks to readability/

Summary:
Some of the misc checks belong to readability/. I'm moving them there
without changing check names for now. As the next step, I want to register some
of these checks in the google and llvm modules with suitable settings (e.g.
BracesAroundStatementsCheck). I'm not sure if we want to create a "readability"
module, probably not.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 219786

show more ...


# 8f7e7f73 02-Oct-2014 Alexander Kornienko <alexfh@google.com>

[clang-tidy] Add check misc-braces-around-statements.

This check looks for if statements and loops: for, range-for, while and
do-while, and verifies that the inside statements are inside braces '{}'

[clang-tidy] Add check misc-braces-around-statements.

This check looks for if statements and loops: for, range-for, while and
do-while, and verifies that the inside statements are inside braces '{}'.
If not, proposes to add braces around them.

Example:

if (condition)
action();

becomes

if (condition) {
action();
}

This check ought to be used with the -format option, so that the braces be
well-formatted.


Patch by Marek Kurdej!

http://reviews.llvm.org/D5395

llvm-svn: 218898

show more ...


# 6e195426 15-Sep-2014 Benjamin Kramer <benny.kra@googlemail.com>

[clang-tidy] Add a checker for long functions.

As this is very dependent on the code base it has some ways of configuration.
It's possible to pick between 3 modes of operation:

- Line counting: num

[clang-tidy] Add a checker for long functions.

As this is very dependent on the code base it has some ways of configuration.
It's possible to pick between 3 modes of operation:

- Line counting: number of lines including whitespace and comments
- Statement counting: number of statements within compoundStmts.
- Branch counter

In addition a threshold can be picked, warnings are only emitted when it is met.
The thresholds can be configured via a .clang-tidy file.

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

llvm-svn: 217768

show more ...


# be8c143d 10-Sep-2014 Alexander Kornienko <alexfh@google.com>

Unique-ptrify ClangTidyCheckFactories. Add a more convenient alternative to
addCheckFactory: registerCheck.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision:

Unique-ptrify ClangTidyCheckFactories. Add a more convenient alternative to
addCheckFactory: registerCheck.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 217489

show more ...


Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2
# 11887924 31-Jul-2014 Benjamin Kramer <benny.kra@googlemail.com>

[clang-tidy] Add a checker for code that looks like a delegate constructors but doesn't delegate.

Summary:
class Foo {
Foo() {
Foo(42); // oops
}
Foo(int);
};

This is valid code but it do

[clang-tidy] Add a checker for code that looks like a delegate constructors but doesn't delegate.

Summary:
class Foo {
Foo() {
Foo(42); // oops
}
Foo(int);
};

This is valid code but it does nothing and we can't emit a warning in clang
because there might be side effects. The checker emits a warning for this
pattern and also for base class initializers written in this style.

There is some overlap with the unused-rtti checker but they follow different
goals and fire in different places most of the time.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 214397

show more ...


# da3658e2 23-Jul-2014 Benjamin Kramer <benny.kra@googlemail.com>

Reapply r213647 with a fix.

ASTMatchers currently have problems mixing bound TypeLoc nodes with Decl/Stmt
nodes. That should be fixed soon but for this checker there we only need the
TypeLoc to gene

Reapply r213647 with a fix.

ASTMatchers currently have problems mixing bound TypeLoc nodes with Decl/Stmt
nodes. That should be fixed soon but for this checker there we only need the
TypeLoc to generate a fixit so postpone the potentially heavyweight AST walking
until after we know that we're going to emit a warning.

This is covered by existing test cases.

Original message:
[clang-tidy] Add a check for RAII temporaries.

This tries to find code similar that immediately destroys
an object that looks like it's trying to follow RAII.
{
scoped_lock(&global_mutex);
critical_section();
}

This checker will have false positives if someone uses this pattern
to legitimately invoke a destructor immediately (or the statement is
at the end of a scope anyway). To reduce the number we ignore this
pattern in macros (this is heavily used by gtest) and ignore objects
with no user-defined destructor.

llvm-svn: 213738

show more ...


# a714469d 23-Jul-2014 Richard Smith <richard-llvm@metafoo.co.uk>

Revert r213647; the added test triggers an assertion.

llvm-svn: 213722


# 8ca86511 22-Jul-2014 Benjamin Kramer <benny.kra@googlemail.com>

[clang-tidy] Add a check for RAII temporaries.

Summary:
This tries to find code similar that immediately destroys
an object that looks like it's trying to follow RAII.
{
scoped_lock(&global_mu

[clang-tidy] Add a check for RAII temporaries.

Summary:
This tries to find code similar that immediately destroys
an object that looks like it's trying to follow RAII.
{
scoped_lock(&global_mutex);
critical_section();
}

This checker will have false positives if someone uses this pattern
to legitimately invoke a destructor immediately (or the statement is
at the end of a scope anyway). To reduce the number we ignore this
pattern in macros (this is heavily used by gtest) and ignore objects
with no user-defined destructor.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 213647

show more ...


Revision tags: llvmorg-3.5.0-rc1
# 082bf7f6 14-Jul-2014 Benjamin Kramer <benny.kra@googlemail.com>

[clang-tidy] Add a checker for swapped arguments.

This looks for swapped arguments by looking at implicit conversions of arguments

void Foo(int, double);
Foo(1.0, 3); // Most likely a bug

llvm-svn

[clang-tidy] Add a checker for swapped arguments.

This looks for swapped arguments by looking at implicit conversions of arguments

void Foo(int, double);
Foo(1.0, 3); // Most likely a bug

llvm-svn: 212942

show more ...


# 1c8b3175 11-Jul-2014 Benjamin Kramer <benny.kra@googlemail.com>

[clang-tidy] Add a checker for implicit bool conversion of a bool*.

The goal is to find code like the example below, which is likely a typo
where someone meant to write "if (*b)".
bool *b = SomeFunc

[clang-tidy] Add a checker for implicit bool conversion of a bool*.

The goal is to find code like the example below, which is likely a typo
where someone meant to write "if (*b)".
bool *b = SomeFunction();
if (b) {
// b never dereferenced
}

This checker naturally has a relatively high false positive rate so it
applies some heuristics to avoid cases where the pointer is checked for
nullptr before being written.

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

llvm-svn: 212797

show more ...


Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1
# 2378ebd5 16-May-2014 Daniel Jasper <djasper@google.com>

Initial version of clang-tidy check to use override instead of virual.

Review: http://reviews.llvm.org/D3688
llvm-svn: 208954


Revision tags: llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1
# 3a571019 27-Mar-2014 Samuel Benzaquen <sbenza@google.com>

Add clang-tidy check to remove redundant .get() calls on smart pointers.

Summary:
This check finds and removes redundant .get() calls on smart pointers.
Example:
ptr.get()->Foo() ==> ptr->Foo(

Add clang-tidy check to remove redundant .get() calls on smart pointers.

Summary:
This check finds and removes redundant .get() calls on smart pointers.
Example:
ptr.get()->Foo() ==> ptr->Foo()

Reviewers: alexfh

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3186

llvm-svn: 204947

show more ...


12345