clang 20.0.0git
|
#include "clang/AST/FormatString.h"
Public Types | |
enum | Kind { UnknownTy , InvalidTy , 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 | isSizeT () const |
bool | isPtrdiffT () const |
MatchKind | matchesType (ASTContext &C, QualType argTy) 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 | 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. | |
Definition at line 265 of file FormatString.h.
Enumerator | |
---|---|
UnknownTy | |
InvalidTy | |
SpecificTy | |
ObjCPointerTy | |
CPointerTy | |
AnyCharTy | |
CStrTy | |
WCStrTy | |
WIntTy |
Definition at line 267 of file FormatString.h.
How well a given conversion specifier matches its argument.
Definition at line 271 of file FormatString.h.
|
inline |
Definition at line 306 of file FormatString.h.
|
inline |
Definition at line 307 of file FormatString.h.
References clang::T.
|
inline |
Definition at line 308 of file FormatString.h.
References clang::T.
QualType ArgType::getRepresentativeType | ( | ASTContext & | C | ) | const |
Definition at line 612 of file FormatString.cpp.
References AnyCharTy, clang::C, CPointerTy, CStrTy, InvalidTy, ObjCPointerTy, SpecificTy, UnknownTy, WCStrTy, and WIntTy.
Referenced by getRepresentativeTypeName().
std::string ArgType::getRepresentativeTypeName | ( | ASTContext & | C | ) | const |
Definition at line 648 of file FormatString.cpp.
References clang::C, clang::QualType::getAsString(), and getRepresentativeType().
|
inlinestatic |
Definition at line 310 of file FormatString.h.
References InvalidTy.
Referenced by clang::analyze_scanf::ScanfSpecifier::getArgType(), clang::analyze_printf::PrintfSpecifier::getArgType(), and makeVectorType().
|
inline |
Definition at line 315 of file FormatString.h.
|
inline |
Definition at line 313 of file FormatString.h.
|
inline |
Definition at line 311 of file FormatString.h.
References InvalidTy.
Referenced by clang::analyze_printf::PrintfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::fixType(), and clang::analyze_printf::PrintfSpecifier::getArgType().
|
inlinestatic |
Create an ArgType which corresponds to the ptrdiff_t/unsigned ptrdiff_t type.
Definition at line 334 of file FormatString.h.
Create an ArgType which corresponds to the size_t/ssize_t type.
Definition at line 326 of file FormatString.h.
ArgType ArgType::makeVectorType | ( | ASTContext & | C, |
unsigned | NumElts | ||
) | const |
Definition at line 603 of file FormatString.cpp.
References clang::C, Invalid(), and clang::QualType::isNull().
Referenced by clang::analyze_printf::PrintfSpecifier::getArgType().
clang::analyze_format_string::ArgType::MatchKind ArgType::matchesType | ( | ASTContext & | C, |
QualType | argTy | ||
) | const |
Definition at line 324 of file FormatString.cpp.
References AnyCharTy, clang::C, clang::Type::canDecayToPointerType(), CPointerTy, CStrTy, clang::Type::getAs(), clang::Type::getAsStructureType(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::Type::hasSignedIntegerRepresentation(), InvalidTy, clang::Type::isBlockPointerType(), clang::QualType::isConstQualified(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isSaturatedFixedPointType(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), Match, MatchPromotion, NoMatch, NoMatchPedantic, NoMatchPromotionTypeConfusion, NoMatchSignedness, NoMatchTypeConfusion, ObjCPointerTy, SpecificTy, UnknownTy, 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 318 of file FormatString.h.
References InvalidTy.
Referenced by clang::analyze_scanf::ScanfSpecifier::getArgType().