clang API Documentation
#include <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 | setFieldWidth (const OptionalAmount &Amt) |
bool | usesPositionalArg () const |
bool | hasValidLengthModifier (const TargetInfo &Target) const |
bool | hasStandardLengthModifier () const |
Optional< LengthModifier > | getCorrectedLengthModifier () const |
bool | hasStandardConversionSpecifier (const LangOptions &LangOpt) const |
bool | hasStandardLengthConversionCombination () const |
Static Public Member Functions | |
static bool | namedTypeToLengthModifier (QualType QT, LengthModifier &LM) |
Protected Attributes | |
LengthModifier | LM |
OptionalAmount | FieldWidth |
ConversionSpecifier | CS |
bool | UsesPositionalArg |
unsigned | argIndex |
Definition at line 325 of file FormatString.h.
clang::analyze_format_string::FormatSpecifier::FormatSpecifier | ( | bool | isPrintf | ) | [inline] |
Definition at line 336 of file FormatString.h.
unsigned clang::analyze_format_string::FormatSpecifier::getArgIndex | ( | ) | const [inline] |
Definition at line 349 of file FormatString.h.
References argIndex.
Optional< LengthModifier > FormatSpecifier::getCorrectedLengthModifier | ( | ) | const |
Definition at line 837 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().
const OptionalAmount& clang::analyze_format_string::FormatSpecifier::getFieldWidth | ( | ) | const [inline] |
Definition at line 361 of file FormatString.h.
References FieldWidth.
const LengthModifier& clang::analyze_format_string::FormatSpecifier::getLengthModifier | ( | ) | const [inline] |
Definition at line 357 of file FormatString.h.
References LM.
unsigned clang::analyze_format_string::FormatSpecifier::getPositionalArgIndex | ( | ) | const [inline] |
Definition at line 353 of file FormatString.h.
References argIndex.
bool FormatSpecifier::hasStandardConversionSpecifier | ( | const LangOptions & | LangOpt | ) | const |
Definition at line 782 of file FormatString.cpp.
References clang::analyze_format_string::ConversionSpecifier::aArg, clang::analyze_format_string::ConversionSpecifier::AArg, 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::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::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::PercentArg, clang::analyze_format_string::ConversionSpecifier::PrintErrno, 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.
Definition at line 820 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.
Definition at line 758 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::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 |
Definition at line 612 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::AsSizeT, clang::analyze_format_string::LengthModifier::AsWide, 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::gArg, clang::analyze_format_string::ConversionSpecifier::GArg, clang::analyze_format_string::LengthModifier::getKind(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::TargetInfo::getTriple(), clang::analyze_format_string::ConversionSpecifier::iArg, 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, clang::analyze_format_string::ConversionSpecifier::xArg, clang::analyze_format_string::ConversionSpecifier::XArg, and clang::analyze_format_string::ConversionSpecifier::ZArg.
bool FormatSpecifier::namedTypeToLengthModifier | ( | QualType | QT, |
LengthModifier & | LM | ||
) | [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 850 of file FormatString.cpp.
References clang::analyze_format_string::LengthModifier::AsIntMax, clang::analyze_format_string::LengthModifier::AsPtrDiff, clang::analyze_format_string::LengthModifier::AsSizeT, clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::TypedefNameDecl::getUnderlyingType(), and clang::analyze_format_string::LengthModifier::setKind().
void clang::analyze_format_string::FormatSpecifier::setArgIndex | ( | unsigned | i | ) | [inline] |
Definition at line 345 of file FormatString.h.
References argIndex.
Referenced by clang::analyze_format_string::ParseArgPosition().
void clang::analyze_format_string::FormatSpecifier::setFieldWidth | ( | const OptionalAmount & | Amt | ) | [inline] |
Definition at line 365 of file FormatString.h.
References FieldWidth.
Referenced by clang::analyze_format_string::ParseFieldWidth().
void clang::analyze_format_string::FormatSpecifier::setLengthModifier | ( | LengthModifier | lm | ) | [inline] |
Definition at line 339 of file FormatString.h.
References LM.
Referenced by clang::analyze_format_string::ParseLengthModifier().
void clang::analyze_format_string::FormatSpecifier::setUsesPositionalArg | ( | ) | [inline] |
Reimplemented in clang::analyze_printf::PrintfSpecifier.
Definition at line 343 of file FormatString.h.
References UsesPositionalArg.
Referenced by clang::analyze_format_string::ParseArgPosition().
bool clang::analyze_format_string::FormatSpecifier::usesPositionalArg | ( | ) | const [inline] |
Reimplemented in clang::analyze_printf::PrintfSpecifier.
Definition at line 369 of file FormatString.h.
References UsesPositionalArg.
Definition at line 334 of file FormatString.h.
Referenced by getArgIndex(), getPositionalArgIndex(), and setArgIndex().
Definition at line 329 of file FormatString.h.
Referenced by clang::analyze_scanf::ScanfSpecifier::consumesDataArgument(), clang::analyze_printf::PrintfSpecifier::getConversionSpecifier(), clang::analyze_scanf::ScanfSpecifier::getConversionSpecifier(), getCorrectedLengthModifier(), hasStandardConversionSpecifier(), hasStandardLengthConversionCombination(), hasValidLengthModifier(), clang::analyze_printf::PrintfSpecifier::setConversionSpecifier(), and clang::analyze_scanf::ScanfSpecifier::setConversionSpecifier().
Definition at line 328 of file FormatString.h.
Referenced by getFieldWidth(), and setFieldWidth().
Definition at line 327 of file FormatString.h.
Referenced by getCorrectedLengthModifier(), getLengthModifier(), hasStandardLengthConversionCombination(), hasStandardLengthModifier(), hasValidLengthModifier(), and setLengthModifier().
Positional arguments, an IEEE extension: IEEE Std 1003.1, 2004 Edition http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
Definition at line 333 of file FormatString.h.
Referenced by setUsesPositionalArg(), clang::analyze_printf::PrintfSpecifier::setUsesPositionalArg(), usesPositionalArg(), and clang::analyze_printf::PrintfSpecifier::usesPositionalArg().