diff options
author | Alexander Kornienko <alexfh@google.com> | 2018-03-15 08:25:39 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2018-03-15 08:25:39 +0000 |
commit | 7ff60761296f7797967843a5169f1634f3d5c431 (patch) | |
tree | a4fcb5684766793c32785da10f8167e81fd5c552 /clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h | |
parent | ff6e82c9d050c17b6609cebcd65f97428c49e2cd (diff) | |
download | bcm5719-llvm-7ff60761296f7797967843a5169f1634f3d5c431.tar.gz bcm5719-llvm-7ff60761296f7797967843a5169f1634f3d5c431.zip |
[clang-tidy] rename_check.py {misc,bugprone}-macro-parentheses
llvm-svn: 327606
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h b/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h deleted file mode 100644 index e398fc6564c..00000000000 --- a/clang-tools-extra/clang-tidy/misc/MacroParenthesesCheck.h +++ /dev/null @@ -1,43 +0,0 @@ -//===--- MacroParenthesesCheck.h - clang-tidy--------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MACRO_PARENTHESES_H -#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MACRO_PARENTHESES_H - -#include "../ClangTidy.h" - -namespace clang { -namespace tidy { -namespace misc { - -/// Finds macros that can have unexpected behaviour due to missing parentheses. -/// -/// Macros are expanded by the preprocessor as-is. As a result, there can be -/// unexpected behaviour; operators may be evaluated in unexpected order and -/// unary operators may become binary operators, etc. -/// -/// When the replacement list has an expression, it is recommended to surround -/// it with parentheses. This ensures that the macro result is evaluated -/// completely before it is used. -/// -/// It is also recommended to surround macro arguments in the replacement list -/// with parentheses. This ensures that the argument value is calculated -/// properly. -class MacroParenthesesCheck : public ClangTidyCheck { -public: - MacroParenthesesCheck(StringRef Name, ClangTidyContext *Context) - : ClangTidyCheck(Name, Context) {} - void registerPPCallbacks(CompilerInstance &Compiler) override; -}; - -} // namespace misc -} // namespace tidy -} // namespace clang - -#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_MACRO_PARENTHESES_H |