DiegoAstiazaran updated this revision to Diff 201375.
DiegoAstiazaran added a comment.

Reduces lines to 80 characters. The files have been also formatted by 
clang-format.
Types are replaced by auto in declarations where the type is spelled in cast.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62437/new/

https://reviews.llvm.org/D62437

Files:
  clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp
  clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h
  clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp
  clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h
  clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp

Index: clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp
===================================================================
--- clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp
+++ clang-tools-extra/clang-tidy/fuchsia/FuchsiaTidyModule.cpp
@@ -1,4 +1,4 @@
-//===--- FuchsiaTidyModule.cpp - clang-tidy--------------------------------===//
+//===--- FuchsiaTidyModule.cpp - clang-tidy -------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h
===================================================================
--- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h
+++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.h
@@ -1,4 +1,4 @@
-//===--- DefaultArgumentsDeclarationsCheck.h - clang-tidy ------------------*- C++ -*-===//
+//===--- DefaultArgumentsDeclarationsCheck.h - clang-tidy -------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp
+++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsDeclarationsCheck.cpp
@@ -19,33 +19,33 @@
   Finder->addMatcher(parmVarDecl(hasDefaultArgument()).bind("decl"), this);
 }
 
-void DefaultArgumentsDeclarationsCheck::check(const MatchFinder::MatchResult &Result) {
-  const ParmVarDecl *D = Result.Nodes.getNodeAs<ParmVarDecl>("decl");
-  if (D == nullptr) return;
+void DefaultArgumentsDeclarationsCheck::check(
+    const MatchFinder::MatchResult &Result) {
+  const auto *D = Result.Nodes.getNodeAs<ParmVarDecl>("decl");
+  if (D == nullptr)
+    return;
 
   SourceRange DefaultArgRange = D->getDefaultArgRange();
 
-  if (DefaultArgRange.getEnd() != D->getEndLoc()) return;
-  
+  if (DefaultArgRange.getEnd() != D->getEndLoc())
+    return;
+
   if (DefaultArgRange.getBegin().isMacroID()) {
     diag(D->getBeginLoc(),
-          "declaring a parameter with a default argument is disallowed");
+         "declaring a parameter with a default argument is disallowed");
     return;
   }
 
   SourceLocation StartLocation =
       D->getName().empty() ? D->getBeginLoc() : D->getLocation();
 
-  SourceRange RemovalRange(Lexer::getLocForEndOfToken(
-          StartLocation, 0,
-          *Result.SourceManager,
-          Result.Context->getLangOpts()
-        ),
-        DefaultArgRange.getEnd()
-      );
+  SourceRange RemovalRange(
+      Lexer::getLocForEndOfToken(StartLocation, 0, *Result.SourceManager,
+                                 Result.Context->getLangOpts()),
+      DefaultArgRange.getEnd());
 
   diag(D->getBeginLoc(),
-        "declaring a parameter with a default argument is disallowed")
+       "declaring a parameter with a default argument is disallowed")
       << D << FixItHint::CreateRemoval(RemovalRange);
 }
 
Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h
===================================================================
--- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h
+++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.h
@@ -1,4 +1,4 @@
-//===--- DefaultArgumentsCallsCheck.h - clang-tidy--------------------*- C++ -*-===//
+//===--- DefaultArgumentsCallsCheck.h - clang-tidy --------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
Index: clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp
+++ clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCallsCheck.cpp
@@ -21,12 +21,13 @@
 
 void DefaultArgumentsCallsCheck::check(const MatchFinder::MatchResult &Result) {
   const auto *S = Result.Nodes.getNodeAs<CXXDefaultArgExpr>("stmt");
-  if (S == nullptr) return;
+  if (S == nullptr)
+    return;
 
   diag(S->getUsedLocation(),
-        "calling a function that uses a default argument is disallowed");
+       "calling a function that uses a default argument is disallowed");
   diag(S->getParam()->getBeginLoc(), "default parameter was declared here",
-        DiagnosticIDs::Note);
+       DiagnosticIDs::Note);
 }
 
 } // namespace fuchsia
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to