forked from OSchip/llvm-project
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. llvm-svn: 288175
This commit is contained in:
parent
b3ee0ba7a1
commit
86150471c6
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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::addComponents(const ComponentVector &Components) {
|
|||
}
|
||||
|
||||
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));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue