35 lines
837 B
C++
35 lines
837 B
C++
//
|
|
// Created by erki on 02.03.21.
|
|
//
|
|
|
|
#ifndef C_ANALYZER_OPERATIONFINDERASTVISITOR_HPP
|
|
#define C_ANALYZER_OPERATIONFINDERASTVISITOR_HPP
|
|
|
|
#include <clang/AST/RecursiveASTVisitor.h>
|
|
|
|
class OperationFinder;
|
|
|
|
class OperationFinderAstVisitor
|
|
: public clang::RecursiveASTVisitor<OperationFinderAstVisitor>
|
|
{
|
|
public:
|
|
explicit OperationFinderAstVisitor(OperationFinder* op_finder);
|
|
|
|
void NewContext(clang::ASTContext* context);
|
|
|
|
bool VisitForStmt(clang::ForStmt* stmt);
|
|
bool VisitBinaryOperator(clang::BinaryOperator* op);
|
|
bool VisitUnaryOperator(clang::UnaryOperator* op);
|
|
|
|
bool dataTraverseStmtPre(clang::Stmt* stmt);
|
|
bool dataTraverseStmtPost(clang::Stmt* stmt);
|
|
|
|
private:
|
|
clang::ASTContext* _context;
|
|
OperationFinder* _op_finder;
|
|
|
|
clang::Stmt* _loop_init = nullptr;
|
|
};
|
|
|
|
#endif //C_ANALYZER_OPERATIONFINDERASTVISITOR_HPP
|