clang-metatool
A framework for reusing code in clang tools
Classes | Public Types | Public Member Functions | List of all members
clangmetatool::MetaTool< WrappedTool > Class Template Reference

#include <clangmetatool/meta_tool.h>

Inheritance diagram for clangmetatool::MetaTool< WrappedTool >:
Inheritance graph
[legend]
Collaboration diagram for clangmetatool::MetaTool< WrappedTool >:
Collaboration graph
[legend]

Public Types

typedef std::conditional_t< providesArgTypes, WrappedTool, NoArgs >::ArgTypes ArgTypes
 

Public Member Functions

 MetaTool (std::map< std::string, clang::tooling::Replacements > &replacementsMap, ArgTypes &args)
 
 MetaTool (std::map< std::string, clang::tooling::Replacements > &replacementsMap)
 
 ~MetaTool ()
 
virtual bool BeginSourceFileAction (clang::CompilerInstance &ci) override
 
virtual void EndSourceFileAction () override
 
virtual std::unique_ptr< clang::ASTConsumer > CreateASTConsumer (clang::CompilerInstance &CI, llvm::StringRef file) override
 

Detailed Description

template<class WrappedTool>
class clangmetatool::MetaTool< WrappedTool >

MetaTool is a template that reduces the amount of boilerplate required to write a clang tool. The WrappedTool is a class that is expected to have:

Definition at line 48 of file meta_tool.h.

Member Typedef Documentation

◆ ArgTypes

template<class WrappedTool >
typedef std::conditional_t<providesArgTypes, WrappedTool, NoArgs>::ArgTypes clangmetatool::MetaTool< WrappedTool >::ArgTypes

Definition at line 58 of file meta_tool.h.

Constructor & Destructor Documentation

◆ MetaTool() [1/2]

template<class WrappedTool >
clangmetatool::MetaTool< WrappedTool >::MetaTool ( std::map< std::string, clang::tooling::Replacements > &  replacementsMap,
ArgTypes args 
)
inline

Definition at line 77 of file meta_tool.h.

◆ MetaTool() [2/2]

template<class WrappedTool >
clangmetatool::MetaTool< WrappedTool >::MetaTool ( std::map< std::string, clang::tooling::Replacements > &  replacementsMap)
inline

Definition at line 81 of file meta_tool.h.

◆ ~MetaTool()

template<class WrappedTool >
clangmetatool::MetaTool< WrappedTool >::~MetaTool ( )
inline

Definition at line 84 of file meta_tool.h.

Member Function Documentation

◆ BeginSourceFileAction()

template<class WrappedTool >
virtual bool clangmetatool::MetaTool< WrappedTool >::BeginSourceFileAction ( clang::CompilerInstance &  ci)
inlineoverridevirtual

Definition at line 89 of file meta_tool.h.

◆ CreateASTConsumer()

template<class WrappedTool >
virtual std::unique_ptr<clang::ASTConsumer> clangmetatool::MetaTool< WrappedTool >::CreateASTConsumer ( clang::CompilerInstance &  CI,
llvm::StringRef  file 
)
inlineoverridevirtual

Definition at line 104 of file meta_tool.h.

◆ EndSourceFileAction()

template<class WrappedTool >
virtual void clangmetatool::MetaTool< WrappedTool >::EndSourceFileAction ( )
inlineoverridevirtual

Definition at line 99 of file meta_tool.h.


The documentation for this class was generated from the following file: