[clang-tools-extra] r288175 - Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).

Eugene Zelenko via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 10:24:02 PST 2016


Author: eugenezelenko
Date: Tue Nov 29 12:24:01 2016
New Revision: 288175

URL: http://llvm.org/viewvc/llvm-project?rev=288175&view=rev
Log:
Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).

This preparation to remove SetVector.h dependency on SmallSet.h.

Modified:
    clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
    clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp
    clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
    clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
    clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h
    clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h

Modified: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp?rev=288175&r1=288174&r2=288175&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp (original)
+++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp Tue Nov 29 12:24:01 2016
@@ -18,10 +18,16 @@
 #include "USRFinder.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/Basic/LLVM.h"
 #include "clang/Basic/SourceLocation.h"
-#include "clang/Index/USRGeneration.h"
+#include "clang/Basic/SourceManager.h"
 #include "clang/Lex/Lexer.h"
-#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Casting.h"
+#include <cstddef>
+#include <set>
+#include <string>
+#include <vector>
 
 using namespace llvm;
 
@@ -29,6 +35,7 @@ namespace clang {
 namespace rename {
 
 namespace {
+
 // \brief This visitor recursively searches for all instances of a USR in a
 // translation unit and stores them for later usage.
 class USRLocFindingASTVisitor
@@ -140,6 +147,7 @@ private:
   std::vector<clang::SourceLocation> LocationsFound;
   const ASTContext &Context;
 };
+
 } // namespace
 
 std::vector<SourceLocation>

Modified: clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp?rev=288175&r1=288174&r2=288175&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/AvoidBindCheck.cpp Tue Nov 29 12:24:01 2016
@@ -1,4 +1,4 @@
-//===--- AvoidBindCheck.cpp - clang-tidy--------------------------------===//
+//===--- AvoidBindCheck.cpp - clang-tidy-----------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -6,12 +6,25 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+
 #include "AvoidBindCheck.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Basic/LangOptions.h"
+#include "clang/Basic/SourceLocation.h"
 #include "clang/Lex/Lexer.h"
-#include <cassert>
-#include <unordered_map>
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Casting.h"
+#include "llvm/Support/Regex.h"
+#include "llvm/Support/raw_ostream.h"
+#include <algorithm>
+#include <cstddef>
+#include <string>
 
 using namespace clang::ast_matchers;
 
@@ -20,6 +33,7 @@ namespace tidy {
 namespace modernize {
 
 namespace {
+
 enum BindArgumentKind { BK_Temporary, BK_Placeholder, BK_CallExpr, BK_Other };
 
 struct BindArgument {

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp?rev=288175&r1=288174&r2=288175&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertCheck.cpp Tue Nov 29 12:24:01 2016
@@ -8,11 +8,21 @@
 //===----------------------------------------------------------------------===//
 
 #include "LoopConvertCheck.h"
-#include "../utils/Matchers.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Basic/LangOptions.h"
+#include "clang/Basic/SourceLocation.h"
+#include "clang/Basic/SourceManager.h"
+#include "clang/Lex/Lexer.h" 
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/Casting.h"
+#include <cassert>
+#include <cstring>
+#include <utility>
 
-using namespace clang;
 using namespace clang::ast_matchers;
 using namespace llvm;
 

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp?rev=288175&r1=288174&r2=288175&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.cpp Tue Nov 29 12:24:01 2016
@@ -8,11 +8,24 @@
 //===----------------------------------------------------------------------===//
 
 #include "LoopConvertUtils.h"
+#include "clang/Basic/IdentifierTable.h"
+#include "clang/Basic/LLVM.h"
+#include "clang/Basic/Lambda.h"
+#include "clang/Basic/SourceManager.h"
+#include "clang/Basic/SourceLocation.h"
+#include "clang/Basic/TokenKinds.h"
+#include "clang/Lex/Lexer.h" 
+#include "llvm/ADT/APSInt.h"
+#include "llvm/ADT/FoldingSet.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Casting.h"
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <string>
+#include <utility>
 
 using namespace clang::ast_matchers;
-using namespace clang::tooling;
-using namespace clang;
-using namespace llvm;
 
 namespace clang {
 namespace tidy {
@@ -462,7 +475,7 @@ void ForLoopIndexUseVisitor::addComponen
 }
 
 void ForLoopIndexUseVisitor::addComponent(const Expr *E) {
-  FoldingSetNodeID ID;
+  llvm::FoldingSetNodeID ID;
   const Expr *Node = E->IgnoreParenImpCasts();
   Node->Profile(ID, *Context, true);
   DependentExprs.push_back(std::make_pair(Node, ID));

Modified: clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h?rev=288175&r1=288174&r2=288175&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/LoopConvertUtils.h Tue Nov 29 12:24:01 2016
@@ -13,8 +13,15 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/ASTMatchers/ASTMatchFinder.h"
-#include "clang/Lex/Lexer.h"
-#include "clang/Tooling/Refactoring.h"
+#include "clang/Basic/SourceLocation.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include <algorithm>
+#include <memory>
+#include <string>
+#include <utility>
 
 namespace clang {
 namespace tidy {
@@ -79,7 +86,7 @@ private:
 class ComponentFinderASTVisitor
     : public clang::RecursiveASTVisitor<ComponentFinderASTVisitor> {
 public:
-  ComponentFinderASTVisitor() {}
+  ComponentFinderASTVisitor() = default;
 
   /// Find the components of an expression and place them in a ComponentVector.
   void findExprComponents(const clang::Expr *SourceExpr) {

Modified: clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h?rev=288175&r1=288174&r2=288175&view=diff
==============================================================================
--- clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h (original)
+++ clang-tools-extra/trunk/pp-trace/PPCallbacksTracker.h Tue Nov 29 12:24:01 2016
@@ -1,11 +1,11 @@
-//===--- PPCallbacksTracker.h - Preprocessor tracking -*- C++ -*---------===//
+//===--- PPCallbacksTracker.h - Preprocessor tracking -----------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
 // This file is distributed under the University of Illinois Open Source
 // License. See LICENSE.TXT for details.
 //
-//===--------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 ///
 /// \file
 /// \brief Classes and definitions for preprocessor tracking.
@@ -17,13 +17,19 @@
 /// record the preprocessor callback name and arguments in high-level string
 /// form for later inspection.
 ///
-//===--------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 
 #ifndef PPTRACE_PPCALLBACKSTRACKER_H
 #define PPTRACE_PPCALLBACKSTRACKER_H
 
 #include "clang/Lex/PPCallbacks.h"
 #include "clang/Lex/Preprocessor.h"
+#include "clang/Basic/SourceManager.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/StringRef.h"
+#include <string>
+#include <vector>
 
 /// \brief This class represents one callback function argument by name
 ///   and value.
@@ -31,7 +37,7 @@ class Argument {
 public:
   Argument(llvm::StringRef Name, llvm::StringRef Value)
       : Name(Name), Value(Value) {}
-  Argument() {}
+  Argument() = default;
 
   std::string Name;
   std::string Value;
@@ -42,7 +48,7 @@ public:
 class CallbackCall {
 public:
   CallbackCall(llvm::StringRef Name) : Name(Name) {}
-  CallbackCall() {}
+  CallbackCall() = default;
 
   std::string Name;
   std::vector<Argument> Arguments;




More information about the cfe-commits mailing list