clang 20.0.0git
|
#include "clang/AST/FormatString.h"
Public Member Functions | |
FormatSpecifier (bool isPrintf) | |
void | setLengthModifier (LengthModifier lm) |
void | setUsesPositionalArg () |
void | setArgIndex (unsigned i) |
unsigned | getArgIndex () const |
unsigned | getPositionalArgIndex () const |
const LengthModifier & | getLengthModifier () const |
const OptionalAmount & | getFieldWidth () const |
void | setVectorNumElts (const OptionalAmount &Amt) |
const OptionalAmount & | getVectorNumElts () const |
void | setFieldWidth (const OptionalAmount &Amt) |
bool | usesPositionalArg () const |
bool | hasValidLengthModifier (const TargetInfo &Target, const LangOptions &LO) const |
bool | hasStandardLengthModifier () const |
std::optional< LengthModifier > | getCorrectedLengthModifier () const |
bool | hasStandardConversionSpecifier (const LangOptions &LangOpt) const |
bool | hasStandardLengthConversionCombination () const |
Static Public Member Functions | |
static bool | namedTypeToLengthModifier (QualType QT, LengthModifier &LM) |
For a TypedefType QT, if it is a named integer type such as size_t, assign the appropriate value to LM and return true. | |
Protected Attributes | |
LengthModifier | LM |
OptionalAmount | FieldWidth |
ConversionSpecifier | CS |
OptionalAmount | VectorNumElts |
bool | UsesPositionalArg |
Positional arguments, an IEEE extension: IEEE Std 1003.1, 2004 Edition http://www.opengroup.org/onlinepubs/009695399/functions/printf.html. | |
unsigned | argIndex |
Definition at line 421 of file FormatString.h.
|
inline |
Definition at line 434 of file FormatString.h.
|
inline |
Definition at line 448 of file FormatString.h.
References argIndex.
std::optional< LengthModifier > FormatSpecifier::getCorrectedLengthModifier | ( | ) | const |
Definition at line 1097 of file FormatString.cpp.
References clang::analyze_format_string::LengthModifier::AsLongDouble, clang::analyze_format_string::LengthModifier::AsLongLong, clang::analyze_format_string::LengthModifier::AsQuad, CS, clang::analyze_format_string::LengthModifier::getKind(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::analyze_format_string::ConversionSpecifier::isAnyIntArg(), LM, clang::analyze_format_string::ConversionSpecifier::nArg, and clang::analyze_format_string::LengthModifier::setKind().
|
inline |
Definition at line 460 of file FormatString.h.
References FieldWidth.
|
inline |
Definition at line 456 of file FormatString.h.
References LM.
|
inline |
Definition at line 452 of file FormatString.h.
References argIndex.
Referenced by clang::analyze_printf::PrintfSpecifier::toString(), and clang::analyze_scanf::ScanfSpecifier::toString().
|
inline |
Definition at line 468 of file FormatString.h.
References VectorNumElts.
bool FormatSpecifier::hasStandardConversionSpecifier | ( | const LangOptions & | LangOpt | ) | const |
Definition at line 1028 of file FormatString.cpp.
References clang::analyze_format_string::ConversionSpecifier::aArg, clang::analyze_format_string::ConversionSpecifier::AArg, clang::analyze_format_string::ConversionSpecifier::bArg, clang::analyze_format_string::ConversionSpecifier::BArg, clang::analyze_format_string::ConversionSpecifier::cArg, clang::analyze_format_string::ConversionSpecifier::CArg, CS, clang::analyze_format_string::ConversionSpecifier::dArg, clang::analyze_format_string::ConversionSpecifier::DArg, clang::analyze_format_string::ConversionSpecifier::eArg, clang::analyze_format_string::ConversionSpecifier::EArg, clang::analyze_format_string::ConversionSpecifier::fArg, clang::analyze_format_string::ConversionSpecifier::FArg, clang::analyze_format_string::ConversionSpecifier::FreeBSDbArg, clang::analyze_format_string::ConversionSpecifier::FreeBSDDArg, clang::analyze_format_string::ConversionSpecifier::FreeBSDrArg, clang::analyze_format_string::ConversionSpecifier::FreeBSDyArg, clang::analyze_format_string::ConversionSpecifier::gArg, clang::analyze_format_string::ConversionSpecifier::GArg, clang::analyze_format_string::ConversionSpecifier::getKind(), clang::analyze_format_string::ConversionSpecifier::iArg, clang::analyze_format_string::ConversionSpecifier::InvalidSpecifier, clang::analyze_format_string::ConversionSpecifier::kArg, clang::analyze_format_string::ConversionSpecifier::KArg, clang::analyze_format_string::ConversionSpecifier::nArg, clang::analyze_format_string::ConversionSpecifier::oArg, clang::analyze_format_string::ConversionSpecifier::OArg, clang::analyze_format_string::ConversionSpecifier::ObjCObjArg, clang::analyze_format_string::ConversionSpecifier::pArg, clang::analyze_format_string::ConversionSpecifier::PArg, clang::analyze_format_string::ConversionSpecifier::PercentArg, clang::analyze_format_string::ConversionSpecifier::PrintErrno, clang::analyze_format_string::ConversionSpecifier::rArg, clang::analyze_format_string::ConversionSpecifier::RArg, clang::analyze_format_string::ConversionSpecifier::sArg, clang::analyze_format_string::ConversionSpecifier::SArg, clang::analyze_format_string::ConversionSpecifier::ScanListArg, clang::analyze_format_string::ConversionSpecifier::uArg, clang::analyze_format_string::ConversionSpecifier::UArg, clang::analyze_format_string::ConversionSpecifier::xArg, clang::analyze_format_string::ConversionSpecifier::XArg, and clang::analyze_format_string::ConversionSpecifier::ZArg.
bool FormatSpecifier::hasStandardLengthConversionCombination | ( | ) | const |
Definition at line 1079 of file FormatString.cpp.
References clang::analyze_format_string::LengthModifier::AsLongDouble, CS, clang::analyze_format_string::ConversionSpecifier::dArg, clang::analyze_format_string::LengthModifier::getKind(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::analyze_format_string::ConversionSpecifier::iArg, LM, clang::analyze_format_string::ConversionSpecifier::oArg, clang::analyze_format_string::ConversionSpecifier::uArg, clang::analyze_format_string::ConversionSpecifier::xArg, and clang::analyze_format_string::ConversionSpecifier::XArg.
bool FormatSpecifier::hasStandardLengthModifier | ( | ) | const |
Definition at line 1003 of file FormatString.cpp.
References clang::analyze_format_string::LengthModifier::AsAllocate, clang::analyze_format_string::LengthModifier::AsChar, clang::analyze_format_string::LengthModifier::AsInt32, clang::analyze_format_string::LengthModifier::AsInt3264, clang::analyze_format_string::LengthModifier::AsInt64, clang::analyze_format_string::LengthModifier::AsIntMax, clang::analyze_format_string::LengthModifier::AsLong, clang::analyze_format_string::LengthModifier::AsLongDouble, clang::analyze_format_string::LengthModifier::AsLongLong, clang::analyze_format_string::LengthModifier::AsMAllocate, clang::analyze_format_string::LengthModifier::AsPtrDiff, clang::analyze_format_string::LengthModifier::AsQuad, clang::analyze_format_string::LengthModifier::AsShort, clang::analyze_format_string::LengthModifier::AsShortLong, clang::analyze_format_string::LengthModifier::AsSizeT, clang::analyze_format_string::LengthModifier::AsWide, clang::analyze_format_string::LengthModifier::getKind(), LM, and clang::analyze_format_string::LengthModifier::None.
bool FormatSpecifier::hasValidLengthModifier | ( | const TargetInfo & | Target, |
const LangOptions & | LO | ||
) | const |
Definition at line 834 of file FormatString.cpp.
References clang::analyze_format_string::ConversionSpecifier::aArg, clang::analyze_format_string::ConversionSpecifier::AArg, clang::analyze_format_string::LengthModifier::AsAllocate, clang::analyze_format_string::LengthModifier::AsChar, clang::analyze_format_string::LengthModifier::AsInt32, clang::analyze_format_string::LengthModifier::AsInt3264, clang::analyze_format_string::LengthModifier::AsInt64, clang::analyze_format_string::LengthModifier::AsIntMax, clang::analyze_format_string::LengthModifier::AsLong, clang::analyze_format_string::LengthModifier::AsLongDouble, clang::analyze_format_string::LengthModifier::AsLongLong, clang::analyze_format_string::LengthModifier::AsMAllocate, clang::analyze_format_string::LengthModifier::AsPtrDiff, clang::analyze_format_string::LengthModifier::AsQuad, clang::analyze_format_string::LengthModifier::AsShort, clang::analyze_format_string::LengthModifier::AsShortLong, clang::analyze_format_string::LengthModifier::AsSizeT, clang::analyze_format_string::LengthModifier::AsWide, clang::analyze_format_string::ConversionSpecifier::bArg, clang::analyze_format_string::ConversionSpecifier::BArg, clang::analyze_format_string::ConversionSpecifier::cArg, clang::analyze_format_string::ConversionSpecifier::CArg, CS, clang::analyze_format_string::ConversionSpecifier::dArg, clang::analyze_format_string::ConversionSpecifier::DArg, clang::analyze_format_string::ConversionSpecifier::eArg, clang::analyze_format_string::ConversionSpecifier::EArg, clang::analyze_format_string::ConversionSpecifier::fArg, clang::analyze_format_string::ConversionSpecifier::FArg, clang::analyze_format_string::ConversionSpecifier::FreeBSDrArg, clang::analyze_format_string::ConversionSpecifier::FreeBSDyArg, clang::analyze_format_string::ConversionSpecifier::gArg, clang::analyze_format_string::ConversionSpecifier::GArg, clang::analyze_format_string::LengthModifier::getKind(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::analyze_format_string::ConversionSpecifier::iArg, clang::analyze_format_string::ConversionSpecifier::isDoubleArg(), clang::analyze_format_string::ConversionSpecifier::isFixedPointArg(), clang::analyze_format_string::OptionalAmount::isInvalid(), LM, clang::analyze_format_string::ConversionSpecifier::nArg, clang::analyze_format_string::LengthModifier::None, clang::analyze_format_string::ConversionSpecifier::oArg, clang::analyze_format_string::ConversionSpecifier::OArg, clang::analyze_format_string::ConversionSpecifier::sArg, clang::analyze_format_string::ConversionSpecifier::SArg, clang::analyze_format_string::ConversionSpecifier::ScanListArg, clang::analyze_format_string::ConversionSpecifier::uArg, clang::analyze_format_string::ConversionSpecifier::UArg, VectorNumElts, clang::analyze_format_string::ConversionSpecifier::xArg, clang::analyze_format_string::ConversionSpecifier::XArg, and clang::analyze_format_string::ConversionSpecifier::ZArg.
Referenced by clang::analyze_printf::PrintfSpecifier::fixType(), and clang::analyze_scanf::ScanfSpecifier::fixType().
|
static |
For a TypedefType QT, if it is a named integer type such as size_t, assign the appropriate value to LM and return true.
Definition at line 1110 of file FormatString.cpp.
References clang::analyze_format_string::LengthModifier::AsIntMax, clang::analyze_format_string::LengthModifier::AsPtrDiff, clang::analyze_format_string::LengthModifier::AsSizeT, clang::Type::getAs(), clang::NamedDecl::getIdentifier(), Identifier, LM, and clang::analyze_format_string::LengthModifier::setKind().
Referenced by clang::analyze_printf::PrintfSpecifier::fixType(), and clang::analyze_scanf::ScanfSpecifier::fixType().
|
inline |
Definition at line 444 of file FormatString.h.
References argIndex.
|
inline |
Definition at line 472 of file FormatString.h.
References FieldWidth.
Referenced by clang::analyze_format_string::ParseFieldWidth().
|
inline |
Definition at line 438 of file FormatString.h.
References LM.
|
inline |
Definition at line 442 of file FormatString.h.
References UsesPositionalArg.
|
inline |
Definition at line 464 of file FormatString.h.
References VectorNumElts.
|
inline |
Definition at line 476 of file FormatString.h.
References UsesPositionalArg.
Referenced by clang::analyze_scanf::ScanfSpecifier::toString().
|
protected |
Definition at line 432 of file FormatString.h.
Referenced by getArgIndex(), getPositionalArgIndex(), and setArgIndex().
|
protected |
Definition at line 425 of file FormatString.h.
Referenced by clang::analyze_scanf::ScanfSpecifier::consumesDataArgument(), clang::analyze_printf::PrintfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::getArgType(), clang::analyze_printf::PrintfSpecifier::getArgType(), clang::analyze_printf::PrintfSpecifier::getConversionSpecifier(), clang::analyze_scanf::ScanfSpecifier::getConversionSpecifier(), getCorrectedLengthModifier(), hasStandardConversionSpecifier(), hasStandardLengthConversionCombination(), clang::analyze_printf::PrintfSpecifier::hasValidAlternativeForm(), clang::analyze_printf::PrintfSpecifier::hasValidFieldWidth(), clang::analyze_printf::PrintfSpecifier::hasValidLeadingZeros(), clang::analyze_printf::PrintfSpecifier::hasValidLeftJustified(), hasValidLengthModifier(), clang::analyze_printf::PrintfSpecifier::hasValidPlusPrefix(), clang::analyze_printf::PrintfSpecifier::hasValidPrecision(), clang::analyze_printf::PrintfSpecifier::hasValidSpacePrefix(), clang::analyze_printf::PrintfSpecifier::hasValidThousandsGroupingPrefix(), clang::analyze_printf::PrintfSpecifier::setConversionSpecifier(), clang::analyze_scanf::ScanfSpecifier::setConversionSpecifier(), clang::analyze_printf::PrintfSpecifier::toString(), and clang::analyze_scanf::ScanfSpecifier::toString().
|
protected |
Definition at line 424 of file FormatString.h.
Referenced by clang::analyze_scanf::ScanfSpecifier::fixType(), getFieldWidth(), clang::analyze_printf::PrintfSpecifier::hasValidFieldWidth(), setFieldWidth(), clang::analyze_printf::PrintfSpecifier::toString(), and clang::analyze_scanf::ScanfSpecifier::toString().
|
protected |
Definition at line 423 of file FormatString.h.
Referenced by clang::analyze_printf::PrintfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::getArgType(), getCorrectedLengthModifier(), getLengthModifier(), hasStandardLengthConversionCombination(), hasStandardLengthModifier(), hasValidLengthModifier(), namedTypeToLengthModifier(), setLengthModifier(), clang::analyze_printf::PrintfSpecifier::toString(), and clang::analyze_scanf::ScanfSpecifier::toString().
|
protected |
Positional arguments, an IEEE extension: IEEE Std 1003.1, 2004 Edition http://www.opengroup.org/onlinepubs/009695399/functions/printf.html.
Definition at line 431 of file FormatString.h.
Referenced by setUsesPositionalArg(), clang::analyze_printf::PrintfSpecifier::setUsesPositionalArg(), usesPositionalArg(), and clang::analyze_printf::PrintfSpecifier::usesPositionalArg().
|
protected |
Definition at line 426 of file FormatString.h.
Referenced by clang::analyze_printf::PrintfSpecifier::fixType(), clang::analyze_printf::PrintfSpecifier::getArgType(), getVectorNumElts(), hasValidLengthModifier(), setVectorNumElts(), and clang::analyze_printf::PrintfSpecifier::toString().