Go to the documentation of this file.
26 using namespace clang;
33 const char *&Beg,
const char *E) {
35 const char *start = I - 1;
53 if (I + 1 != E && I[0] ==
'^' && I[1] ==
']') {
84 const char *Start =
nullptr;
88 for ( ; I != E ; ++I) {
123 FS.setSuppressAssignment(I);
135 FS.setFieldWidth(Amt);
158 const char *conversionPosition = I++;
160 switch (*conversionPosition) {
188 if (
Target.getTriple().isOSDarwin())
192 if (
Target.getTriple().isOSDarwin())
196 if (
Target.getTriple().isOSDarwin())
201 if (k == ScanfConversionSpecifier::ScanListArg) {
205 FS.setConversionSpecifier(CS);
207 && !FS.usesPositionalArg())
208 FS.setArgIndex(argIndex++);
213 if (k == ScanfConversionSpecifier::InvalidSpecifier) {
214 unsigned Len = I - Beg;
217 FS.setConversionSpecifier(CS);
236 switch (LM.getKind()) {
267 llvm_unreachable(
"Unsupported LengthModifier Type");
276 switch (LM.getKind()) {
308 llvm_unreachable(
"Unsupported LengthModifier Type");
319 switch (LM.getKind()) {
334 switch (LM.getKind()) {
353 switch (LM.getKind()) {
374 switch (LM.getKind()) {
428 if (!ETy->getDecl()->isComplete())
430 PT = ETy->getDecl()->getIntegerType();
449 CAT->getSize().getZExtValue() - 1,
459 case BuiltinType::UInt:
460 case BuiltinType::Int:
466 case BuiltinType::Char_U:
467 case BuiltinType::UChar:
468 case BuiltinType::Char_S:
469 case BuiltinType::SChar:
474 case BuiltinType::Short:
475 case BuiltinType::UShort:
480 case BuiltinType::Long:
481 case BuiltinType::ULong:
482 case BuiltinType::Double:
487 case BuiltinType::LongLong:
488 case BuiltinType::ULongLong:
493 case BuiltinType::LongDouble:
503 if (isa<TypedefType>(PT) && (LangOpt.C99 || LangOpt.CPlusPlus11))
504 namedTypeToLengthModifier(PT, LM);
521 llvm_unreachable(
"Unexpected type");
529 if (usesPositionalArg())
530 os << getPositionalArgIndex() <<
"$";
531 if (SuppressAssignment)
534 FieldWidth.toString(os);
545 unsigned argIndex = 0;
565 assert(I == E &&
"Format string not exhausted");
This class is used for builtin types like 'int'.
CanQualType UnsignedShortTy
Represents the canonical version of C arrays with a specified constant size.
bool isWideCharType() const
A (possibly-)qualified type.
Exposes information about the current target.
bool isRealFloatingType() const
Floating point categories.
QualType getUnsignedPointerDiffType() const
Return the unique unsigned counterpart of "ptrdiff_t" integer type.
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
const ConstantArrayType * getAsConstantArrayType(QualType T) const
bool isAnyCharacterType() const
Determine whether this type is any of the built-in character types.
std::string toString(const til::SExpr *E)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
const T * getAs() const
Member-template getAs<specific type>'.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
CanQualType getSignedSizeType() const
Return the unique signed counterpart of the integer type corresponding to size_t.
CanQualType UnsignedLongLongTy
QualType getWideCharType() const
Return the type of wide characters.
CanQualType UnsignedCharTy
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
CanQualType UnsignedLongTy
CanQualType UnsignedIntTy
bool isPointerType() const
CanQualType getUIntMaxType() const
Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
const TargetInfo & getTargetInfo() const
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
__device__ __2f16 float c
Pieces specific to fscanf format strings.
bool isUnsignedIntegerType() const
Return true if this is an integer type that is unsigned, according to C99 6.2.5p6 [which returns true...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.