aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/utils
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2016-11-08 07:50:19 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2016-11-08 07:50:19 +0000
commit5242a87b7665f03c2cb314f35401c707c72f1543 (patch)
tree8530ce29edf222c67baafa4fb5cf35ff72d679c2 /clang-tidy/utils
parent9234817c638eda1885bbb2c546b5219baa889f69 (diff)
[clang-tools-extra] Format sources with clang-format. NFC.
Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@286221 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/utils')
-rw-r--r--clang-tidy/utils/IncludeInserter.cpp5
-rw-r--r--clang-tidy/utils/Matchers.h6
-rw-r--r--clang-tidy/utils/NamespaceAliaser.cpp2
-rw-r--r--clang-tidy/utils/TypeTraits.cpp6
-rw-r--r--clang-tidy/utils/UsingInserter.cpp3
5 files changed, 9 insertions, 13 deletions
diff --git a/clang-tidy/utils/IncludeInserter.cpp b/clang-tidy/utils/IncludeInserter.cpp
index 3a318899..9fc7f521 100644
--- a/clang-tidy/utils/IncludeInserter.cpp
+++ b/clang-tidy/utils/IncludeInserter.cpp
@@ -21,9 +21,8 @@ public:
// Implements PPCallbacks::InclusionDerective(). Records the names and source
// locations of the inclusions in the main source file being processed.
void InclusionDirective(SourceLocation HashLocation,
- const Token & IncludeToken,
- StringRef FileNameRef, bool IsAngled,
- CharSourceRange FileNameRange,
+ const Token &IncludeToken, StringRef FileNameRef,
+ bool IsAngled, CharSourceRange FileNameRange,
const FileEntry * /*IncludedFile*/,
StringRef /*SearchPath*/, StringRef /*RelativePath*/,
const Module * /*ImportedModule*/) override {
diff --git a/clang-tidy/utils/Matchers.h b/clang-tidy/utils/Matchers.h
index d294ed78..adafdd9a 100644
--- a/clang-tidy/utils/Matchers.h
+++ b/clang-tidy/utils/Matchers.h
@@ -10,8 +10,8 @@
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_MATCHERS_H
-#include "clang/ASTMatchers/ASTMatchers.h"
#include "TypeTraits.h"
+#include "clang/ASTMatchers/ASTMatchers.h"
namespace clang {
namespace tidy {
@@ -21,9 +21,7 @@ AST_MATCHER(BinaryOperator, isRelationalOperator) {
return Node.isRelationalOp();
}
-AST_MATCHER(BinaryOperator, isEqualityOperator) {
- return Node.isEqualityOp();
-}
+AST_MATCHER(BinaryOperator, isEqualityOperator) { return Node.isEqualityOp(); }
AST_MATCHER(BinaryOperator, isComparisonOperator) {
return Node.isComparisonOp();
diff --git a/clang-tidy/utils/NamespaceAliaser.cpp b/clang-tidy/utils/NamespaceAliaser.cpp
index 04fdb8cd..1a5120de 100644
--- a/clang-tidy/utils/NamespaceAliaser.cpp
+++ b/clang-tidy/utils/NamespaceAliaser.cpp
@@ -35,11 +35,9 @@ NamespaceAliaser::createAlias(ASTContext &Context, const Stmt &Statement,
if (!Function || !Function->hasBody())
return None;
-
if (AddedAliases[Function].count(Namespace.str()) != 0)
return None;
-
// FIXME: Doesn't consider the order of declarations.
// If we accidentially pick an alias defined later in the function,
// the output won't compile.
diff --git a/clang-tidy/utils/TypeTraits.cpp b/clang-tidy/utils/TypeTraits.cpp
index 88e4a829..6dd4141b 100644
--- a/clang-tidy/utils/TypeTraits.cpp
+++ b/clang-tidy/utils/TypeTraits.cpp
@@ -65,7 +65,8 @@ bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
if (ClassDecl->hasTrivialDefaultConstructor())
return true;
- // If all its fields are trivially constructible and have no default initializers.
+ // If all its fields are trivially constructible and have no default
+ // initializers.
for (const FieldDecl *Field : ClassDecl->fields()) {
if (Field->hasInClassInitializer())
return false;
@@ -84,8 +85,7 @@ bool recordIsTriviallyDefaultConstructible(const RecordDecl &RecordDecl,
}
// Based on QualType::isTrivial.
-bool isTriviallyDefaultConstructible(QualType Type,
- const ASTContext &Context) {
+bool isTriviallyDefaultConstructible(QualType Type, const ASTContext &Context) {
if (Type.isNull())
return false;
diff --git a/clang-tidy/utils/UsingInserter.cpp b/clang-tidy/utils/UsingInserter.cpp
index c0746afc..e7200c99 100644
--- a/clang-tidy/utils/UsingInserter.cpp
+++ b/clang-tidy/utils/UsingInserter.cpp
@@ -68,7 +68,8 @@ Optional<FixItHint> UsingInserter::createUsingDeclaration(
if (HasConflictingDeclaration || HasConflictingDeclRef)
return None;
- std::string Declaration = (llvm::Twine("\nusing ") + QualifiedName + ";").str();
+ std::string Declaration =
+ (llvm::Twine("\nusing ") + QualifiedName + ";").str();
AddedUsing.emplace(std::make_pair(Function, QualifiedName.str()));
return FixItHint::CreateInsertion(InsertLoc, Declaration);