|
clang 23.0.0git
|
#include "clang/AST/FormatString.h"
Public Types | |
| enum | Kind { UnknownTy , InvalidTy , UnsupportedTy , SpecificTy , ObjCPointerTy , CPointerTy , AnyCharTy , CStrTy , WCStrTy , WIntTy } |
| enum | MatchKind { NoMatch = 0 , Match = 1 , MatchPromotion , NoMatchPromotionTypeConfusion , NoMatchPedantic , NoMatchSignedness , NoMatchTypeConfusion } |
| How well a given conversion specifier matches its argument. More... | |
Public Member Functions | |
| ArgType (Kind K=UnknownTy, const char *N=nullptr) | |
| ArgType (QualType T, const char *N=nullptr) | |
| ArgType (CanQualType T) | |
| bool | isValid () const |
| bool | isUnsupported () const |
| bool | isSizeT () const |
| bool | isPtrdiffT () const |
| MatchKind | matchesType (ASTContext &C, QualType argTy) const |
| MatchKind | matchesArgType (ASTContext &C, const ArgType &other) const |
| QualType | getRepresentativeType (ASTContext &C) const |
| ArgType | makeVectorType (ASTContext &C, unsigned NumElts) const |
| std::string | getRepresentativeTypeName (ASTContext &C) const |
Static Public Member Functions | |
| static ArgType | Invalid () |
| static ArgType | Unsupported (const char *N) |
| static ArgType | PtrTo (const ArgType &A) |
| Create an ArgType which corresponds to the type pointer to A. | |
| static ArgType | makeSizeT (const ArgType &A) |
| Create an ArgType which corresponds to the size_t/ssize_t type. | |
| static ArgType | makePtrdiffT (const ArgType &A) |
| Create an ArgType which corresponds to the ptrdiff_t/unsigned ptrdiff_t type. | |
| static ArgType | makeIntNType (ASTContext &Ctx, const LengthModifier &LengthMod, bool Signed) |
Definition at line 278 of file FormatString.h.
| Enumerator | |
|---|---|
| UnknownTy | |
| InvalidTy | |
| UnsupportedTy | |
| SpecificTy | |
| ObjCPointerTy | |
| CPointerTy | |
| AnyCharTy | |
| CStrTy | |
| WCStrTy | |
| WIntTy | |
Definition at line 280 of file FormatString.h.
How well a given conversion specifier matches its argument.
Definition at line 294 of file FormatString.h.
|
inline |
Definition at line 337 of file FormatString.h.
References UnknownTy.
Referenced by Invalid(), makeIntNType(), makePtrdiffT(), makeSizeT(), makeVectorType(), matchesArgType(), PtrTo(), and Unsupported().
Definition at line 338 of file FormatString.h.
References SpecificTy.
|
inline |
Definition at line 339 of file FormatString.h.
References SpecificTy.
| QualType ArgType::getRepresentativeType | ( | ASTContext & | C | ) | const |
Definition at line 852 of file FormatString.cpp.
References AnyCharTy, clang::C, CPointerTy, CStrTy, clang::Type::getCanonicalTypeInternal(), InvalidTy, ObjCPointerTy, SpecificTy, UnknownTy, UnsupportedTy, WCStrTy, and WIntTy.
Referenced by getRepresentativeTypeName().
| std::string ArgType::getRepresentativeTypeName | ( | ASTContext & | C | ) | const |
Definition at line 894 of file FormatString.cpp.
References clang::C, clang::QualType::getAsString(), getRepresentativeType(), and UnsupportedTy.
|
inlinestatic |
Definition at line 341 of file FormatString.h.
References ArgType(), and InvalidTy.
Referenced by makeIntNType(), and makeVectorType().
|
inline |
Definition at line 352 of file FormatString.h.
|
inline |
Definition at line 350 of file FormatString.h.
|
inline |
Definition at line 348 of file FormatString.h.
References UnsupportedTy.
|
inline |
Definition at line 347 of file FormatString.h.
References InvalidTy.
Referenced by clang::analyze_printf::PrintfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::fixType(), and clang::analyze_printf::PrintfSpecifier::getArgType().
|
static |
Definition at line 836 of file FormatString.cpp.
References ArgType(), clang::analyze_format_string::LengthModifier::AsFastIntN, clang::analyze_format_string::LengthModifier::getBitWidth(), clang::ASTContext::getIntTypeForBitwidth(), clang::analyze_format_string::LengthModifier::getKind(), clang::ASTContext::getLeastIntTypeForBitwidth(), Invalid(), clang::QualType::isNull(), and clang::Signed.
Create an ArgType which corresponds to the ptrdiff_t/unsigned ptrdiff_t type.
Definition at line 371 of file FormatString.h.
References ArgType().
Create an ArgType which corresponds to the size_t/ssize_t type.
Definition at line 363 of file FormatString.h.
References ArgType().
| ArgType ArgType::makeVectorType | ( | ASTContext & | C, |
| unsigned | NumElts ) const |
Definition at line 827 of file FormatString.cpp.
References ArgType(), clang::C, and Invalid().
Referenced by clang::analyze_printf::PrintfSpecifier::getArgType().
| analyze_format_string::ArgType::MatchKind ArgType::matchesArgType | ( | ASTContext & | C, |
| const ArgType & | other ) const |
Definition at line 745 of file FormatString.cpp.
References ArgType(), clang::C, clang::Type::getAs(), integerTypeMatch(), clang::BuiltinType::isInteger(), Match, matchesSizeTPtrdiffT(), NoMatch, and clang::Other.
| clang::analyze_format_string::ArgType::MatchKind ArgType::matchesType | ( | ASTContext & | C, |
| QualType | argTy ) const |
Definition at line 445 of file FormatString.cpp.
References AnyCharTy, clang::C, clang::Type::canDecayToPointerType(), CPointerTy, CStrTy, clang::Type::getAs(), clang::Type::getAsEnumDecl(), clang::PointerType::getPointeeType(), clang::Type::getPointeeType(), clang::Type::hasSignedIntegerRepresentation(), InvalidTy, clang::Type::isBlockPointerType(), clang::Type::isCharType(), clang::QualType::isConstQualified(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isSaturatedFixedPointType(), clang::Type::isStructureType(), clang::Type::isVoidType(), Match, matchesSizeTPtrdiffT(), MatchPromotion, NoMatch, NoMatchPedantic, NoMatchPromotionTypeConfusion, NoMatchSignedness, NoMatchTypeConfusion, ObjCPointerTy, SpecificTy, UnknownTy, UnsupportedTy, WCStrTy, and WIntTy.
Referenced by clang::analyze_printf::PrintfSpecifier::fixType(), and clang::analyze_scanf::ScanfSpecifier::fixType().
Create an ArgType which corresponds to the type pointer to A.
Definition at line 355 of file FormatString.h.
|
inlinestatic |
Definition at line 342 of file FormatString.h.
References ArgType(), and UnsupportedTy.