Skip to content

Commit 7c7ea7d

Browse files
author
Mandeep Singh Grang
committedNov 8, 2016
[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 llvm-svn: 286221
1 parent d700c35 commit 7c7ea7d

File tree

114 files changed

+410
-479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+410
-479
lines changed
 

‎clang-tools-extra/change-namespace/ChangeNamespace.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@ void ChangeNamespaceTool::run(
345345
} else if (const auto *TLoc = Result.Nodes.getNodeAs<TypeLoc>("type")) {
346346
fixTypeLoc(Result, startLocationForType(*TLoc), EndLocationForType(*TLoc),
347347
*TLoc);
348-
} else if (const auto *VarRef = Result.Nodes.getNodeAs<DeclRefExpr>("var_ref")){
348+
} else if (const auto *VarRef =
349+
Result.Nodes.getNodeAs<DeclRefExpr>("var_ref")) {
349350
const auto *Var = Result.Nodes.getNodeAs<VarDecl>("var_decl");
350351
assert(Var);
351352
if (Var->getCanonicalDecl()->isStaticDataMember())
@@ -358,8 +359,8 @@ void ChangeNamespaceTool::run(
358359
VarRefRange.getEnd(), Name);
359360
} else {
360361
const auto *Call = Result.Nodes.getNodeAs<clang::CallExpr>("call");
361-
assert(Call != nullptr &&"Expecting callback for CallExpr.");
362-
const clang::FunctionDecl* Func = Call->getDirectCallee();
362+
assert(Call != nullptr && "Expecting callback for CallExpr.");
363+
const clang::FunctionDecl *Func = Call->getDirectCallee();
363364
assert(Func != nullptr);
364365
// Ignore out-of-line static methods since they will be handled by nested
365366
// name specifiers.
@@ -548,7 +549,8 @@ void ChangeNamespaceTool::fixUsingShadowDecl(
548549
const UsingDecl *UsingDeclaration) {
549550
SourceLocation Start = UsingDeclaration->getLocStart();
550551
SourceLocation End = UsingDeclaration->getLocEnd();
551-
if (Start.isInvalid() || End.isInvalid()) return;
552+
if (Start.isInvalid() || End.isInvalid())
553+
return;
552554

553555
assert(UsingDeclaration->shadow_size() > 0);
554556
// FIXME: it might not be always accurate to use the first using-decl.

‎clang-tools-extra/clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ namespace replace {
3838
typedef std::vector<clang::tooling::Range> RangeVector;
3939

4040
/// \brief Collection of TranslationUnitReplacements.
41-
typedef std::vector<clang::tooling::TranslationUnitReplacements>
42-
TUReplacements;
41+
typedef std::vector<clang::tooling::TranslationUnitReplacements> TUReplacements;
4342

4443
/// \brief Collection of TranslationUnitReplacement files.
4544
typedef std::vector<std::string> TUReplacementFiles;
@@ -66,11 +65,9 @@ typedef llvm::DenseMap<const clang::FileEntry *,
6665
///
6766
/// \returns An error_code indicating success or failure in navigating the
6867
/// directory structure.
69-
std::error_code
70-
collectReplacementsFromDirectory(const llvm::StringRef Directory,
71-
TUReplacements &TUs,
72-
TUReplacementFiles &TURFiles,
73-
clang::DiagnosticsEngine &Diagnostics);
68+
std::error_code collectReplacementsFromDirectory(
69+
const llvm::StringRef Directory, TUReplacements &TUs,
70+
TUReplacementFiles &TURFiles, clang::DiagnosticsEngine &Diagnostics);
7471

7572
/// \brief Deduplicate, check for conflicts, and apply all Replacements stored
7673
/// in \c TUs. If conflicts occur, no Replacements are applied.
@@ -115,7 +112,7 @@ bool applyReplacements(const FileToReplacementsMap &GroupedReplacements,
115112
/// \pre Replacements[i].getOffset() <= Replacements[i+1].getOffset().
116113
///
117114
/// \param[in] Replacements Replacements from a single file.
118-
///
115+
///
119116
/// \returns Collection of source ranges that enclose all given Replacements.
120117
/// One range is created for each replacement.
121118
RangeVector calculateChangedRanges(

0 commit comments

Comments
 (0)
Please sign in to comment.