clang: clang::ConversionFixItGenerator Struct Reference (original) (raw)
The class facilities generation and storage of conversion FixIts. More...
#include "[clang/Sema/SemaFixItUtils.h](SemaFixItUtils%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
ConversionFixItGenerator (TypeComparisonFuncTy Foo) | |
ConversionFixItGenerator () | |
void | setConversionChecker (TypeComparisonFuncTy Foo) |
Resets the default conversion checker method. | |
bool | tryToFixConversion (const Expr *FromExpr, const QualType FromQTy, const QualType ToQTy, Sema &S) |
If possible, generates and stores a fix for the given conversion. | |
void | clear () |
bool | isNull () |
Public Attributes | |
---|---|
std::vector< FixItHint > | Hints |
The list of Hints generated so far. | |
unsigned | NumConversionsFixed |
The number of Conversions fixed. | |
OverloadFixItKind | Kind |
The type of fix applied. | |
TypeComparisonFuncTy | CompareTypes |
The type comparison function used to decide if expression FromExpr of type FromTy can be converted to ToTy. | |
The class facilities generation and storage of conversion FixIts.
Hints for new conversions are added using TryToFixConversion method. The default type conversion checker can be reset.
Definition at line 32 of file SemaFixItUtils.h.
◆ TypeComparisonFuncTy
◆ ConversionFixItGenerator() [2/2]
clang::ConversionFixItGenerator::ConversionFixItGenerator ( ) | inline |
---|
◆ clear()
void clang::ConversionFixItGenerator::clear ( ) | inline |
---|
◆ compareTypesSimple()
◆ isNull()
bool clang::ConversionFixItGenerator::isNull ( ) | inline |
---|
◆ setConversionChecker()
◆ tryToFixConversion()
If possible, generates and stores a fix for the given conversion.
Definition at line 50 of file SemaFixItUtils.cpp.
References Begin, CompareTypes, clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::SourceRange::getBegin(), clang::ASTContext::getCanonicalType(), clang::SourceRange::getEnd(), clang::Sema::getLocForEndOfToken(), clang::Expr::getObjectKind(), clang::ASTContext::getPointerType(), clang::Stmt::getSourceRange(), clang::CharSourceRange::getTokenRange(), Hints, clang::Expr::IgnoreImpCasts(), clang::Expr::IgnoreParenCasts(), clang::Expr::isLValue(), Kind, clang::Expr::NPC_ValueDependentIsNotNull, NumConversionsFixed, clang::OFIK_Dereference, clang::OFIK_RemoveDereference, clang::OFIK_RemoveTakeAddress, clang::OFIK_TakeAddress, clang::OK_Ordinary, clang::VK_LValue, and clang::VK_PRValue.
Referenced by clang::Sema::DiagnoseAssignmentResult(), and clang::OverloadCandidate::TryToFixBadConversion().
◆ CompareTypes
The type comparison function used to decide if expression FromExpr of type FromTy can be converted to ToTy.
For example, one could check if an implicit conversion exists. Returns true if comparison exists.
Definition at line 59 of file SemaFixItUtils.h.
Referenced by setConversionChecker(), and tryToFixConversion().
◆ Hints
std::vector<FixItHint> clang::ConversionFixItGenerator::Hints
◆ Kind
◆ NumConversionsFixed
unsigned clang::ConversionFixItGenerator::NumConversionsFixed
The documentation for this struct was generated from the following files:
- include/clang/Sema/SemaFixItUtils.h
- lib/Sema/SemaFixItUtils.cpp