clang 10.0.0git

Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
clang::analyze_format_string::FormatSpecifier Class Reference

`#include "clang/AST/FormatString.h"`

Inheritance diagram for clang::analyze_format_string::FormatSpecifier:
[legend]
Collaboration diagram for clang::analyze_format_string::FormatSpecifier:
[legend]

## 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
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. More...

## 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. More...
unsigned | argIndex

## Detailed Description

Definition at line 397 of file FormatString.h.

## Constructor & Destructor Documentation

## ◆ FormatSpecifier()

clang::analyze_format_string::FormatSpecifier::FormatSpecifier | ( | bool | isPrintf | ) |
| inline

Definition at line 410 of file FormatString.h.

## Member Function Documentation

## ◆ getArgIndex()

unsigned clang::analyze_format_string::FormatSpecifier::getArgIndex | ( |  | ) | const
| inline

Definition at line 424 of file FormatString.h.

## ◆ getCorrectedLengthModifier()

Optional< LengthModifier > FormatSpecifier::getCorrectedLengthModifier | ( |  | ) | const

Definition at line 965 of file FormatString.cpp.

References clang::analyze_format_string::LengthModifier::AsLongDouble, clang::analyze_format_string::LengthModifier::AsLongLong, clang::analyze_format_string::LengthModifier::AsQuad, clang::analyze_format_string::ConversionSpecifier::nArg, and clang::analyze_format_string::LengthModifier::setKind().

## ◆ getFieldWidth()

const OptionalAmount& clang::analyze_format_string::FormatSpecifier::getFieldWidth | ( |  | ) | const
| inline

Definition at line 436 of file FormatString.h.

## ◆ getLengthModifier()

const LengthModifier& clang::analyze_format_string::FormatSpecifier::getLengthModifier | ( |  | ) | const
| inline

Definition at line 432 of file FormatString.h.

## ◆ getPositionalArgIndex()

unsigned clang::analyze_format_string::FormatSpecifier::getPositionalArgIndex | ( |  | ) | const
| inline

Definition at line 428 of file FormatString.h.

## ◆ getVectorNumElts()

const OptionalAmount& clang::analyze_format_string::FormatSpecifier::getVectorNumElts | ( |  | ) | const
| inline

Definition at line 444 of file FormatString.h.

## ◆ hasStandardConversionSpecifier()

bool FormatSpecifier::hasStandardConversionSpecifier | ( | const LangOptions & | LangOpt | ) | const

Definition at line 904 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, 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::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::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.

## ◆ hasStandardLengthConversionCombination()

bool FormatSpecifier::hasStandardLengthConversionCombination | ( |  | ) | const

Definition at line 948 of file FormatString.cpp.

References clang::analyze_format_string::LengthModifier::AsLongDouble, clang::analyze_format_string::ConversionSpecifier::dArg, clang::analyze_format_string::ConversionSpecifier::iArg, 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.

## ◆ hasStandardLengthModifier()

bool FormatSpecifier::hasStandardLengthModifier | ( |  | ) | const

Definition at line 879 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, and clang::analyze_format_string::LengthModifier::None.

## ◆ hasValidLengthModifier()

bool FormatSpecifier::hasValidLengthModifier | ( | const TargetInfo & | Target,
|  | const LangOptions & | LO
| ) |  | const

Definition at line 720 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::cArg, clang::analyze_format_string::ConversionSpecifier::CArg, 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::TargetInfo::getTriple(), clang::analyze_format_string::ConversionSpecifier::iArg, 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.

## ◆ namedTypeToLengthModifier()

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 978 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(), Identifier, and clang::analyze_format_string::LengthModifier::setKind().

## ◆ setArgIndex()

void clang::analyze_format_string::FormatSpecifier::setArgIndex | ( | unsigned | i | ) |
| inline

Definition at line 420 of file FormatString.h.

## ◆ setFieldWidth()

void clang::analyze_format_string::FormatSpecifier::setFieldWidth | ( | const OptionalAmount & | Amt | ) |
| inline

Definition at line 448 of file FormatString.h.

Referenced by clang::analyze_format_string::ParseFieldWidth().

## ◆ setLengthModifier()

void clang::analyze_format_string::FormatSpecifier::setLengthModifier | ( | LengthModifier | lm | ) |
| inline

Definition at line 414 of file FormatString.h.

## ◆ setUsesPositionalArg()

void clang::analyze_format_string::FormatSpecifier::setUsesPositionalArg | ( |  | ) |
| inline

Definition at line 418 of file FormatString.h.

## ◆ setVectorNumElts()

void clang::analyze_format_string::FormatSpecifier::setVectorNumElts | ( | const OptionalAmount & | Amt | ) |
| inline

Definition at line 440 of file FormatString.h.

## ◆ usesPositionalArg()

bool clang::analyze_format_string::FormatSpecifier::usesPositionalArg | ( |  | ) | const
| inline

Definition at line 452 of file FormatString.h.

References clang::Target.

## Member Data Documentation

## ◆ argIndex

unsigned clang::analyze_format_string::FormatSpecifier::argIndex
| protected

Definition at line 408 of file FormatString.h.

## ◆ CS

ConversionSpecifier clang::analyze_format_string::FormatSpecifier::CS
| protected

Definition at line 401 of file FormatString.h.

## ◆ FieldWidth

OptionalAmount clang::analyze_format_string::FormatSpecifier::FieldWidth
| protected

Definition at line 400 of file FormatString.h.

## ◆ LM

LengthModifier clang::analyze_format_string::FormatSpecifier::LM
| protected

Definition at line 399 of file FormatString.h.

## ◆ UsesPositionalArg

bool clang::analyze_format_string::FormatSpecifier::UsesPositionalArg
| protected

Positional arguments, an IEEE extension: IEEE Std 1003.1, 2004 Edition http://www.opengroup.org/onlinepubs/009695399/functions/printf.html.

Definition at line 407 of file FormatString.h.

## ◆ VectorNumElts

OptionalAmount clang::analyze_format_string::FormatSpecifier::VectorNumElts
| protected

Definition at line 402 of file FormatString.h.

The documentation for this class was generated from the following files:

- include/clang/AST/FormatString.h
- lib/AST/FormatString.cpp