[clang] 7721db4 - [WebKit Static Analyzer] Treat WTFReportBacktrace as a trivial function. (#108167)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 11 10:08:41 PDT 2024
Author: Ryosuke Niwa
Date: 2024-09-11T10:08:30-07:00
New Revision: 7721db489630166a220cfc27051d6259588229e1
URL: https://github.com/llvm/llvm-project/commit/7721db489630166a220cfc27051d6259588229e1
DIFF: https://github.com/llvm/llvm-project/commit/7721db489630166a220cfc27051d6259588229e1.diff
LOG: [WebKit Static Analyzer] Treat WTFReportBacktrace as a trivial function. (#108167)
Treat WTFReportBacktrace, which prints out the backtrace, as trivial.
Added:
Modified:
clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
Removed:
################################################################################
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
index 49bbff1942167b..2b9b7883c978ba 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
@@ -397,6 +397,7 @@ class TrivialFunctionAnalysisVisitor
return true;
if (Name == "WTFCrashWithInfo" || Name == "WTFBreakpointTrap" ||
+ Name == "WTFReportBacktrace" ||
Name == "WTFCrashWithSecurityImplication" || Name == "WTFCrash" ||
Name == "WTFReportAssertionFailure" || Name == "isMainThread" ||
Name == "isMainThreadOrGCThread" || Name == "isMainRunLoop" ||
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp b/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
index a98c6eb9c84d97..424ebd349e955a 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
@@ -6,6 +6,7 @@
void WTFBreakpointTrap();
void WTFCrashWithInfo(int, const char*, const char*, int);
void WTFReportAssertionFailure(const char* file, int line, const char* function, const char* assertion);
+void WTFReportBacktrace(void);
void WTFCrash(void);
void WTFCrashWithSecurityImplication(void);
@@ -334,6 +335,7 @@ class RefCounted {
}
unsigned trivial60() { return ObjectWithNonTrivialDestructor { 5 }.value(); }
unsigned trivial61() { return DerivedNumber('7').value(); }
+ void trivial62() { WTFReportBacktrace(); }
static RefCounted& singleton() {
static RefCounted s_RefCounted;
@@ -506,6 +508,7 @@ class UnrelatedClass {
getFieldTrivial().trivial59(); // no-warning
getFieldTrivial().trivial60(); // no-warning
getFieldTrivial().trivial61(); // no-warning
+ getFieldTrivial().trivial62(); // no-warning
RefCounted::singleton().trivial18(); // no-warning
RefCounted::singleton().someFunction(); // no-warning
More information about the cfe-commits
mailing list