clang 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
clang::analyze_scanf::ScanfSpecifier Class Reference

#include "clang/AST/FormatString.h"

Inheritance diagram for clang::analyze_scanf::ScanfSpecifier:
Inheritance graph
[legend]

Public Member Functions

 ScanfSpecifier ()
 
void setSuppressAssignment (const char *position)
 
const OptionalFlaggetSuppressAssignment () const
 
void setConversionSpecifier (const ScanfConversionSpecifier &cs)
 
const ScanfConversionSpecifiergetConversionSpecifier () const
 
bool consumesDataArgument () const
 
ArgType getArgType (ASTContext &Ctx) const
 
bool fixType (QualType QT, QualType RawQT, const LangOptions &LangOpt, ASTContext &Ctx)
 
void toString (raw_ostream &os) const
 
- Public Member Functions inherited from clang::analyze_format_string::FormatSpecifier
 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
 
std::optional< LengthModifiergetCorrectedLengthModifier () const
 
bool hasStandardConversionSpecifier (const LangOptions &LangOpt) const
 
bool hasStandardLengthConversionCombination () const
 

Static Public Member Functions

static ScanfSpecifier 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
 

Detailed Description

Definition at line 670 of file FormatString.h.

Constructor & Destructor Documentation

◆ ScanfSpecifier()

clang::analyze_scanf::ScanfSpecifier::ScanfSpecifier ( )
inline

Definition at line 673 of file FormatString.h.

Member Function Documentation

◆ consumesDataArgument()

bool clang::analyze_scanf::ScanfSpecifier::consumesDataArgument ( ) const
inline

◆ fixType()

bool ScanfSpecifier::fixType ( QualType  QT,
QualType  RawQT,
const LangOptions LangOpt,
ASTContext Ctx 
)

Definition at line 414 of file ScanfFormatString.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::AsWideChar, clang::analyze_format_string::OptionalAmount::Constant, clang::analyze_format_string::FormatSpecifier::CS, clang::analyze_format_string::FormatSpecifier::FieldWidth, getArgType(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::BuiltinType::getKind(), clang::Type::getPointeeType(), clang::ASTContext::getTargetInfo(), clang::analyze_format_string::FormatSpecifier::hasValidLengthModifier(), clang::Type::isAnyCharacterType(), 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::Normal, clang::analyze_format_string::LengthModifier::setKind(), and clang::analyze_format_string::ConversionSpecifier::setKind().

◆ getArgType()

ArgType ScanfSpecifier::getArgType ( ASTContext Ctx) const

Definition at line 226 of file ScanfFormatString.cpp.

References clang::analyze_format_string::ArgType::AnyCharTy, 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::consumesDataArgument(), clang::analyze_format_string::ArgType::CPointerTy, clang::analyze_format_string::FormatSpecifier::CS, clang::analyze_format_string::ArgType::CStrTy, clang::ASTContext::DoubleTy, clang::ASTContext::FloatTy, getConversionSpecifier(), clang::ASTContext::getIntMaxType(), clang::analyze_format_string::LengthModifier::getKind(), clang::analyze_format_string::ConversionSpecifier::getKind(), clang::ASTContext::getPointerDiffType(), clang::ASTContext::getSignedSizeType(), clang::ASTContext::getSizeType(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ASTContext::getUIntMaxType(), clang::ASTContext::getUnsignedPointerDiffType(), clang::ASTContext::getWideCharType(), clang::ASTContext::IntTy, clang::analyze_format_string::ArgType::Invalid(), clang::analyze_format_string::FormatSpecifier::LM, clang::ASTContext::LongDoubleTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::analyze_format_string::LengthModifier::None, clang::analyze_format_string::ArgType::PtrTo(), clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, and clang::analyze_format_string::ArgType::WCStrTy.

Referenced by fixType().

◆ getConversionSpecifier()

const ScanfConversionSpecifier & clang::analyze_scanf::ScanfSpecifier::getConversionSpecifier ( ) const
inline

Definition at line 689 of file FormatString.h.

References clang::analyze_format_string::FormatSpecifier::CS.

Referenced by getArgType().

◆ getSuppressAssignment()

const OptionalFlag & clang::analyze_scanf::ScanfSpecifier::getSuppressAssignment ( ) const
inline

Definition at line 681 of file FormatString.h.

◆ Parse()

static ScanfSpecifier clang::analyze_scanf::ScanfSpecifier::Parse ( const char *  beg,
const char *  end 
)
static

◆ setConversionSpecifier()

void clang::analyze_scanf::ScanfSpecifier::setConversionSpecifier ( const ScanfConversionSpecifier cs)
inline

Definition at line 685 of file FormatString.h.

References clang::analyze_format_string::FormatSpecifier::CS.

◆ setSuppressAssignment()

void clang::analyze_scanf::ScanfSpecifier::setSuppressAssignment ( const char *  position)
inline

◆ toString()

void ScanfSpecifier::toString ( raw_ostream &  os) const

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