clang  10.0.0svn
Public Types | Public Member Functions | List of all members
clang::tooling::Transformer Class Reference

Handles the matcher and callback registration for a single RewriteRule, as defined by the arguments of the constructor. More...

#include "clang/Tooling/Transformer/Transformer.h"

Inheritance diagram for clang::tooling::Transformer:
Inheritance graph
[legend]
Collaboration diagram for clang::tooling::Transformer:
Collaboration graph
[legend]

Public Types

using ChangeConsumer = std::function< void(Expected< clang::tooling::AtomicChange > Change)>
 

Public Member Functions

 Transformer (transformer::RewriteRule Rule, ChangeConsumer Consumer)
 
void registerMatchers (ast_matchers::MatchFinder *MatchFinder)
 N.B. More...
 
void run (const ast_matchers::MatchFinder::MatchResult &Result) override
 Not called directly by users – called by the framework, via base class pointer. More...
 
- Public Member Functions inherited from clang::ast_matchers::MatchFinder::MatchCallback
virtual ~MatchCallback ()
 
virtual void onStartOfTranslationUnit ()
 Called at the start of each translation unit. More...
 
virtual void onEndOfTranslationUnit ()
 Called at the end of each translation unit. More...
 
virtual StringRef getID () const
 An id used to group the matchers. More...
 

Detailed Description

Handles the matcher and callback registration for a single RewriteRule, as defined by the arguments of the constructor.

Definition at line 23 of file Transformer.h.

Member Typedef Documentation

◆ ChangeConsumer

Definition at line 26 of file Transformer.h.

Constructor & Destructor Documentation

◆ Transformer()

clang::tooling::Transformer::Transformer ( transformer::RewriteRule  Rule,
ChangeConsumer  Consumer 
)
inline
Parameters
ConsumerReceives each rewrite or error. Will not necessarily be called for each match; for example, if the rewrite is not applicable because of macros, but doesn't fail. Note that clients are responsible for handling the case that independent AtomicChanges conflict with each other.

Definition at line 33 of file Transformer.h.

References registerMatchers(), and run().

Member Function Documentation

◆ registerMatchers()

void Transformer::registerMatchers ( ast_matchers::MatchFinder MatchFinder)

N.B.

Passes this pointer to MatchFinder. So, this object should not be moved after this call.

Definition at line 23 of file Transformer.cpp.

Referenced by Transformer().

◆ run()

void Transformer::run ( const ast_matchers::MatchFinder::MatchResult Result)
overridevirtual

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