X-Git-Url: https://git.jankratochvil.net/?p=lldb.git;a=blobdiff_plain;f=clang-tools-extra%2Floop-convert%2FLoopActions.h;h=b1bc5581dbb37a4c5de18ff623674526bed83349;hp=8772ed69c8f5ea34e7185c10a6b6952553a1599e;hb=78184d9d7468e60c6fcc5582135873f17db95c7c;hpb=4483b0c56dee773f1a80b263e3e3603fe9fd8400 diff --git a/clang-tools-extra/loop-convert/LoopActions.h b/clang-tools-extra/loop-convert/LoopActions.h index 8772ed6..b1bc558 100644 --- a/clang-tools-extra/loop-convert/LoopActions.h +++ b/clang-tools-extra/loop-convert/LoopActions.h @@ -23,6 +23,7 @@ namespace clang { namespace loop_migrate { struct Usage; +class Confidence; // The main computational result of ForLoopIndexUseVisitor. typedef llvm::SmallVector UsageResult; @@ -75,11 +76,21 @@ class LoopFixer : public ast_matchers::MatchFinder::MatchCallback { /// \brief Computes the changes needed to convert a given for loop, and /// applies it if this->CountOnly is false. void doConversion(ASTContext *Context, - const VarDecl *IndexVar, const VarDecl *EndVar, + const VarDecl *IndexVar, const Expr *ContainerExpr, const UsageResult &Usages, const DeclStmt *AliasDecl, const ForStmt *TheLoop, bool ContainerNeedsDereference); + /// \brief Given a loop header that would be convertible, discover all usages + /// of the index variable and convert the loop if possible. + void FindAndVerifyUsages(ASTContext *Context, + const VarDecl *LoopVar, + const VarDecl *EndVar, + const Expr *ContainerExpr, + const Expr *BoundExpr, + bool ContainerNeedsDereference, + const ForStmt *TheLoop, + Confidence ConfidenceLevel); }; } // namespace loop_migrate