aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-01-22 21:31:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-01-22 21:31:48 +0000
commita7dea1671b87c07d2d266f836bfa8b58efc7c134 (patch)
treeff67344b3b18fc14e0cec322849afb4e3b94ea56 /contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp
parent5c713029ff7939f90b6f96df914953e758855a7f (diff)
parent519fc96c475680de2cc49e7811dbbfadb912cbcc (diff)
Notes
Diffstat (limited to 'contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp b/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp
index a1207aae5aa2..bae60d464407 100644
--- a/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp
+++ b/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp
@@ -463,6 +463,23 @@ bool clang::analyze_format_string::ParseFormatStringHasSArg(const char *I,
return false;
}
+bool clang::analyze_format_string::parseFormatStringHasFormattingSpecifiers(
+ const char *Begin, const char *End, const LangOptions &LO,
+ const TargetInfo &Target) {
+ unsigned ArgIndex = 0;
+ // Keep looking for a formatting specifier until we have exhausted the string.
+ FormatStringHandler H;
+ while (Begin != End) {
+ const PrintfSpecifierResult &FSR =
+ ParsePrintfSpecifier(H, Begin, End, ArgIndex, LO, Target, false, false);
+ if (FSR.shouldStop())
+ break;
+ if (FSR.hasValue())
+ return true;
+ }
+ return false;
+}
+
//===----------------------------------------------------------------------===//
// Methods on PrintfSpecifier.
//===----------------------------------------------------------------------===//
@@ -769,6 +786,9 @@ bool PrintfSpecifier::fixType(QualType QT, const LangOptions &LangOpt,
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
case BuiltinType::Id:
#include "clang/Basic/OpenCLExtensionTypes.def"
+#define SVE_TYPE(Name, Id, SingletonId) \
+ case BuiltinType::Id:
+#include "clang/Basic/AArch64SVEACLETypes.def"
#define SIGNED_TYPE(Id, SingletonId)
#define UNSIGNED_TYPE(Id, SingletonId)
#define FLOATING_TYPE(Id, SingletonId)