Commit Graph

8 Commits

Author SHA1 Message Date
Etienne Bergeron 456177b98f [clang-tidy] Cleaning namespaces to be more consistant across checkers.
Summary:
The goal of the patch is to bring checkers in their appropriate namespace.
This path doesn't change any behavior.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 268264
2016-05-02 18:00:29 +00:00
Aaron Ballman a5d55a4617 Add support to the misc-assert-side-effect check for MSVC-style assert macros, which use !! instead of an if statement or a conditional operator.
llvm-svn: 258714
2016-01-25 20:00:53 +00:00
Alexander Kornienko b1b2f87e37 [clang-tidy] Use proper capitalization and punctuation for diagnostic messages.
Use diagnostic parameters where possible instead of string concatenation.

llvm-svn: 257176
2016-01-08 15:21:40 +00:00
Daniel Marjamaki 8ade8d2efd [clang-tidy] code cleanup using isAssignmentOp()
llvm-svn: 254066
2015-11-25 11:30:00 +00:00
Alexander Kornienko 54f3657448 [clang-tidy] misc-assert-side-effect: support assert macros defined through other macros
llvm-svn: 246446
2015-08-31 14:47:14 +00:00
Alexander Kornienko 50d7f4617f [clang-tidy] Move user-defined matches to unnamed namespaces to prevent ODR violations.
llvm-svn: 239904
2015-06-17 13:11:37 +00:00
Szabolcs Sipos 43a298cb36 [clang-tidy] Fix for llvm.org/PR23355
misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly.

llvm-svn: 238548
2015-05-29 09:49:59 +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