clang 20.0.0git
|
#include "clang/Sema/TypoCorrection.h"
Public Member Functions | |
FunctionCallFilterCCC (Sema &SemaRef, unsigned NumArgs, bool HasExplicitTemplateArgs, MemberExpr *ME=nullptr) | |
bool | ValidateCandidate (const TypoCorrection &candidate) override |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. | |
std::unique_ptr< CorrectionCandidateCallback > | clone () override |
Clone this CorrectionCandidateCallback. | |
Public Member Functions inherited from clang::CorrectionCandidateCallback | |
CorrectionCandidateCallback (const IdentifierInfo *Typo=nullptr, NestedNameSpecifier *TypoNNS=nullptr) | |
virtual | ~CorrectionCandidateCallback ()=default |
virtual bool | ValidateCandidate (const TypoCorrection &candidate) |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. | |
virtual unsigned | RankCandidate (const TypoCorrection &candidate) |
Method used by Sema::CorrectTypo to assign an "edit distance" rank to a candidate (where a lower value represents a better candidate), or returning InvalidDistance if the candidate is not at all viable. | |
virtual std::unique_ptr< CorrectionCandidateCallback > | clone ()=0 |
Clone this CorrectionCandidateCallback. | |
void | setTypoName (const IdentifierInfo *II) |
void | setTypoNNS (NestedNameSpecifier *NNS) |
Additional Inherited Members | |
Public Attributes inherited from clang::CorrectionCandidateCallback | |
bool | WantTypeSpecifiers = true |
bool | WantExpressionKeywords = true |
bool | WantCXXNamedCasts = true |
bool | WantFunctionLikeCasts = true |
bool | WantRemainingKeywords = true |
bool | WantObjCSuper = false |
bool | IsObjCIvarLookup = false |
bool | IsAddressOfOperand = false |
Static Public Attributes inherited from clang::CorrectionCandidateCallback | |
static const unsigned | InvalidDistance = TypoCorrection::InvalidDistance |
Protected Member Functions inherited from clang::CorrectionCandidateCallback | |
bool | MatchesTypo (const TypoCorrection &candidate) |
Protected Attributes inherited from clang::CorrectionCandidateCallback | |
const IdentifierInfo * | Typo |
NestedNameSpecifier * | TypoNNS |
Definition at line 383 of file TypoCorrection.h.
FunctionCallFilterCCC::FunctionCallFilterCCC | ( | Sema & | SemaRef, |
unsigned | NumArgs, | ||
bool | HasExplicitTemplateArgs, | ||
MemberExpr * | ME = nullptr |
||
) |
Definition at line 5448 of file SemaLookup.cpp.
References clang::Sema::getLangOpts(), clang::CorrectionCandidateCallback::WantCXXNamedCasts, clang::CorrectionCandidateCallback::WantFunctionLikeCasts, clang::CorrectionCandidateCallback::WantRemainingKeywords, and clang::CorrectionCandidateCallback::WantTypeSpecifiers.
|
inlineoverridevirtual |
Clone this CorrectionCandidateCallback.
CorrectionCandidateCallbacks are initially stack-allocated. However in case where delayed typo-correction is done we need to move the callback to storage with a longer lifetime. Every class deriving from CorrectionCandidateCallback must implement this method.
Implements clang::CorrectionCandidateCallback.
Definition at line 390 of file TypoCorrection.h.
|
overridevirtual |
Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance.
This can be overridden by validators that only need to determine if a candidate is viable, without ranking potentially viable candidates. Only ValidateCandidate or RankCandidate need to be overridden by a callback wishing to check the viability of correction candidates. The default predicate always returns true if the candidate is not a type name or keyword, true for types if WantTypeSpecifiers is true, and true for keywords if WantTypeSpecifiers, WantExpressionKeywords, WantCXXNamedCasts, WantRemainingKeywords, or WantObjCSuper is true.
Reimplemented from clang::CorrectionCandidateCallback.
Definition at line 5460 of file SemaLookup.cpp.
References clang::C, clang::Type::getAs(), clang::getAsTypeTemplateDecl(), clang::TypoCorrection::getCorrectionDecl(), clang::ASTContext::getLangOpts(), clang::MemberExpr::getMemberDecl(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionDecl::getNumParams(), clang::DeclContext::getParent(), clang::DeclContext::getParentASTContext(), clang::Type::getPointeeType(), clang::Type::isAnyPointerType(), clang::CXXRecordDecl::isDerivedFrom(), clang::TypoCorrection::isKeyword(), clang::QualType::isNull(), and clang::Type::isReferenceType().