clang  6.0.0svn
Public Member Functions | List of all members
clang::tooling::RefactoringRuleContext Class Reference

The refactoring rule context stores all of the inputs that might be needed by a refactoring action rule. More...

#include "clang/Tooling/Refactoring/RefactoringRuleContext.h"

Public Member Functions

 RefactoringRuleContext (const SourceManager &SM)
 
const SourceManagergetSources () const
 
SourceRange getSelectionRange () const
 Returns the current source selection range as set by the refactoring engine. More...
 
void setSelectionRange (SourceRange R)
 
bool hasASTContext () const
 
ASTContextgetASTContext () const
 
void setASTContext (ASTContext &Context)
 
llvm::Error createDiagnosticError (SourceLocation Loc, unsigned DiagID)
 Creates an llvm::Error value that contains a diagnostic. More...
 
llvm::Error createDiagnosticError (unsigned DiagID)
 
void setASTSelection (std::unique_ptr< SelectedASTNode > Node)
 

Detailed Description

The refactoring rule context stores all of the inputs that might be needed by a refactoring action rule.

It can create the specialized ASTRefactoringOperation or PreprocessorRefactoringOperation values that can be used by the refactoring action rules.

The following inputs are stored by the operation:

Definition at line 34 of file RefactoringRuleContext.h.

Constructor & Destructor Documentation

◆ RefactoringRuleContext()

clang::tooling::RefactoringRuleContext::RefactoringRuleContext ( const SourceManager SM)
inline

Definition at line 36 of file RefactoringRuleContext.h.

Member Function Documentation

◆ createDiagnosticError() [1/2]

llvm::Error clang::tooling::RefactoringRuleContext::createDiagnosticError ( SourceLocation  Loc,
unsigned  DiagID 
)
inline

Creates an llvm::Error value that contains a diagnostic.

The errors should not outlive the context.

Definition at line 58 of file RefactoringRuleContext.h.

References clang::DiagnosticError::create().

Referenced by createDiagnosticError(), and clang::tooling::RenameOccurrences::initiate().

◆ createDiagnosticError() [2/2]

llvm::Error clang::tooling::RefactoringRuleContext::createDiagnosticError ( unsigned  DiagID)
inline

Definition at line 62 of file RefactoringRuleContext.h.

References createDiagnosticError().

◆ getASTContext()

ASTContext& clang::tooling::RefactoringRuleContext::getASTContext ( ) const
inline

◆ getSelectionRange()

SourceRange clang::tooling::RefactoringRuleContext::getSelectionRange ( ) const
inline

Returns the current source selection range as set by the refactoring engine.

Can be invalid.

Definition at line 42 of file RefactoringRuleContext.h.

◆ getSources()

const SourceManager& clang::tooling::RefactoringRuleContext::getSources ( ) const
inline

Definition at line 38 of file RefactoringRuleContext.h.

◆ hasASTContext()

bool clang::tooling::RefactoringRuleContext::hasASTContext ( ) const
inline

Definition at line 46 of file RefactoringRuleContext.h.

◆ setASTContext()

void clang::tooling::RefactoringRuleContext::setASTContext ( ASTContext Context)
inline

Definition at line 53 of file RefactoringRuleContext.h.

◆ setASTSelection()

void clang::tooling::RefactoringRuleContext::setASTSelection ( std::unique_ptr< SelectedASTNode Node)
inline

Definition at line 66 of file RefactoringRuleContext.h.

◆ setSelectionRange()

void clang::tooling::RefactoringRuleContext::setSelectionRange ( SourceRange  R)
inline

Definition at line 44 of file RefactoringRuleContext.h.


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