clang
10.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, NoMatchPedantic, 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. More... | |
static ArgType | makeSizeT (const ArgType &A) |
Create an ArgType which corresponds to the size_t/ssize_t type. More... | |
static ArgType | makePtrdiffT (const ArgType &A) |
Create an ArgType which corresponds to the ptrdiff_t/unsigned ptrdiff_t type. More... | |
Definition at line 249 of file FormatString.h.
Enumerator | |
---|---|
UnknownTy | |
InvalidTy | |
SpecificTy | |
ObjCPointerTy | |
CPointerTy | |
AnyCharTy | |
CStrTy | |
WCStrTy | |
WIntTy |
Definition at line 251 of file FormatString.h.
How well a given conversion specifier matches its argument.
Definition at line 255 of file FormatString.h.
|
inline |
Definition at line 282 of file FormatString.h.
|
inline |
Definition at line 283 of file FormatString.h.
|
inline |
Definition at line 284 of file FormatString.h.
QualType ArgType::getRepresentativeType | ( | ASTContext & | C | ) | const |
Definition at line 505 of file FormatString.cpp.
References clang::ASTContext::CharTy, clang::ASTContext::getPointerType(), clang::ASTContext::getWideCharType(), clang::ASTContext::getWIntType(), clang::ASTContext::ObjCBuiltinIdTy, and clang::ASTContext::VoidPtrTy.
std::string ArgType::getRepresentativeTypeName | ( | ASTContext & | C | ) | const |
Definition at line 541 of file FormatString.cpp.
|
inlinestatic |
Definition at line 286 of file FormatString.h.
Referenced by clang::analyze_printf::PrintfSpecifier::getArgType(), clang::analyze_scanf::ScanfSpecifier::getArgType(), and clang::analyze_format_string::parseFormatStringHasFormattingSpecifiers().
|
inline |
Definition at line 291 of file FormatString.h.
|
inline |
Definition at line 289 of file FormatString.h.
|
inline |
Definition at line 287 of file FormatString.h.
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 310 of file FormatString.h.
Referenced by clang::analyze_format_string::parseFormatStringHasFormattingSpecifiers().
Create an ArgType which corresponds to the size_t/ssize_t type.
Definition at line 302 of file FormatString.h.
Referenced by clang::analyze_format_string::parseFormatStringHasFormattingSpecifiers().
ArgType ArgType::makeVectorType | ( | ASTContext & | C, |
unsigned | NumElts | ||
) | const |
Definition at line 496 of file FormatString.cpp.
References clang::ASTContext::getExtVectorType().
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 clang::Type::getAs(), clang::Type::getAsStructureType(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getCorrespondingUnsignedType(), clang::Type::getPointeeType(), clang::PointerType::getPointeeType(), clang::ASTContext::getPromotedIntegerType(), clang::CanQual< T >::getUnqualifiedType(), clang::ASTContext::getWideCharType(), clang::ASTContext::getWIntType(), clang::Type::hasSignedIntegerRepresentation(), clang::ASTContext::IntTy, clang::Type::isBlockPointerType(), clang::QualType::isConstQualified(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isPromotableIntegerType(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, and clang::ASTContext::UnsignedShortTy.
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 294 of file FormatString.h.
Referenced by clang::analyze_scanf::ScanfSpecifier::getArgType(), and clang::analyze_format_string::parseFormatStringHasFormattingSpecifiers().