clang 20.0.0git
Macros | Typedefs | Functions
PrintfFormatString.cpp File Reference
#include "FormatStringParsing.h"
#include "clang/AST/FormatString.h"
#include "clang/AST/OSLog.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/Support/Regex.h"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/OpenCLExtensionTypes.def"
#include "clang/Basic/AArch64SVEACLETypes.def"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/RISCVVTypes.def"
#include "clang/Basic/WebAssemblyReferenceTypes.def"
#include "clang/Basic/AMDGPUTypes.def"
#include "clang/Basic/HLSLIntangibleTypes.def"
#include "clang/AST/BuiltinTypes.def"

Go to the source code of this file.

Macros

#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)    case BuiltinType::Id:
 
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)    case BuiltinType::Id:
 
#define SVE_TYPE(Name, Id, SingletonId)    case BuiltinType::Id:
 
#define PPC_VECTOR_TYPE(Name, Id, Size)    case BuiltinType::Id:
 
#define RVV_TYPE(Name, Id, SingletonId)   case BuiltinType::Id:
 
#define WASM_TYPE(Name, Id, SingletonId)   case BuiltinType::Id:
 
#define AMDGPU_TYPE(Name, Id, SingletonId)   case BuiltinType::Id:
 
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)   case BuiltinType::Id:
 
#define SIGNED_TYPE(Id, SingletonId)
 
#define UNSIGNED_TYPE(Id, SingletonId)
 
#define FLOATING_TYPE(Id, SingletonId)
 
#define BUILTIN_TYPE(Id, SingletonId)    case BuiltinType::Id:
 

Typedefs

typedef clang::analyze_format_string::SpecifierResult< PrintfSpecifierPrintfSpecifierResult
 

Functions

static bool ParsePrecision (FormatStringHandler &H, PrintfSpecifier &FS, const char *Start, const char *&Beg, const char *E, unsigned *argIndex)
 
static bool ParseObjCFlags (FormatStringHandler &H, PrintfSpecifier &FS, const char *FlagBeg, const char *E, bool Warn)
 
static PrintfSpecifierResult ParsePrintfSpecifier (FormatStringHandler &H, const char *&Beg, const char *E, unsigned &argIndex, const LangOptions &LO, const TargetInfo &Target, bool Warn, bool isFreeBSDKPrintf)
 

Macro Definition Documentation

◆ AMDGPU_TYPE

#define AMDGPU_TYPE (   Name,
  Id,
  SingletonId 
)    case BuiltinType::Id:

◆ BUILTIN_TYPE

#define BUILTIN_TYPE (   Id,
  SingletonId 
)     case BuiltinType::Id:

◆ EXT_OPAQUE_TYPE

#define EXT_OPAQUE_TYPE (   ExtType,
  Id,
  Ext 
)     case BuiltinType::Id:

◆ FLOATING_TYPE

#define FLOATING_TYPE (   Id,
  SingletonId 
)

◆ HLSL_INTANGIBLE_TYPE

#define HLSL_INTANGIBLE_TYPE (   Name,
  Id,
  SingletonId 
)    case BuiltinType::Id:

◆ IMAGE_TYPE

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)     case BuiltinType::Id:

◆ PPC_VECTOR_TYPE

#define PPC_VECTOR_TYPE (   Name,
  Id,
  Size 
)     case BuiltinType::Id:

◆ RVV_TYPE

#define RVV_TYPE (   Name,
  Id,
  SingletonId 
)    case BuiltinType::Id:

◆ SIGNED_TYPE

#define SIGNED_TYPE (   Id,
  SingletonId 
)

◆ SVE_TYPE

#define SVE_TYPE (   Name,
  Id,
  SingletonId 
)     case BuiltinType::Id:

◆ UNSIGNED_TYPE

#define UNSIGNED_TYPE (   Id,
  SingletonId 
)

◆ WASM_TYPE

#define WASM_TYPE (   Name,
  Id,
  SingletonId 
)    case BuiltinType::Id:

Typedef Documentation

◆ PrintfSpecifierResult

Definition at line 30 of file PrintfFormatString.cpp.

Function Documentation

◆ ParseObjCFlags()

static bool ParseObjCFlags ( FormatStringHandler H,
PrintfSpecifier FS,
const char *  FlagBeg,
const char *  E,
bool  Warn 
)
static

◆ ParsePrecision()

static bool ParsePrecision ( FormatStringHandler H,
PrintfSpecifier FS,
const char *  Start,
const char *&  Beg,
const char *  E,
unsigned argIndex 
)
static

◆ ParsePrintfSpecifier()

static PrintfSpecifierResult ParsePrintfSpecifier ( FormatStringHandler H,
const char *&  Beg,
const char *  E,
unsigned argIndex,
const LangOptions LO,
const TargetInfo Target,
bool  Warn,
bool  isFreeBSDKPrintf 
)
static

Definition at line 71 of file PrintfFormatString.cpp.

References clang::analyze_format_string::ConversionSpecifier::aArg, clang::analyze_format_string::ConversionSpecifier::AArg, clang::analyze_format_string::ConversionSpecifier::bArg, clang::analyze_format_string::ConversionSpecifier::BArg, c, clang::analyze_format_string::ConversionSpecifier::cArg, clang::analyze_format_string::ConversionSpecifier::CArg, clang::analyze_format_string::ConversionSpecifier::consumesDataArgument(), clang::analyze_format_string::ConversionSpecifier::dArg, clang::analyze_format_string::ConversionSpecifier::DArg, E, 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::FormatStringHandler::HandleIncompleteSpecifier(), clang::analyze_format_string::FormatStringHandler::handleInvalidMaskType(), clang::analyze_format_string::FormatStringHandler::HandleInvalidPrintfConversionSpecifier(), clang::analyze_format_string::FormatStringHandler::HandleNullChar(), clang::analyze_format_string::FormatStringHandler::HandleObjCFlagsWithNonObjCConversion(), clang::analyze_format_string::ConversionSpecifier::iArg, clang::analyze_format_string::ConversionSpecifier::InvalidSpecifier, clang::analyze_os_log::OSLogBufferItem::IsPrivate, clang::analyze_os_log::OSLogBufferItem::IsPublic, clang::analyze_os_log::OSLogBufferItem::IsSensitive, clang::analyze_format_string::ConversionSpecifier::kArg, clang::analyze_format_string::ConversionSpecifier::KArg, 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, ParseObjCFlags(), ParsePrecision(), clang::analyze_format_string::ConversionSpecifier::PercentArg, clang::analyze_format_string::ConversionSpecifier::PrintErrno, clang::analyze_format_string::ConversionSpecifier::rArg, clang::analyze_format_string::ConversionSpecifier::RArg, clang::analyze_format_string::ConversionSpecifier::sArg, clang::analyze_format_string::ConversionSpecifier::SArg, clang::analyze_format_string::ConversionSpecifier::setEndScanList(), 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.

Referenced by clang::analyze_format_string::parseFormatStringHasFormattingSpecifiers(), clang::analyze_format_string::ParseFormatStringHasSArg(), and clang::analyze_format_string::ParsePrintfString().