PrintfFormatString.cpp (213681) | PrintfFormatString.cpp (213694) |
---|---|
1//== PrintfFormatString.cpp - Analysis of printf format strings --*- C++ -*-==// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 181 unchanged lines hidden (view full) --- 190 case 'C': k = ConversionSpecifier::CArg; break; 191 case 'S': k = ConversionSpecifier::SArg; break; 192 // Objective-C. 193 case '@': k = ConversionSpecifier::ObjCObjArg; break; 194 // Glibc specific. 195 case 'm': k = ConversionSpecifier::PrintErrno; break; 196 // FreeBSD format extensions 197 case 'b': if (FormatExtensions) k = ConversionSpecifier::bArg; break; /* check for int and then char * */ | 1//== PrintfFormatString.cpp - Analysis of printf format strings --*- C++ -*-==// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 181 unchanged lines hidden (view full) --- 190 case 'C': k = ConversionSpecifier::CArg; break; 191 case 'S': k = ConversionSpecifier::SArg; break; 192 // Objective-C. 193 case '@': k = ConversionSpecifier::ObjCObjArg; break; 194 // Glibc specific. 195 case 'm': k = ConversionSpecifier::PrintErrno; break; 196 // FreeBSD format extensions 197 case 'b': if (FormatExtensions) k = ConversionSpecifier::bArg; break; /* check for int and then char * */ |
198 case 'r': if (FormatExtensions) k = ConversionSpecifier::xArg; break; | 198 case 'r': if (FormatExtensions) k = ConversionSpecifier::rArg; break; |
199 case 'y': if (FormatExtensions) k = ConversionSpecifier::iArg; break; 200 case 'D': if (FormatExtensions) k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */ 201 } 202 PrintfConversionSpecifier CS(conversionPosition, k); 203 FS.setConversionSpecifier(CS); 204 if (CS.consumesDataArgument() && !FS.usesPositionalArg()) 205 FS.setArgIndex(argIndex++); 206 // FreeBSD extension --- 67 unchanged lines hidden (view full) --- 274 case SArg: return "S"; 275 276 // Objective-C specific specifiers. 277 case ObjCObjArg: return "@"; 278 279 // FreeBSD specific specifiers. 280 case bArg: return "b"; 281 case DArg: return "D"; | 199 case 'y': if (FormatExtensions) k = ConversionSpecifier::iArg; break; 200 case 'D': if (FormatExtensions) k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */ 201 } 202 PrintfConversionSpecifier CS(conversionPosition, k); 203 FS.setConversionSpecifier(CS); 204 if (CS.consumesDataArgument() && !FS.usesPositionalArg()) 205 FS.setArgIndex(argIndex++); 206 // FreeBSD extension --- 67 unchanged lines hidden (view full) --- 274 case SArg: return "S"; 275 276 // Objective-C specific specifiers. 277 case ObjCObjArg: return "@"; 278 279 // FreeBSD specific specifiers. 280 case bArg: return "b"; 281 case DArg: return "D"; |
282 case rArg: return "r"; |
|
282 283 // GlibC specific specifiers. 284 case PrintErrno: return "m"; 285 } 286 return NULL; 287} 288 289//===----------------------------------------------------------------------===// --- 196 unchanged lines hidden (view full) --- 486 case ConversionSpecifier::fArg: 487 case ConversionSpecifier::FArg: 488 case ConversionSpecifier::eArg: 489 case ConversionSpecifier::EArg: 490 case ConversionSpecifier::gArg: 491 case ConversionSpecifier::GArg: 492 case ConversionSpecifier::aArg: 493 case ConversionSpecifier::AArg: | 283 284 // GlibC specific specifiers. 285 case PrintErrno: return "m"; 286 } 287 return NULL; 288} 289 290//===----------------------------------------------------------------------===// --- 196 unchanged lines hidden (view full) --- 487 case ConversionSpecifier::fArg: 488 case ConversionSpecifier::FArg: 489 case ConversionSpecifier::eArg: 490 case ConversionSpecifier::EArg: 491 case ConversionSpecifier::gArg: 492 case ConversionSpecifier::GArg: 493 case ConversionSpecifier::aArg: 494 case ConversionSpecifier::AArg: |
495 case ConversionSpecifier::rArg: |
|
494 return true; 495 496 default: 497 return false; 498 } 499} 500 501bool PrintfSpecifier::hasValidAlternativeForm() const { --- 7 unchanged lines hidden (view full) --- 509 case ConversionSpecifier::aArg: 510 case ConversionSpecifier::AArg: 511 case ConversionSpecifier::eArg: 512 case ConversionSpecifier::EArg: 513 case ConversionSpecifier::fArg: 514 case ConversionSpecifier::FArg: 515 case ConversionSpecifier::gArg: 516 case ConversionSpecifier::GArg: | 496 return true; 497 498 default: 499 return false; 500 } 501} 502 503bool PrintfSpecifier::hasValidAlternativeForm() const { --- 7 unchanged lines hidden (view full) --- 511 case ConversionSpecifier::aArg: 512 case ConversionSpecifier::AArg: 513 case ConversionSpecifier::eArg: 514 case ConversionSpecifier::EArg: 515 case ConversionSpecifier::fArg: 516 case ConversionSpecifier::FArg: 517 case ConversionSpecifier::gArg: 518 case ConversionSpecifier::GArg: |
519 case ConversionSpecifier::rArg: |
|
517 return true; 518 519 default: 520 return false; 521 } 522} 523 524bool PrintfSpecifier::hasValidLeadingZeros() const { --- 103 unchanged lines hidden --- | 520 return true; 521 522 default: 523 return false; 524 } 525} 526 527bool PrintfSpecifier::hasValidLeadingZeros() const { --- 103 unchanged lines hidden --- |