clang  6.0.0svn
Classes | Public Member Functions | Static Public Member Functions | List of all members
clang::tooling::ReplaceNodeWithTemplate Class Reference

Replace the text of an AST node bound to FromId with the result of evaluating the template in ToTemplate. More...

#include "clang/Tooling/RefactoringCallbacks.h"

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

Public Member Functions

void run (const ast_matchers::MatchFinder::MatchResult &Result) override
 Called on every match by the MatchFinder. More...
 
- Public Member Functions inherited from clang::tooling::RefactoringCallback
 RefactoringCallback ()
 
ReplacementsgetReplacements ()
 
- 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...
 

Static Public Member Functions

static llvm::Expected< std::unique_ptr< ReplaceNodeWithTemplate > > create (StringRef FromId, StringRef ToTemplate)
 

Additional Inherited Members

- Protected Attributes inherited from clang::tooling::RefactoringCallback
Replacements Replace
 

Detailed Description

Replace the text of an AST node bound to FromId with the result of evaluating the template in ToTemplate.

Expressions of the form ${NodeName} in ToTemplate will be replaced by the text of the node bound to ${NodeName}. The string "$$" will be replaced by "$".

Definition at line 95 of file RefactoringCallbacks.h.

Member Function Documentation

◆ create()

llvm::Expected< std::unique_ptr< ReplaceNodeWithTemplate > > clang::tooling::ReplaceNodeWithTemplate::create ( StringRef  FromId,
StringRef  ToTemplate 
)
static

Definition at line 160 of file RefactoringCallbacks.cpp.

◆ run()

void clang::tooling::ReplaceNodeWithTemplate::run ( const ast_matchers::MatchFinder::MatchResult Result)
overridevirtual

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