clang  14.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:
Inheritance graph
[legend]
Collaboration diagram for clang::analyze_format_string::FormatSpecifier:
Collaboration graph
[legend]

Public Member Functions

 FormatSpecifier (bool isPrintf)
 
void setLengthModifier (LengthModifier lm)
 
void setUsesPositionalArg ()
 
void setArgIndex (unsigned i)
 
unsigned getArgIndex () const
 
unsigned getPositionalArgIndex () const
 
const LengthModifiergetLengthModifier () const
 
const OptionalAmountgetFieldWidth () const
 
void setVectorNumElts (const OptionalAmount &Amt)
 
const OptionalAmountgetVectorNumElts () const
 
void setFieldWidth (const OptionalAmount &Amt)
 
bool usesPositionalArg () const
 
bool hasValidLengthModifier (const TargetInfo &Target, const LangOptions &LO) const
 
bool hasStandardLengthModifier () const
 
Optional< LengthModifiergetCorrectedLengthModifier () 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.

References argIndex.

◆ getCorrectedLengthModifier()

Optional< LengthModifier > FormatSpecifier::getCorrectedLengthModifier ( ) const

◆ getFieldWidth()

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

Definition at line 436 of file FormatString.h.

References FieldWidth.

◆ getLengthModifier()

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

Definition at line 432 of file FormatString.h.

References LM.

◆ getPositionalArgIndex()

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

Definition at line 428 of file FormatString.h.

References argIndex.

◆ getVectorNumElts()

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

Definition at line 444 of file FormatString.h.

References VectorNumElts.

◆ hasStandardConversionSpecifier()

bool FormatSpecifier::hasStandardConversionSpecifier ( const LangOptions LangOpt) const

Definition at line 903 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::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::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

◆ hasStandardLengthModifier()

bool FormatSpecifier::hasStandardLengthModifier ( ) const

◆ hasValidLengthModifier()

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

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

◆ namedTypeToLengthModifier()

bool FormatSpecifier::namedTypeToLengthModifier ( QualType  QT,
LengthModifier LM 
)
static

◆ setArgIndex()

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

Definition at line 420 of file FormatString.h.

References argIndex.

◆ setFieldWidth()

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

Definition at line 448 of file FormatString.h.

References FieldWidth.

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.

References LM.

◆ setUsesPositionalArg()

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

Definition at line 418 of file FormatString.h.

References UsesPositionalArg.

◆ setVectorNumElts()

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

Definition at line 440 of file FormatString.h.

References VectorNumElts.

◆ usesPositionalArg()

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

Definition at line 452 of file FormatString.h.

References UsesPositionalArg.

Member Data Documentation

◆ argIndex

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

Definition at line 408 of file FormatString.h.

Referenced by getArgIndex(), getPositionalArgIndex(), and setArgIndex().

◆ CS

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

◆ FieldWidth

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

Definition at line 400 of file FormatString.h.

Referenced by getFieldWidth(), and setFieldWidth().

◆ LM

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

◆ UsesPositionalArg

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

◆ VectorNumElts

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

Definition at line 402 of file FormatString.h.

Referenced by getVectorNumElts(), hasValidLengthModifier(), and setVectorNumElts().


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