// // Created by erki on 16.02.21. // #ifndef LLVM_PROTO_OPERATIONFINDER_HPP #define LLVM_PROTO_OPERATIONFINDER_HPP #include #include "OperationLog.hpp" class OperationFinder { public: explicit OperationFinder(IOperationOutput* storage); void processArithmetic(const clang::BinaryOperator* op, const clang::SourceManager& source_manager); void processUnaryArithmetic(const clang::UnaryOperator* op, const clang::SourceManager& source_manager); void fallthroughBranchEntered(); void fallthroughBranchExited(); void forLoopEntered(); void forLoopExited(); private: void _processExpressionTypes(OperationLog& log, const clang::Expr* source, const clang::Expr* op1, const clang::Expr* op2); int _next_for_loop_id = 0; bool _in_fallthrough = false; std::vector _for_loop_stack; IOperationOutput* _storage; }; #endif //LLVM_PROTO_OPERATIONFINDER_HPP