clang 20.0.0git
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.
 
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.
 
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 33 of file RefactoringRuleContext.h.

Constructor & Destructor Documentation

◆ RefactoringRuleContext()

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

Definition at line 35 of file RefactoringRuleContext.h.

References SM.

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 57 of file RefactoringRuleContext.h.

References clang::DiagnosticError::create(), and Loc.

Referenced by createDiagnosticError().

◆ createDiagnosticError() [2/2]

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

Definition at line 61 of file RefactoringRuleContext.h.

References createDiagnosticError().

◆ getASTContext()

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

Definition at line 47 of file RefactoringRuleContext.h.

◆ 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 41 of file RefactoringRuleContext.h.

◆ getSources()

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

Definition at line 37 of file RefactoringRuleContext.h.

◆ hasASTContext()

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

Definition at line 45 of file RefactoringRuleContext.h.

◆ setASTContext()

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

Definition at line 52 of file RefactoringRuleContext.h.

◆ setASTSelection()

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

Definition at line 65 of file RefactoringRuleContext.h.

References Node.

◆ setSelectionRange()

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

Definition at line 43 of file RefactoringRuleContext.h.


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