;
39UpdateOnReturn <const char*> UpdateBeg(Beg, I);
41 unsignedaccumulator = 0;
42 boolhasDigits =
false;
44 for( ; I !=
E; ++I) {
46 if(
c>=
'0'&&
c<=
'9') {
48accumulator = (accumulator * 10) + (
c-
'0');
81 const char*I = Beg + 1;
106 const char*Tmp = Beg;
125 const char*&Beg,
const char*
E,
126 unsigned*argIndex) {
170FS.setUsesPositionalArg();
189 const char*Start = I;
204FS.setVectorNumElts(NumElts);
217 const char*lmPosition = I;
223 if(I !=
E&& *I ==
'h') {
226}
else if(I !=
E&& *I ==
'l'&& LO.OpenCL) {
235 if(I !=
E&& *I ==
'l') {
248 if(IsScanf && !LO.C99 && !LO.CPlusPlus11) {
253 if(I !=
E&& (*I ==
's'|| *I ==
'S'|| *I ==
'[')) {
270 if(I + 1 !=
E&& I + 2 !=
E) {
271 if(I[1] ==
'6'&& I[2] ==
'4') {
279 if(I[1] ==
'3'&& I[2] ==
'2') {
292FS.setLengthModifier(lm);
297 const char*SpecifierBegin,
const char*FmtStrEnd,
unsigned&Len) {
298 if(SpecifierBegin + 1 >= FmtStrEnd)
301 constllvm::UTF8 *SB =
302 reinterpret_cast<constllvm::UTF8 *
>(SpecifierBegin + 1);
303 constllvm::UTF8 *SE =
reinterpret_cast<constllvm::UTF8 *
>(FmtStrEnd);
304 const charFirstByte = *SB;
309 unsignedNumBytes = llvm::getNumBytesForUTF8(FirstByte);
312 if(SB + NumBytes > SE)
329argTy =
C.getDecayedType(argTy);
346llvm_unreachable(
"ArgType must be valid");
356 if(!ETy->getDecl()->isComplete())
358 if(ETy->isUnscopedEnumerationType())
359argTy = ETy->getDecl()->getIntegerType();
364 switch(BT->getKind()) {
367 caseBuiltinType::Char_S:
368 caseBuiltinType::SChar:
369 caseBuiltinType::UChar:
370 caseBuiltinType::Char_U:
372 caseBuiltinType::Bool:
379 switch(BT->getKind()) {
382 caseBuiltinType::Int:
383 caseBuiltinType::UInt:
385 caseBuiltinType::Short:
386 caseBuiltinType::UShort:
387 caseBuiltinType::WChar_S:
388 caseBuiltinType::WChar_U:
401 if(!ETy->getDecl()->isComplete())
403 else if(ETy->isUnscopedEnumerationType())
404argTy = ETy->getDecl()->getIntegerType();
408argTy =
C.getCorrespondingUnsaturatedType(argTy);
410argTy =
C.getCanonicalType(argTy).getUnqualifiedType();
417 switch(BT->getKind()) {
420 caseBuiltinType::Bool:
421 if(Ptr && (T ==
C.UnsignedCharTy || T ==
C.SignedCharTy))
424 caseBuiltinType::Char_S:
425 caseBuiltinType::SChar:
426 if(T ==
C.UnsignedShortTy || T ==
C.ShortTy)
428 if(T ==
C.UnsignedCharTy)
430 if(T ==
C.SignedCharTy)
433 caseBuiltinType::Char_U:
434 caseBuiltinType::UChar:
435 if(T ==
C.UnsignedShortTy || T ==
C.ShortTy)
437 if(T ==
C.UnsignedCharTy)
439 if(T ==
C.SignedCharTy)
442 caseBuiltinType::Short:
443 if(T ==
C.UnsignedShortTy)
446 caseBuiltinType::UShort:
450 caseBuiltinType::Int:
451 if(T ==
C.UnsignedIntTy)
454 caseBuiltinType::UInt:
458 caseBuiltinType::Long:
459 if(T ==
C.UnsignedLongTy)
462 caseBuiltinType::ULong:
466 caseBuiltinType::LongLong:
467 if(T ==
C.UnsignedLongLongTy)
470 caseBuiltinType::ULongLong:
471 if(T ==
C.LongLongTy)
477 switch(BT->getKind()) {
480 caseBuiltinType::Bool:
481 if(T ==
C.IntTy || T ==
C.UnsignedIntTy)
484 caseBuiltinType::Int:
485 caseBuiltinType::UInt:
486 if(T ==
C.SignedCharTy || T ==
C.UnsignedCharTy ||
487T ==
C.ShortTy || T ==
C.UnsignedShortTy || T ==
C.WCharTy ||
491 caseBuiltinType::Char_U:
492 if(T ==
C.UnsignedIntTy)
494 if(T ==
C.UnsignedShortTy)
497 caseBuiltinType::Char_S:
503 caseBuiltinType::Half:
504 caseBuiltinType::Float:
505 if(T ==
C.DoubleTy)
508 caseBuiltinType::Short:
509 caseBuiltinType::UShort:
510 if(T ==
C.SignedCharTy || T ==
C.UnsignedCharTy)
513 caseBuiltinType::WChar_U:
514 caseBuiltinType::WChar_S:
515 if(T !=
C.WCharTy && T !=
C.WideCharTy)
532 C.hasSameUnqualifiedType(PT->getPointeeType(),
C.getWideCharType()))
537 QualTypeWInt =
C.getCanonicalType(
C.getWIntType()).getUnqualifiedType();
539 if(
C.getCanonicalType(argTy).getUnqualifiedType() == WInt)
542 QualTypePromoArg =
C.isPromotableIntegerType(argTy)
543?
C.getPromotedIntegerType(argTy)
545PromoArg =
C.getCanonicalType(PromoArg).getUnqualifiedType();
550 C.getCorrespondingUnsignedType(PromoArg) == WInt)
595llvm_unreachable(
"Invalid ArgType Kind!");
603 QualTypeVec =
C.getExtVectorType(T, NumElts);
611llvm_unreachable(
"No representative type for Invalid ArgType");
613llvm_unreachable(
"No representative type for Unknown ArgType");
621Res =
C.getPointerType(
C.CharTy);
624Res =
C.getPointerType(
C.getWideCharType());
627Res =
C.ObjCBuiltinIdTy;
633Res =
C.getWIntType();
639Res =
C.getPointerType(Res);
652Alias += (Alias[Alias.size()-1] ==
'*') ?
"*":
" *";
660 returnstd::string(
"'") + Alias +
"' (aka '"+ S +
"')";
661 returnstd::string(
"'") + S +
"'";
725 case bArg:
return "b";
726 case BArg:
return "B";
727 case dArg:
return "d";
728 case DArg:
return "D";
729 case iArg:
return "i";
730 case oArg:
return "o";
731 case OArg:
return "O";
732 case uArg:
return "u";
733 case UArg:
return "U";
734 case xArg:
return "x";
735 case XArg:
return "X";
736 case fArg:
return "f";
737 case FArg:
return "F";
738 case eArg:
return "e";
739 case EArg:
return "E";
740 case gArg:
return "g";
741 case GArg:
return "G";
742 case aArg:
return "a";
743 case AArg:
return "A";
744 case cArg:
return "c";
745 case sArg:
return "s";
746 case pArg:
return "p";
749 case nArg:
return "n";
755 case CArg:
return "C";
756 case SArg:
return "S";
771 case ZArg:
return "Z";
786std::optional<ConversionSpecifier>
849 if(
Target.getTriple().isOSMSVCRT()) {
884 return Target.getTriple().isOSFreeBSD() ||
Target.getTriple().isPS();
924 return Target.getTriple().isOSFreeBSD() ||
Target.getTriple().isPS();
947 return!
Target.getTriple().isOSDarwin() &&
948!
Target.getTriple().isOSWindows();
984 return Target.getTriple().isOSMSVCRT();
995 return Target.getTriple().isOSMSVCRT();
1000llvm_unreachable(
"Invalid LengthModifier Kind!");
1025llvm_unreachable(
"Invalid LengthModifier Kind!");
1058 returnLangOpt.ObjC;
1074 returnLangOpt.FixedPoint;
1076llvm_unreachable(
"Invalid ConversionSpecifier Kind!");
1096std::optional<LengthModifier>
1107 returnstd::nullopt;
1113QT = TT->getDecl()->getUnderlyingType()) {
1119}
else if(
Identifier->getName() ==
"ssize_t") {
1123}
else if(
Identifier->getName() ==
"intmax_t") {
1126}
else if(
Identifier->getName() ==
"uintmax_t") {
1129}
else if(
Identifier->getName() ==
"ptrdiff_t") {
Defines the clang::LangOptions interface.
llvm::MachO::Target Target
__device__ __2f16 float c
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This class is used for builtin types like 'int'.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Represents a pointer to an Objective C object.
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
bool isConstQualified() const
Determine whether this type is const-qualified.
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
Exposes information about the current target.
bool isBlockPointerType() const
bool canDecayToPointerType() const
Determines whether this type can decay to a pointer type.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isSaturatedFixedPointType() const
Return true if this is a saturated fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
bool hasSignedIntegerRepresentation() const
Determine whether this type has an signed integer representation of some sort, e.g....
const RecordType * getAsStructureType() const
bool isObjCObjectPointerType() const
const T * getAs() const
Member-template getAs<specific type>'.
bool isNullPtrType() const
Base class for declarations which introduce a typedef-name.
MatchKind
How well a given conversion specifier matches its argument.
@ NoMatch
The conversion specifier and the argument types are incompatible.
@ NoMatchPedantic
The conversion specifier and the argument type are disallowed by the C standard, but are in practice ...
@ Match
The conversion specifier and the argument type are compatible.
@ MatchPromotion
The conversion specifier and the argument type are compatible because of default argument promotions.
@ NoMatchSignedness
The conversion specifier and the argument type have different sign.
@ NoMatchTypeConfusion
The conversion specifier and the argument type are compatible, but still seems likely to be an error.
@ NoMatchPromotionTypeConfusion
The conversion specifier and the argument type are compatible but still seems likely to be an error.
ArgType makeVectorType(ASTContext &C, unsigned NumElts) const
QualType getRepresentativeType(ASTContext &C) const
std::string getRepresentativeTypeName(ASTContext &C) const
MatchKind matchesType(ASTContext &C, QualType argTy) const
std::optional< ConversionSpecifier > getStandardSpecifier() const
bool isFixedPointArg() const
const char * toString() const
void setFieldWidth(const OptionalAmount &Amt)
bool hasStandardLengthConversionCombination() const
bool hasStandardConversionSpecifier(const LangOptions &LangOpt) const
bool hasStandardLengthModifier() const
OptionalAmount VectorNumElts
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 L...
bool hasValidLengthModifier(const TargetInfo &Target, const LangOptions &LO) const
std::optional< LengthModifier > getCorrectedLengthModifier() const
virtual ~FormatStringHandler()
virtual void HandlePosition(const char *startPos, unsigned posLen)
virtual void HandleInvalidPosition(const char *startPos, unsigned posLen, PositionContext p)
virtual void HandleZeroPosition(const char *startPos, unsigned posLen)
virtual void HandleIncompleteSpecifier(const char *startSpecifier, unsigned specifierLen)
Represents the length modifier in a format string in scanf/printf.
const char * toString() const
ArgType getArgType(ASTContext &Ctx) const
void toString(raw_ostream &os) const
HowSpecified getHowSpecified() const
bool usesPositionalArg() const
unsigned getConstantAmount() const
unsigned getPositionalArgIndex() const
Defines the clang::TargetInfo interface.
bool ParseFieldWidth(FormatStringHandler &H, FormatSpecifier &CS, const char *Start, const char *&Beg, const char *E, unsigned *argIndex)
OptionalAmount ParsePositionAmount(FormatStringHandler &H, const char *Start, const char *&Beg, const char *E, PositionContext p)
OptionalAmount ParseAmount(const char *&Beg, const char *E)
OptionalAmount ParseNonPositionAmount(const char *&Beg, const char *E, unsigned &argIndex)
bool ParseLengthModifier(FormatSpecifier &FS, const char *&Beg, const char *E, const LangOptions &LO, bool IsScanf=false)
Returns true if a LengthModifier was parsed and installed in the FormatSpecifier& argument,...
bool ParseArgPosition(FormatStringHandler &H, FormatSpecifier &CS, const char *Start, const char *&Beg, const char *E)
bool ParseVectorModifier(FormatStringHandler &H, FormatSpecifier &FS, const char *&Beg, const char *E, const LangOptions &LO)
bool ParseUTF8InvalidSpecifier(const char *SpecifierBegin, const char *FmtStrEnd, unsigned &Len)
Returns true if the invalid specifier in SpecifierBegin is a UTF-8 string; check that it won't go fur...
The JSON file list parser is used to communicate input to InstallAPI.
@ None
The alignment was not explicit in code.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4