summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp5
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp1
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 16b96615c96..c26ba3cf9bb 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -2681,6 +2681,7 @@ Sema::FormatStringType Sema::GetFormatStringType(const FormatAttr *Format) {
.Case("strfmon", FST_Strfmon)
.Cases("kprintf", "cmn_err", "vcmn_err", "zcmn_err", FST_Kprintf)
.Case("freebsd_kprintf", FST_FreeBSDKPrintf)
+ .Case("os_trace", FST_OSTrace)
.Default(FST_Unknown);
}
@@ -4123,9 +4124,9 @@ void Sema::CheckFormatString(const StringLiteral *FExpr,
}
if (Type == FST_Printf || Type == FST_NSString ||
- Type == FST_FreeBSDKPrintf) {
+ Type == FST_FreeBSDKPrintf || Type == FST_OSTrace) {
CheckPrintfHandler H(*this, FExpr, OrigFormatExpr, firstDataArg,
- numDataArgs, (Type == FST_NSString),
+ numDataArgs, (Type == FST_NSString || Type == FST_OSTrace),
Str, HasVAListArg, Args, format_idx,
inFunctionCall, CallType, CheckedVarArgs);
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 0ec29ac2983..09b6aa49570 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -2494,6 +2494,7 @@ static FormatAttrKind getFormatAttrKind(StringRef Format) {
.Cases("cmn_err", "vcmn_err", "zcmn_err", SupportedFormat)
.Case("kprintf", SupportedFormat) // OpenBSD.
.Case("freebsd_kprintf", SupportedFormat) // FreeBSD.
+ .Case("os_trace", SupportedFormat)
.Cases("gcc_diag", "gcc_cdiag", "gcc_cxxdiag", "gcc_tdiag", IgnoredFormat)
.Default(InvalidFormat);
OpenPOWER on IntegriCloud