9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H
12 #include "../ClangTidyCheck.h"
23 return LangOpts.CPlusPlus;
27 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
30 struct RangeDescriptor {
32 bool ContainerNeedsDereference;
35 std::string ContainerString;
39 void getAliasRange(SourceManager &SM, SourceRange &DeclRange);
41 void doConversion(ASTContext *Context,
const VarDecl *IndexVar,
42 const ValueDecl *MaybeContainer,
const UsageResult &Usages,
43 const DeclStmt *AliasDecl,
bool AliasUseRequired,
44 bool AliasFromForInit,
const ForStmt *Loop,
45 RangeDescriptor Descriptor);
47 StringRef getContainerString(ASTContext *Context,
const ForStmt *Loop,
48 const Expr *ContainerExpr);
50 void getArrayLoopQualifiers(ASTContext *Context,
51 const ast_matchers::BoundNodes &Nodes,
52 const Expr *ContainerExpr,
54 RangeDescriptor &Descriptor);
56 void getIteratorLoopQualifiers(ASTContext *Context,
57 const ast_matchers::BoundNodes &Nodes,
58 RangeDescriptor &Descriptor);
60 void determineRangeDescriptor(ASTContext *Context,
61 const ast_matchers::BoundNodes &Nodes,
63 const Expr *ContainerExpr,
65 RangeDescriptor &Descriptor);
67 bool isConvertible(ASTContext *Context,
const ast_matchers::BoundNodes &Nodes,
70 std::unique_ptr<TUTrackingInfo> TUInfo;
71 const unsigned long long MaxCopySize;
80 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_LOOP_CONVERT_H