clang 10.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:
[legend]
Collaboration diagram for clang::analyze_scanf::ScanfSpecifier:
[legend]

## Public Member Functions
| ScanfSpecifier ()
void | setSuppressAssignment (const char *position)
const OptionalFlag & | getSuppressAssignment () const
void | setConversionSpecifier (const ScanfConversionSpecifier &cs)
const ScanfConversionSpecifier & | getConversionSpecifier () 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 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 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. More...

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

## Detailed Description

Definition at line 646 of file FormatString.h.

## Constructor & Destructor Documentation

## ◆ ScanfSpecifier()

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

Definition at line 649 of file FormatString.h.

## Member Function Documentation

## ◆ consumesDataArgument()

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

Definition at line 669 of file FormatString.h.

References clang::analyze_format_string::OptionalFlag::toString().

## ◆ fixType()

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

Definition at line 412 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::ConversionSpecifier::dArg, clang::analyze_format_string::ConversionSpecifier::fArg, clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::BuiltinType::getKind(), clang::Type::getPointeeType(), clang::ASTContext::getTargetInfo(), 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::ArgType::matchesType(), clang::analyze_format_string::ConversionSpecifier::nArg, clang::analyze_format_string::LengthModifier::None, clang::ArrayType::Normal, clang::analyze_format_string::ConversionSpecifier::sArg, and clang::analyze_format_string::ConversionSpecifier::uArg.

## ◆ getArgType()

ArgType ScanfSpecifier::getArgType | ( | ASTContext & | Ctx | ) | const

Definition at line 225 of file ScanfFormatString.cpp.

References clang::analyze_format_string::ConversionSpecifier::aArg, clang::analyze_format_string::ConversionSpecifier::AArg, 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::cArg, clang::analyze_format_string::ConversionSpecifier::CArg, clang::analyze_format_string::ConversionSpecifier::consumesDataArgument(), clang::analyze_format_string::ArgType::CPointerTy, clang::analyze_format_string::ArgType::CStrTy, clang::analyze_format_string::ConversionSpecifier::dArg, clang::analyze_format_string::ConversionSpecifier::DArg, clang::ASTContext::DoubleTy, 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::ASTContext::FloatTy, clang::analyze_format_string::ConversionSpecifier::gArg, clang::analyze_format_string::ConversionSpecifier::GArg, clang::ASTContext::getIntMaxType(), 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::analyze_format_string::ConversionSpecifier::iArg, clang::ASTContext::IntTy, clang::analyze_format_string::ArgType::Invalid(), clang::ASTContext::LongDoubleTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, 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::pArg, clang::analyze_format_string::ArgType::PtrTo(), clang::analyze_format_string::ConversionSpecifier::sArg, clang::analyze_format_string::ConversionSpecifier::SArg, clang::analyze_format_string::ConversionSpecifier::ScanListArg, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::analyze_format_string::ConversionSpecifier::uArg, clang::analyze_format_string::ConversionSpecifier::UArg, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, clang::analyze_format_string::ArgType::WCStrTy, clang::analyze_format_string::ConversionSpecifier::xArg, and clang::analyze_format_string::ConversionSpecifier::XArg.

## ◆ getConversionSpecifier()

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

Definition at line 665 of file FormatString.h.

## ◆ getSuppressAssignment()

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

Definition at line 657 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 661 of file FormatString.h.

## ◆ setSuppressAssignment()

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

Definition at line 653 of file FormatString.h.

References clang::analyze_format_string::OptionalFlag::setPosition().

## ◆ toString()

void ScanfSpecifier::toString | ( | raw_ostream & | os | ) | const

Definition at line 526 of file ScanfFormatString.cpp.

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

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