masters-thesis/op-finder/OperationFinderConsumer.hpp

33 lines
763 B
C++

//
// Created by erki on 24.02.21.
//
#ifndef C_ANALYZER_OPERATIONFINDERCONSUMER_HPP
#define C_ANALYZER_OPERATIONFINDERCONSUMER_HPP
#include <clang/AST/ASTConsumer.h>
#include <clang/Frontend/FrontendAction.h>
#include "OperationFinder.hpp"
class OperationFinderConsumer : public clang::ASTConsumer
{
public:
OperationFinderConsumer();
void HandleTranslationUnit(clang::ASTContext& context) override;
private:
OperationFinder _op_finder;
clang::ast_matchers::MatchFinder _ast_finder;
};
class OperationFinderAction : public clang::ASTFrontendAction
{
public:
std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(
clang::CompilerInstance& compiler, llvm::StringRef in_file) override;
};
#endif //C_ANALYZER_OPERATIONFINDERCONSUMER_HPP