clang 20.0.0git
|
#include "clang/AST/FormatString.h"
Static Public Member Functions | |
static PrintfSpecifier | Parse (const char *beg, const char *end) |
Static Public Member Functions inherited from clang::analyze_format_string::FormatSpecifier | |
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. | |
Additional Inherited Members | |
Protected Attributes inherited from clang::analyze_format_string::FormatSpecifier | |
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 524 of file FormatString.h.
|
inline |
Definition at line 541 of file FormatString.h.
|
inline |
Definition at line 597 of file FormatString.h.
References clang::analyze_format_string::ConversionSpecifier::consumesDataArgument(), and getConversionSpecifier().
bool PrintfSpecifier::fixType | ( | QualType | QT, |
const LangOptions & | LangOpt, | ||
ASTContext & | Ctx, | ||
bool | IsObjCLiteral | ||
) |
Changes the specifier and length according to a QualType, retaining any flags or options.
Returns true on success, or false when a conversion was not successful.
Definition at line 747 of file PrintfFormatString.cpp.
References clang::analyze_format_string::LengthModifier::AsChar, clang::analyze_format_string::LengthModifier::AsLong, clang::analyze_format_string::LengthModifier::AsLongDouble, clang::analyze_format_string::LengthModifier::AsLongLong, clang::analyze_format_string::LengthModifier::AsShort, clang::analyze_format_string::LengthModifier::AsShortLong, clang::analyze_format_string::LengthModifier::AsWideChar, clang::analyze_format_string::FormatSpecifier::CS, clang::analyze_format_string::ConversionSpecifier::dArg, getArgType(), clang::Type::getAs(), clang::VectorType::getElementType(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::BuiltinType::getKind(), clang::VectorType::getNumElements(), clang::Type::getPointeeType(), clang::ASTContext::getTargetInfo(), clang::analyze_format_string::FormatSpecifier::hasValidLengthModifier(), clang::Type::isAnyCharacterType(), clang::Type::isCharType(), clang::analyze_format_string::OptionalAmount::isInvalid(), clang::Type::isObjCRetainableType(), clang::Type::isPointerType(), clang::Type::isRealFloatingType(), clang::Type::isSignedIntegerType(), clang::Type::isUnsignedIntegerType(), clang::analyze_format_string::ArgType::isValid(), clang::Type::isWideCharType(), clang::analyze_format_string::FormatSpecifier::LM, clang::analyze_format_string::ArgType::matchesType(), clang::analyze_format_string::FormatSpecifier::namedTypeToLengthModifier(), clang::analyze_format_string::LengthModifier::None, clang::analyze_format_string::OptionalAmount::NotSpecified, clang::analyze_format_string::OptionalAmount::setHowSpecified(), clang::analyze_format_string::LengthModifier::setKind(), clang::analyze_format_string::ConversionSpecifier::setKind(), clang::analyze_format_string::ConversionSpecifier::uArg, and clang::analyze_format_string::FormatSpecifier::VectorNumElts.
ArgType PrintfSpecifier::getArgType | ( | ASTContext & | Ctx, |
bool | IsObjCLiteral | ||
) | const |
Returns the builtin type that a data argument paired with this format specifier should have.
This method will return null if the format specifier does not have a matching data argument or the matching argument matches more than one type.
Definition at line 733 of file PrintfFormatString.cpp.
References clang::analyze_format_string::ConversionSpecifier::consumesDataArgument(), clang::analyze_format_string::FormatSpecifier::CS, clang::analyze_format_string::OptionalAmount::getConstantAmount(), getConversionSpecifier(), clang::analyze_format_string::ArgType::Invalid(), clang::analyze_format_string::OptionalAmount::isInvalid(), clang::analyze_format_string::ArgType::isValid(), clang::analyze_format_string::ArgType::makeVectorType(), and clang::analyze_format_string::FormatSpecifier::VectorNumElts.
Referenced by fixType().
|
inline |
Definition at line 584 of file FormatString.h.
References clang::analyze_format_string::FormatSpecifier::CS.
Referenced by consumesDataArgument(), and getArgType().
|
inline |
Definition at line 622 of file FormatString.h.
|
inline |
Definition at line 593 of file FormatString.h.
|
inline |
Definition at line 613 of file FormatString.h.
|
inline |
Definition at line 614 of file FormatString.h.
|
inline |
Definition at line 616 of file FormatString.h.
|
inline |
Definition at line 612 of file FormatString.h.
|
inline |
Definition at line 615 of file FormatString.h.
|
inline |
Definition at line 608 of file FormatString.h.
bool PrintfSpecifier::hasValidAlternativeForm | ( | ) | const |
Definition at line 1034 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, and clang::analyze_format_string::ConversionSpecifier::getKind().
bool PrintfSpecifier::hasValidFieldWidth | ( | ) | const |
Definition at line 1206 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, clang::analyze_format_string::FormatSpecifier::FieldWidth, clang::analyze_format_string::OptionalAmount::getHowSpecified(), clang::analyze_format_string::ConversionSpecifier::getKind(), and clang::analyze_format_string::OptionalAmount::NotSpecified.
bool PrintfSpecifier::hasValidLeadingZeros | ( | ) | const |
Definition at line 1067 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, and clang::analyze_format_string::ConversionSpecifier::getKind().
bool PrintfSpecifier::hasValidLeftJustified | ( | ) | const |
Definition at line 1133 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, and clang::analyze_format_string::ConversionSpecifier::getKind().
bool PrintfSpecifier::hasValidPlusPrefix | ( | ) | const |
Definition at line 1006 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, and clang::analyze_format_string::ConversionSpecifier::getKind().
bool PrintfSpecifier::hasValidPrecision | ( | ) | const |
Definition at line 1167 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, clang::analyze_format_string::OptionalAmount::getHowSpecified(), clang::analyze_format_string::ConversionSpecifier::getKind(), and clang::analyze_format_string::OptionalAmount::NotSpecified.
bool PrintfSpecifier::hasValidSpacePrefix | ( | ) | const |
Definition at line 1105 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, and clang::analyze_format_string::ConversionSpecifier::getKind().
bool PrintfSpecifier::hasValidThousandsGroupingPrefix | ( | ) | const |
Definition at line 1147 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, and clang::analyze_format_string::ConversionSpecifier::getKind().
|
inline |
Definition at line 611 of file FormatString.h.
|
inline |
Definition at line 617 of file FormatString.h.
|
inline |
Definition at line 618 of file FormatString.h.
|
inline |
Definition at line 619 of file FormatString.h.
|
static |
|
inline |
Definition at line 551 of file FormatString.h.
References clang::analyze_format_string::FormatSpecifier::CS.
|
inline |
Definition at line 566 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 569 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 572 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 560 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 563 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 554 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 557 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 575 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 576 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 577 of file FormatString.h.
References clang::analyze_format_string::OptionalFlag::setPosition().
|
inline |
Definition at line 623 of file FormatString.h.
|
inline |
Definition at line 588 of file FormatString.h.
References clang::analyze_format_string::OptionalAmount::setUsesDotPrefix().
|
inline |
Definition at line 580 of file FormatString.h.
References clang::analyze_format_string::FormatSpecifier::UsesPositionalArg.
void PrintfSpecifier::toString | ( | raw_ostream & | os | ) | const |
Definition at line 974 of file PrintfFormatString.cpp.
References clang::analyze_format_string::FormatSpecifier::CS, clang::analyze_format_string::FormatSpecifier::FieldWidth, clang::analyze_format_string::OptionalAmount::getConstantAmount(), clang::analyze_format_string::FormatSpecifier::getPositionalArgIndex(), clang::analyze_format_string::OptionalAmount::isInvalid(), clang::analyze_format_string::FormatSpecifier::LM, clang::analyze_format_string::LengthModifier::toString(), clang::analyze_format_string::ConversionSpecifier::toString(), clang::analyze_format_string::OptionalAmount::toString(), usesPositionalArg(), and clang::analyze_format_string::FormatSpecifier::VectorNumElts.
|
inline |
Definition at line 620 of file FormatString.h.
References clang::analyze_format_string::FormatSpecifier::UsesPositionalArg.
Referenced by toString().